[asterisk-dev] RFC: Refactor qualify and res_pjsip/endpt_send_request

Mark Michelson mmichelson at digium.com
Mon Mar 30 09:54:30 CDT 2015


On 03/28/2015 08:06 PM, Joshua Colp wrote:
> George Joseph wrote:
>>> The fact that it goes to unavailable would be a bug. Why does it do so?
>>
>> Mark should probably chime in here but I think it's because the
>> earliest you could get a response from pjsip when a contact isn't
>> reachable is the unconfigurable 32 seconds.   As I said that's a long
>> time to leave a contact available when it really isn't. Without
>> implementing our own timer setting the contact to unavailable was
>> probably the lesser of 2 evils.
>
> No matter what there's going to be a period where you are potentially 
> wrong. I don't think making it unavailable was done on purpose.
>
Actually, I believe the timer may be configurable. In the type=system 
settings, there are timer_t1 and timer_b settings. timer_t1 is the base 
used for determining the retransmission interval, and timer_b is the 
maximum time we will wait before giving up sending the request. The 
defaults for these values are 500 ms and 32000 ms respectively. If you 
were to change timer_b to be a smaller value, then presumably you would 
have a shorter time before the transaction times out.

A couple of caveats about these settings
1) Since they're in the "type=system" settings, any change you make 
requires an Asterisk restart in order to take effect.
2) PJSIP applies these timers globally. They will affect ALL SIP 
transactions, not just the OPTIONS transactions from the qualify checks.

As far as why the contact is immediately marked UNAVAILABLE upon being 
qualified...that seems like a bug to me. Presumably, the contact should 
remain in its current state until a decision can be made based on the 
result of the OPTIONS transaction.



More information about the asterisk-dev mailing list