]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't try to send RTP when remote_address is null
authorTerry Wilson <twilson@digium.com>
Wed, 6 Oct 2010 04:35:51 +0000 (04:35 +0000)
committerTerry Wilson <twilson@digium.com>
Wed, 6 Oct 2010 04:35:51 +0000 (04:35 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.8@290542 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_rtp_asterisk.c

index ffd7b2596aed56028b083231cdb7ff822516d5fa..72032de60e1b599c730345c6f4e9b49e2f5fede3 100644 (file)
@@ -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) {