]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Do not allocate SIP pvt's for PEERs we can not reach.
authorOlle Johansson <oej@edvina.net>
Thu, 10 May 2007 20:38:54 +0000 (20:38 +0000)
committerOlle Johansson <oej@edvina.net>
Thu, 10 May 2007 20:38:54 +0000 (20:38 +0000)
This was seen as a lot of dialogs being created then immediately destroyed at reload/restart of the SIP channel.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@63748 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 1924c406abca736847cab11a23bf0e2b7ef78cb4..85981ee4601cb7e4b9f9a77f1962e31de2e211cd 100644 (file)
@@ -11563,6 +11563,10 @@ static int sip_send_mwi_to_peer(struct sip_peer *peer)
        struct sip_pvt *p;
        int newmsgs, oldmsgs;
 
+       /* Do we have an IP address? If not, skip this peer */
+       if (!peer->addr.sin_addr.s_addr && !peer->defaddr.sin_addr.s_addr) 
+               return 0;
+
        /* Check for messages */
        ast_app_messagecount(peer->mailbox, &newmsgs, &oldmsgs);