This patch fixed problem with Line registered events sometimes not being received.

It occured when in SipRefreshMgr::processOKResponse the requestRefreshPeriod was missing in the OK reply. In this case event wasn't fired.

If during applying patch it says it is malformed, just remove the "@@ -1024,8 +1034,9 @@" sections that were applied successfuly, as this patch had to be manually edited as well.

Jaroslav Libak

Index: 
C:/work/sipfoundry/branches/sipxtapi/sipXtackLib/src/net/SipRefreshMgr.cpp
===================================================================
--- C:/work/sipfoundry/branches/sipxtapi/sipXtackLib/src/net/SipRefreshMgr.cpp  
(revision 8938)
+++ C:/work/sipfoundry/branches/sipxtapi/sipXtackLib/src/net/SipRefreshMgr.cpp  
(working copy)
@@ -1024,8 +1034,9 @@
                 fireSipXLineEvent(url, lineId.data(), LINESTATE_UNREGISTERED, 
LINESTATE_UNREGISTERED_NORMAL);
 
         } 
-        else if ( responseRefreshPeriod > 0 )
+        else
         {
+            // copying from response (this is why we set the To Field
             if ( !toTag.isNull() )
             {
                 request->setToFieldTag(toTag);
@@ -1037,24 +1048,27 @@
             url.getIdentity(lineId);            
             lineId = "sip:" + lineId; 
 
-                // extract the Message body and pass to apps
-                const char *bodyBytes = NULL;
-                int   nBodySize = 0;
-                const HttpBody *body = response->getBody();
-                if (body)
-                {
-                   body->getBytes( &bodyBytes, &nBodySize );
-                }
+            // extract the Message body and pass to apps
+            const char *bodyBytes = NULL;
+            int   nBodySize = 0;
+            const HttpBody *body = response->getBody();
+            if (body)
+            {
+               body->getBytes( &bodyBytes, &nBodySize );
+            }
 
-                fireSipXLineEvent(url, lineId.data(), LINESTATE_REGISTERED, 
LINESTATE_REGISTERED_NORMAL, bodyBytes );
+            fireSipXLineEvent(url, lineId.data(), LINESTATE_REGISTERED, 
LINESTATE_REGISTERED_NORMAL, bodyBytes );
 
-            rescheduleRequest(request, responseRefreshPeriod, 
SIP_REGISTER_METHOD);
+            if (responseRefreshPeriod > 0)
+            {
+               rescheduleRequest(request, responseRefreshPeriod, 
SIP_REGISTER_METHOD);
+            }
+            else
+            {
+               // could not find expires in 200 ok response , reschedule after 
default time
+               rescheduleAfterTime(request);
+            }
         }
-        else // could not find expires in 200 ok response , reschedule after 
default time
-        {   // copying from response (this is why we set the To Field
-            request->setToFieldTag(toTag);
-            rescheduleAfterTime(request);
-        }
     } else // subscribe
     {
         // reschedule according to expires value
_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to