[Users] provisional_reply_timer

Christian Schlatter cs at unc.edu
Tue Dec 19 16:40:37 CET 2006


Klaus Darilion wrote:
> Hi Christian!
> 
> Is the behavior identically for all transactions or is there a 
> difference between INVITE and other transactions?

 >> - INVITE transactions: FRT initially equals fr_timer and gets set to
 >> fr_inv_timer after receiving first provisional response

This is only true for INVITE transactions, all other transactions only 
use the fr_timer. This makes sense since INVITE transactions normally 
involve user interaction (ringing).

The code responsible for that is in /modules/tm/t_reply.c, 
reply_received(..) function:

/* update FR/RETR timers on provisional replies */
if (msg_status < 200 && (restart_fr_on_each_reply ||
    ((last_uac_status<msg_status) &&
    ((msg_status >= 180) || (last_uac_status == 0)))
     ) ) { /* provisional now */
                 if (is_invite(t)) {
                         /* invite: change FR to longer FR_INV, do not
                          * attempt to restart retransmission any more
                          */
                         backup_list = set_avp_list(&t->user_avps);
                         if (!fr_inv_avp2timer(&timer)) {
                                 DBG("DEBUG:tm:reply_received: 
FR_INV_TIMER = %d\n", timer);
                                 set_timer(&uac->request.fr_timer,
                                         FR_INV_TIMER_LIST, &timer);
                                 t->flags |= T_NOISY_CTIMER_FLAG;
                         } else {
                                 set_timer(& uac->request.fr_timer, 
FR_INV_TIMER_LIST, 0);
                         }
                         set_avp_list(backup_list);
                 } else {
                         /* non-invite: restart retransmissions (slow 
now) */
                         uac->request.retr_list = RT_T2;
                         set_timer(&uac->request.retr_timer, RT_T2, 0);
                 }
         } /* provisional replies */


- Christian

> 
> regards
> klaus
> 
> Christian Schlatter wrote:
>> Ovidiu Sas wrote:
>>> Hi Klaus,
>>>
>>> You can use the fr_timer from the tm module:
>>> http://openser.org/docs/modules/1.1.x/tm.html#AEN108
>>>
>>> If you don't get any reply from the far end, this timer will fire.
>>
>> I recently had a look at the timer related source code and that is 
>> what I wrote down:
>>
>> - Each SIP transaction has a final response timer (FRT)
>>
>> - SIP transactions fail (failure_route, status 408) when FRT fires
>>
>> - TM module exposes final response timers (FRT) fr_timer and 
>> fr_inv_timer (can be set using AVP)
>>
>> - INVITE transactions: FRT initially equals fr_timer and gets set to 
>> fr_inv_timer after receiving first provisional response
>>
>> - setting fr_timer to a low value (e.g. 3s) allows for fast INVITE 
>> failover
>>
>> So I'm setting fr_timer to a low value for local INVITE transactions. 
>> Local here means sessions between endpoints from our network domain. 
>> Something along the lines:
>>
>> route[0] {
>>     if (method==“INVITE”) {
>>         # set fr_timer to 3 seconds
>>         avp_write("i:3", "$avp(fr_timer)");
>>         # call FAILURE_DEFAULT_RELAY routing block on transaction failure
>>         t_on_failure("FAILURE_DEFAULT_RELAY");
>>         t_relay();
>>         exit;       }
>> }
>> failure_route[FAILURE_DEFAULT_RELAY] {
>>     # status 408 ? transaction timed out
>>     if (t_check_status("408")) {
>>         # try next target
>>         if (ds_next_domain()) {
>>             t_relay();
>>         }
>>     }
>> }
>>
>>
>> - Christian
>>
>>>
>>>
>>> Regards,
>>> Ovidiu Sas
>>>
>>> On 12/18/06, Klaus Darilion <klaus.mailinglists at pernau.at> wrote:
>>>> Hi!
>>>>
>>>> i wonder if there is a timer which controls the timeout for provisional
>>>> replies.
>>>>
>>>> E.g. I want to cancel an INVITE and retry another gateway if the 
>>>> gateway
>>>> does not respond with 100 (or 180) in a certain time.
>>>>
>>>> regards
>>>> klaus
>>>>
>>>> -- 
>>>> Klaus Darilion
>>>> nic.at
>>>>
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at openser.org
>>>> http://openser.org/cgi-bin/mailman/listinfo/users
>>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openser.org
>>> http://openser.org/cgi-bin/mailman/listinfo/users
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Users mailing list
>> Users at openser.org
>> http://openser.org/cgi-bin/mailman/listinfo/users
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 1951 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20061219/2153cd34/attachment.bin>


More information about the sr-users mailing list