[asterisk-bugs] [JIRA] (ASTERISK-22075) Mutliple SIP NOTIFIES at "sip reload" if mailbox is monitored by multiple sip peers

mdu113 (JIRA) noreply at issues.asterisk.org
Mon Jul 15 12:26:03 CDT 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-22075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=207976#comment-207976 ] 

mdu113 commented on ASTERISK-22075:
-----------------------------------

I've tried to analyze the code and here's what I've found. 
When pollmailboxes is set to "yes", app_voicemail registers callback mwi_sub_event_cb() that is called whenever something subscribes to MWI. In that callback mailbox is polled and MWI notification is queued (app_voicemail.c: handle_subscribe() -> poll_subscribed_mailbox()). When notification is queued it then being sent to all peers subscribed for that mailbox MWI (chan_sip.c: mwi_event_cb() -> sip_send_mwi_to_peer()).
Now at "sip reload" in build_peer() function there's a call to add_peer_mwi_subs() which resubscribes the peer to MWI event for the peer's mailboxes, which results in SIP NOTIFYs being sent to all subscribed peers due to above described logic in app_voicemail.c. Since build_peer() is called for every peer, the process is repeated for every peer which results in multiple NOTIFYs. 
To illustrate it, suppose 3 peers (p1,p2 and p3 are monitoring mailbox X). At "sip reload" time when build_peer() is called for 'p1' it results in NOTIFYs sent to all p1,p2 and p3. Later when it's called for 'p2' it again results in NOTIFY's sent to all p1,p2 and p3. And so on.
To add insult to injury, in chan_sip.c build_route(), after call to add_peer_mwi_subs(), it also calls sip_send_mwi_to_peer(), which results in additional set of NOTIFYs.
                
> Mutliple SIP NOTIFIES at "sip reload" if mailbox is monitored by multiple sip peers
> -----------------------------------------------------------------------------------
>
>                 Key: ASTERISK-22075
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-22075
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_voicemail, Channels/chan_sip/General
>    Affects Versions: 1.8.22.0
>            Reporter: mdu113
>            Severity: Minor
>         Attachments: debug.log
>
>
> If VM box is monitored by multiple sip peers then asterisk will send multiple SIP notifies about this mailbox to each peer at "sip reload". If number of peers monitoring the mailbox is N then the number of notifies asterisk sends to each peer is N+1. Total number of notifies = N*(N+1).
> This will happen only if "pollmailboxes=yes" is present in voicemail.conf.
> The relevant parts of configs are follows:
> voicemail.conf:
> pollmailboxes=yes
> sip.conf:
> [poly_650_01]
> type=friend
> context=xyz
> host=dynamic
> mailbox=650 at xyz 
> [poly_650_02]
> type=friend
> context=xyz
> host=dynamic
> mailbox=650 at xyz 
> [poly_650_03]
> type=friend
> context=xyz
> host=dynamic
> mailbox=650 at xyz 
> With this config 12 notifies about 650 at xyz is sent. This results in storm of notifies if any significant number of peers are monitoring a mailbox and is just obviously wrong.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list