Changeset 712


Ignore:
Timestamp:
Sep 13, 2006 10:45:38 PM (18 years ago)
Author:
bennylp
Message:

Fixed bug in event subscription: for event subscriptions established by non-SUBSCRIBE method (such as REFER), the method to refresh/unsubscribe subscription would still be SUBSCRIBE, not the initial method to establish subscription. There's no known ill effect of this bug (that I know of), but it's still important that this one has been fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-simple/evsub.c

    r671 r712  
    591591 
    592592            PJ_LOG(5,(sub->obj_name, "Refreshing subscription.")); 
    593             status = pjsip_evsub_initiate(sub, &sub->method,  
     593            status = pjsip_evsub_initiate(sub, NULL,  
    594594                                          sub->expires->ivalue, 
    595595                                          &tdata); 
     
    633633                     "send non-2xx response for previous NOTIFY). " 
    634634                     "Unsubscribing..")); 
    635             status = pjsip_evsub_initiate( sub, &sub->method, 0, &tdata); 
     635            status = pjsip_evsub_initiate( sub, NULL, 0, &tdata); 
    636636            if (status == PJ_SUCCESS) 
    637637                pjsip_evsub_send_request(sub, tdata); 
     
    13641364    if (tsx->role == PJSIP_ROLE_UAC && 
    13651365        tsx->state == PJSIP_TSX_STATE_CALLING && 
    1366         pjsip_method_cmp(&tsx->method, &sub->method) == 0)  
     1366        (pjsip_method_cmp(&tsx->method, &sub->method) == 0  || 
     1367         pjsip_method_cmp(&tsx->method, &pjsip_subscribe_method) == 0)) 
    13671368    { 
    13681369 
     
    13711372        { 
    13721373            PJ_LOG(4,(sub->obj_name,  
    1373                       "Cancelling pending %.*s request", 
    1374                       (int)sub->method.name.slen, sub->method.name.ptr)); 
     1374                      "Cancelling pending subscription request")); 
    13751375 
    13761376            /* By convention, we use 490 (Request Updated) status code. 
     
    14711471{ 
    14721472 
    1473     if (pjsip_method_cmp(&tsx->method, &sub->method)==0) { 
     1473    if (pjsip_method_cmp(&tsx->method, &sub->method)==0 ||  
     1474        pjsip_method_cmp(&tsx->method, &pjsip_subscribe_method)==0)  
     1475    { 
    14741476 
    14751477        /* Received response to outgoing request that establishes/refresh 
     
    17651767{ 
    17661768 
    1767     if (pjsip_method_cmp(&tsx->method, &sub->method) == 0) { 
     1769    if (pjsip_method_cmp(&tsx->method, &sub->method) == 0 || 
     1770        pjsip_method_cmp(&tsx->method, &pjsip_subscribe_method) == 0)  
     1771    { 
    17681772         
    17691773        /* 
Note: See TracChangeset for help on using the changeset viewer.