diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-09 21:09:42 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-09 21:09:42 +0000 |
commit | bf45417f7149b5c08b40a09d47271b410d9c2d90 (patch) | |
tree | 52463f6a96737ab14e9646bf199682dfaaa1d885 /channels | |
parent | 0f9cabe4d5959d4b424512d6dc37ab7d7fdc52d2 (diff) |
- RTP debug message formatting
- Add rtcp report to SIP history
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33371 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a27780408..1930e3cd2 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2968,6 +2968,14 @@ static int sip_hangup(struct ast_channel *ast) if (!p->pendinginvite) { /* Send a hangup */ transmit_request_with_auth(p, SIP_BYE, 0, XMIT_RELIABLE, 1); + + /* Get RTCP quality before end of call */ + if (recordhistory) { + if (p->rtp) + append_history(p, "RTCPaudio", "Quality:%s", ast_rtp_get_quality(p->rtp)); + if (p->vrtp) + append_history(p, "RTCPvideo", "Quality:%s", ast_rtp_get_quality(p->vrtp)); + } } else { /* Note we will need a BYE when this all settles out but we can't send one while we have "INVITE" outstanding. */ @@ -3665,14 +3673,15 @@ static struct sip_pvt *sip_alloc(ast_string_field callid, struct sockaddr_in *si if (intended_method != SIP_OPTIONS) /* Peerpoke has it's own system */ p->timer_t1 = 500; /* Default SIP retransmission timer T1 (RFC 3261) */ + if (sin) { p->sa = *sin; if (ast_sip_ouraddrfor(&p->sa.sin_addr,&p->ourip)) p->ourip = __ourip; - } else { + } else p->ourip = __ourip; - } - + + /* Copy global flags to this PVT at setup. */ ast_copy_flags(&p->flags[0], &global_flags[0], SIP_FLAGS_TO_COPY); ast_copy_flags(&p->flags[1], &global_flags[1], SIP_PAGE2_FLAGS_TO_COPY); @@ -3682,6 +3691,7 @@ static struct sip_pvt *sip_alloc(ast_string_field callid, struct sockaddr_in *si if (sip_methods[intended_method].need_rtp) { p->rtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr); + /* If the global videosupport flag is on, we always create a RTP interface for video */ if (ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT)) p->vrtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr); if (!p->rtp || (ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT) && !p->vrtp)) { @@ -9551,7 +9561,7 @@ void sip_dump_history(struct sip_pvt *dialog) ast_log(LOG_DEBUG, " * SIP Call\n"); if (dialog->history) AST_LIST_TRAVERSE(dialog->history, hist, list) - ast_log(LOG_DEBUG, " %d. %s\n", ++x, hist->event); + ast_log(LOG_DEBUG, " %-3.3d. %s\n", ++x, hist->event); if (!x) ast_log(LOG_DEBUG, "Call '%s' has no history\n", dialog->callid); ast_log(LOG_DEBUG, "\n---------- END SIP HISTORY for '%s' \n", dialog->callid); @@ -12626,6 +12636,14 @@ static int handle_request_bye(struct sip_pvt *p, struct sip_request *req) copy_request(&p->initreq, req); check_via(p, req); ast_set_flag(&p->flags[0], SIP_ALREADYGONE); + + /* Get RTCP quality before end of call */ + if (recordhistory) { + if (p->rtp) + append_history(p, "RTCPaudio", "Quality:%s", ast_rtp_get_quality(p->rtp)); + if (p->vrtp) + append_history(p, "RTCPvideo", "Quality:%s", ast_rtp_get_quality(p->vrtp)); + } if (p->rtp) { /* Immediately stop RTP */ ast_rtp_stop(p->rtp); @@ -13700,6 +13718,8 @@ static struct ast_channel *sip_request_call(const char *type, int format, void * if (create_addr(p, host)) { *cause = AST_CAUSE_UNREGISTERED; + if (option_debug > 2) + ast_log(LOG_DEBUG, "Cant create SIP call - target device not registred\n"); sip_destroy(p); return NULL; } |