[asterisk-commits] tzafrir: branch tzafrir/monitor-rtp-14 r214861 - /team/tzafrir/monitor-rtp-14...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Aug 30 07:23:53 CDT 2009
Author: tzafrir
Date: Sun Aug 30 07:23:49 2009
New Revision: 214861
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=214861
Log:
fix the INVITE SDP to use the destination address
Modified:
team/tzafrir/monitor-rtp-14/res/res_monitor.c
Modified: team/tzafrir/monitor-rtp-14/res/res_monitor.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/tzafrir/monitor-rtp-14/res/res_monitor.c?view=diff&rev=214861&r1=214860&r2=214861
==============================================================================
--- team/tzafrir/monitor-rtp-14/res/res_monitor.c (original)
+++ team/tzafrir/monitor-rtp-14/res/res_monitor.c Sun Aug 30 07:23:49 2009
@@ -232,6 +232,7 @@
char packet[BUFSIZ];
struct sockaddr_in my_addr;
char my_ip[INET_ADDRSTRLEN + 1];
+ char dst_ip[INET_ADDRSTRLEN + 1];
in_port_t rtp_port = rtp_state->dest.sin_port;
struct ast_cdr *cdr = chan ? chan->cdr : NULL;
int content_length;
@@ -275,6 +276,10 @@
}
if(inet_ntop(AF_INET, &my_addr.sin_addr, my_ip, sizeof(my_ip)) == NULL) {
ast_log(LOG_WARNING, "Cannot convert ip address: %s\n", strerror(errno));
+ return -1;
+ }
+ if(inet_ntop(AF_INET, &sip_server_addr.sin_addr, dst_ip, sizeof(dst_ip)) == NULL) {
+ ast_log(LOG_WARNING, "Cannot convert server ip address: %s\n", strerror(errno));
return -1;
}
ast_cdr_getvar(cdr, "src", &src, srcbuf, sizeof(srcbuf), 0, 0);
@@ -290,7 +295,7 @@
"m=audio %d RTP/AVP 0 \r\n"
"a=rtpmap:0 PCMU/8000\r\n",
chan->uniqueid, my_ip,
- my_ip,
+ dst_ip,
(is_rx) ? "RX" : "TX",
getpid(),
ntohs(rtp_port));
More information about the asterisk-commits
mailing list