<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 30, 2015 at 8:54 AM, Mark Michelson <span dir="ltr"><<a href="mailto:mmichelson@digium.com" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=mmichelson@digium.com&cc=&bcc=&su=&body=','_blank','location=yes,menubar=yes,resizable=yes,width=800,height=600');return false;">mmichelson@digium.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On 03/28/2015 08:06 PM, Joshua Colp wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
George Joseph wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
The fact that it goes to unavailable would be a bug. Why does it do so?<br>
</blockquote>
<br>
Mark should probably chime in here but I think it's because the<br>
earliest you could get a response from pjsip when a contact isn't<br>
reachable is the unconfigurable 32 seconds.   As I said that's a long<br>
time to leave a contact available when it really isn't. Without<br>
implementing our own timer setting the contact to unavailable was<br>
probably the lesser of 2 evils.<br>
</blockquote>
<br>
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.<br>
<br>
</blockquote>
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.<br>
<br>
A couple of caveats about these settings<br>
1) Since they're in the "type=system" settings, any change you make requires an Asterisk restart in order to take effect.<br>
2) PJSIP applies these timers globally. They will affect ALL SIP transactions, not just the OPTIONS transactions from the qualify checks.<br></blockquote><div><br></div><div>Yeah, I ran across those settings but setting the timeout globally seems like a bad idea.  </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
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.</blockquote><div><br></div><div>Yep, but assuming we don't want to set a timeout globally, we're back to the 32 seconds before a timeout.</div><div><br></div><div>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.  </div><div><br></div><div><br></div></div></div></div>