diff options
author | Mark Spencer <markster@digium.com> | 2004-07-31 02:31:24 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2004-07-31 02:31:24 +0000 |
commit | a70d4443339e56062c85d432edebd9823a6786a7 (patch) | |
tree | 425448ac4c8726d99188630f912450a7e40a19ed /channels | |
parent | 79a00a33f95eaf26fa600958e4be4d47c6463d55 (diff) |
Improve debugging of RTP ports (bug #2131, heavily modified)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3548 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_sip.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 24777946e..756e11a9b 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2682,17 +2682,25 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) /* RTP addresses and ports for audio and video */ sin.sin_family = AF_INET; memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr)); + /* Setup audio port number */ sin.sin_port = htons(portno); - if (p->rtp && sin.sin_port) + if (p->rtp && sin.sin_port) { ast_rtp_set_peer(p->rtp, &sin); + if (debug) { + ast_verbose("Peer audio RTP is at port %s:%d\n", ast_inet_ntoa(iabuf,sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port)); + ast_log(LOG_DEBUG,"Peer audio RTP is at port %s:%d\n",ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port)); + } + } /* Setup video port number */ sin.sin_port = htons(vportno); - if (p->vrtp && sin.sin_port) + if (p->vrtp && sin.sin_port) { ast_rtp_set_peer(p->vrtp, &sin); - - if (sipdebug) - ast_verbose("Peer RTP is at port %s:%d\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port)); + if (debug) { + ast_verbose("Peer video RTP is at port %s:%d\n", ast_inet_ntoa(iabuf,sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port)); + ast_log(LOG_DEBUG,"Peer video RTP is at port %s:%d\n",ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port)); + } + } /* Next, scan through each "a=rtpmap:" line, noting each * specified RTP payload type (with corresponding MIME subtype): |