From 07ba0e379b58cefc3e2dbb0856247fbdbeddeb27 Mon Sep 17 00:00:00 2001 From: Olle Johansson Date: Thu, 10 May 2007 20:38:54 +0000 Subject: [PATCH] Do not allocate SIP pvt's for PEERs we can not reach. 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 1924c406ab..85981ee460 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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); -- 2.47.2