[asterisk-bugs] [Asterisk 0012828]: SIP qualify option destroys the MWI subscription, causing no new MWI messages to be sent.

noreply at bugs.digium.com noreply at bugs.digium.com
Tue Jun 10 08:29:48 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12828 
====================================================================== 
Reported By:                ramonpeek
Assigned To:                file
====================================================================== 
Project:                    Asterisk
Issue ID:                   12828
Category:                   Channels/chan_sip/Subscriptions
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Asterisk Version:           1.4.20.1 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             06-10-2008 08:21 CDT
Last Modified:              06-10-2008 08:29 CDT
====================================================================== 
Summary:                    SIP qualify option destroys the MWI subscription,
causing no new MWI messages to be sent.
Description: 
We encountered many problems with the MWI notifications on our Snom
phones.
After some testing we discovered the MWI was working fine for the first 60
seconds after the initial registration of the phone and then stopped
working.

So I crawled a bit trough the source code and added a few log notices in
chan_sip, right here;

/*! \brief Check whether peer needs a new MWI notification check */
static int does_peer_need_mwi(struct sip_peer *peer)
{
    time_t t = time(NULL);
    if (ast_test_flag(&peer->flags[1], SIP_PAGE2_SUBSCRIBEMWIONLY) &&
        !peer->mwipvt) {    /* We don't have a subscription */
        peer->lastmsgcheck = t; /* Reset timer */
        ast_log(LOG_NOTICE, "We don't have subscription for peer: %s \n ",
peer->name);
        return FALSE;
    }

    if (!ast_strlen_zero(peer->mailbox) && (t - peer->lastmsgcheck) >
global_mwitime) {
        ast_log(LOG_NOTICE, "Checking status change MWI for peer: %s \n ",
peer->name);
        return TRUE;
    }
    return FALSE;
}


After that I could clearly see that right after a SIP OPTIONS was
transmitted the asterisk could not longer find a subscription for MWI on
that peer.
So I set qualify=no (instead of qualify=5000) and the problem no longer
occured.

It seems that after sending the SIP OPTION, the mwipvt is also deleted.

This is how far my search has lead me..
I'd like to search further, but don't really comprehend that part of the
code.


I've added a trace that clearly shows the issue.
Just notice that right after the SIP OPTIONS message has been acknowlegded
the MWI subscription is lost.
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 06-10-08 08:29  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 121496

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r121496 | file | 2008-06-10 08:29:31 -0500 (Tue, 10 Jun 2008) | 12 lines

Merged revisions 121495 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r121495 | file | 2008-06-10 10:34:27 -0300 (Tue, 10 Jun 2008) | 4 lines

If we are destroying a dialog only set the MWI dialog pointer on the
related peer to NULL if it is the dialog currently being destroyed.
(closes issue http://bugs.digium.com/view.php?id=12828)
Reported by: ramonpeek

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=121496 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-10-08 08:29  svnbot         Note Added: 0088527                          
======================================================================




More information about the asterisk-bugs mailing list