In sipxtapi.cpp in function sipxConfigSubscribe
there is 
int subscriptionPeriod = 3600; 

and then we call

pInst->pSubscribeClient->addSubscription(resourceId,                            
                                     szEventType,                               
                               szAcceptType,                                    
                            fromField,                                          
                       toField,                                                 
               contactField,                                                    
            subscriptionPeriod,                                                 
               (void*)*phSub,                                                   
           sipxSubscribeClientSubCallback,                                      
                   sipxSubscribeClientNotifyCallback,                           
                                 *(subscriptionData->pDialogHandle))) 

Try changing subscriptionPeriod to lower value than 300. It seems this period 
is not automatically detected from response.

Also look in SipSubscribeClient.cpp . When it receives response to 
subscription, it should change subscription refresh time which is initiated in 
mpRefreshMgr->initiateRefresh(subscriptionRequest, in 
SipSubscribeClient::addSubscription.

I don't have an account at a VoIP provider that supports subscribe so I can't 
fix this.

Jaroslav Libak

Amith Nambiar wrote:
> Hi all,
> 
>         The API Docs for sipxConfigureSubscribe() say that :
> 
>          sipXtapi will automatically refresh subscriptions until
> sipxConfigUnsubscribe is called.  Please make sure you call
> sipxCallUnsubscribe before tearing down your instance of
>          sipXtapi.*
> 
>          But , for me when i use this api to send a subscribe, the
> SUBSCRIBE message goes out as desired with 3600 as the expiry time of the
> Subscription. Then i get a
>          202 Accepted from the server which sets the refresh time to 300
> seconds( Expires: 300 ). I see that the SUBSCRIBE is not send to renew this
> Subscription within 300
>          seconds and i get a NOTIFY indicating the expiry of this
> subscription, with Subscription-state:terminated and reason:timeout.
> 
>          My code follows.
> 
>          iReturn    = sipxConfigSubscribe(g_SubInst, g_SubLine, toSipUri,
> event, acceptHeader, 1, &g_SubHandle);
> 
>         if( iReturn  == SIPX_RESULT_SUCCESS )
>                    return 1; // success
> 
>         Could someone tell me if i have missed something ?
>         Thanks for your time.
> 
>          Best,
>         Amith.
> 
_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to