[asterisk-dev] T1 sip 500ms or 1s ?

Mark Michelson mmichelson at digium.com
Thu Jun 18 11:45:22 CDT 2009


Kristian Kielhofner wrote:
> On Thu, Jun 18, 2009 at 12:03 PM, Mark Michelson <mmichelson at digium.com> wrote:
>> David Hansen wrote:
>>> Are your PBX and phone on same subnet?  Is the phone SIP capable and listening on port 5060?  You mention T1, but this has no relationship to SIP convos.
>>>
>>> David Hansen
>> In SIP, there is a timer called T1 used as a base for calculating retransmission
>> times.
>>
>> In answer to the originally-posted question, the SIP T1 timer defaults to 500
>> ms. Looking at the code in sip_reliable_xmit, we set a value called siptimer_a
>> to be 2 * pkt->timer_t1. This value is what is passed to the scheduler for the
>> retransmission time.
>>
>> Reading RFC 3261, section 17.1.1.2:
>>
>>   "If an unreliable transport is being
>>    used, the client transaction MUST start timer A with a value of T1.
>>    If a reliable transport is being used, the client transaction SHOULD
>>    NOT start timer A (Timer A controls request retransmissions).  For
>>    any transport, the client transaction MUST start timer B with a value
>>    of 64*T1 seconds (Timer B controls transaction timeouts).
>>
>>    When timer A fires, the client transaction MUST retransmit the
>>    request by passing it to the transport layer, and MUST reset the
>>    timer with a value of 2*T1."
>>
>> So it appears that this may be an instance where we are doing things a bit
>> out-of-spec here. I wonder if there was some sort of justification for this when
>> it was written...
>>
>> Mark Michelson
>>
> 
> IIRC the T1 value is calculated based off of whatever qualify returns
> (if enabled).  I don't remember what happens if you have qualify
> disabled...
> 
> This may have changed in recent versions but I remember it being
> correct at some point in time.
> 
> --
> Kristian Kielhofner

You are correct regarding the use of the qualify time as timer T1 since it is 
the estimated RTT.

If you have qualify disabled, then T1 will default to 500 ms. Additionally, in 
Asterisk 1.6 versions the initial value for T1 is configurable using the 
"timert1" option in sip.conf.

Mark Michelson



More information about the asterisk-dev mailing list