[asterisk-dev] RFC: Refactor qualify and res_pjsip/endpt_send_request
George Joseph
george.joseph at fairview5.com
Mon Mar 30 10:35:23 CDT 2015
On Mon, Mar 30, 2015 at 8:54 AM, Mark Michelson <mmichelson at digium.com>
wrote:
> 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.
>
Yeah, I ran across those settings but setting the timeout globally seems
like a bad idea.
>
> 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.
Yep, but assuming we don't want to set a timeout globally, we're back to
the 32 seconds before a timeout.
I spent the weekend looking for approaches other than pulling
of pjsip_endpt_send_request up into res_pjsip but nothing has presented
itself. I know Josh understandably isn't in favor of pulling that function
up but it does work and the code is straightforward so I'm going to submit
an RFC patch so you guys can take a look.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150330/09b93236/attachment-0001.html>
More information about the asterisk-dev
mailing list