[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:27:48 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12828 
====================================================================== 
Reported By:                ramonpeek
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12828
Category:                   Channels/chan_sip/Subscriptions
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
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:              
====================================================================== 
Date Submitted:             06-10-2008 08:21 CDT
Last Modified:              06-10-2008 08:27 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:27  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 121495

U   branches/1.4/channels/chan_sip.c

------------------------------------------------------------------------
r121495 | file | 2008-06-10 08:27:39 -0500 (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=121495 

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




More information about the asterisk-bugs mailing list