aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-10-06 04:35:51 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-10-06 04:35:51 +0000
commit809cf473f24c825adfd3fcb217a0ec580327b295 (patch)
treeb0ce55c10bbdc9c8d375a3aed949cc753a206fe7
parent7e38443114c74acf73bbd2b78fbaa2928ba2a10b (diff)
Don't try to send RTP when remote_address is null
It is possible for ast_rtp_stop() to be called which will clear the remote address and cause the sendto to fail and spam warnings. Don't send in this case. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@290542 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_rtp_asterisk.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index ffd7b2596..72032de60 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1945,6 +1945,11 @@ static int bridge_p2p_rtp_write(struct ast_rtp_instance *instance, unsigned int
ast_rtp_instance_get_remote_address(instance1, &remote_address);
+ if (ast_sockaddr_isnull(&remote_address)) {
+ ast_debug(1, "Remote address is null, most likely RTP has been stopped\n");
+ return 0;
+ }
+
/* Send the packet back out */
res = rtp_sendto(instance1, (void *)rtpheader, len, 0, &remote_address);
if (res < 0) {