<div dir="ltr">Alex, <div><br></div><div>I think #1 fixed it for me! Thank you so much! I changed the RTP timeout on a test account SIP account and immediately it resolved the issue. </div><div><br></div><div>You're right, sending a BYE would effectively synchronize them however I did not think keepalive using OPTIONS scheme would send a BYE message in the event of a dead RTP session. That's why I thought this scheme may not work.</div><div><br></div><div>I was mistaken about referring to Kamailio as dialog stateful, it's just easier for me to think about a call that way. When debugging this problem, I pulled up the SIP dialog on my Homer server and saw the last message being 200 OK sent to the SIP Client (after Invite/Trying) and the BYE was never sent back from the client. I suppose I phrased this incorrectly as Kamailio thinks the endpoint is in a call, when really it is just Asterisk and I am personally associating the state with these transactions. </div><div><br></div><div>Yes, I recall when I initially read about SSTs, many people reported they had difficulty getting them to function properly. So far it looks like I will not have to implement any proxy-side measures.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div style="font-family:Helvetica;font-size:medium">Benjamin Fitzgerald</div><div style="font-family:Helvetica;font-size:medium">LETS Corporation</div><div style="font-family:Helvetica;font-size:medium">(925) 235-1154</div><div style="font-family:Helvetica;font-size:medium"><span style="text-align:-webkit-auto"><a href="mailto:ben@letscorp.us" style="color:rgb(17,85,204)" target="_blank">ben@letscorp.us</a></span></div><div style="font-family:Helvetica;font-size:medium"><br></div><div style="font-family:Helvetica;font-size:medium"><br></div><div><img src="https://drive.google.com/a/letscorp.us/uc?export=view&id=0BypXJ2tJXo79c0ZaNXJVUWFlMVk"><br></div><br style="font-family:Helvetica;font-size:medium"><span style="font-family:Helvetica;font-size:medium">*******Confidential Notice: </span><br style="font-family:Helvetica;font-size:medium"><span style="font-family:Helvetica;font-size:medium">This message is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please delete this message from all computers and contact Orion Systems/LETS Corp immediately by return e-mail and/or telephone at </span><a value="+19255665600" style="color:rgb(17,85,204);font-family:Helvetica;font-size:medium">(925) 566-5600</a><br></div></div></div>
<br><div class="gmail_quote">On Fri, Jan 8, 2016 at 12:47 PM, Alex Balashov <span dir="ltr"><<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Benjamin,<span class=""><br>
<br>
On 01/08/2016 03:25 PM, Benjamin Fitzgerald wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
1. Sorry to be unclear, the Asterisk channel does not stay up<br>
indefinitely. We do have a max timeout but since a large portion of our<br>
business is based on conference calling, the timeout is rather large. I<br>
will definitely change the RTP timeout as my first attempt.<br>
</blockquote>
<br></span>
Yes, but I was referring specifically to the RTP timeout. If the mobile endpoint goes away, it will stop sending RTP. If Asterisk detects that no RTP has been received in x seconds, it should hang up the channel, after prophylactically sending a BYE for the call in the direction of Kamailio/the mobile peer.<br>
<br>
I had been under the impression that Asterisk has a fairly conservative default RTP timeout anyway, but it seems I may be mistaken:<br>
<br>
<a href="https://github.com/asterisk/asterisk/blob/master/configs/samples/pjsip.conf.sample#L740" rel="noreferrer" target="_blank">https://github.com/asterisk/asterisk/blob/master/configs/samples/pjsip.conf.sample#L740</a><br>
<br>
<a href="https://github.com/asterisk/asterisk/blob/master/configs/samples/sip.conf.sample#L624" rel="noreferrer" target="_blank">https://github.com/asterisk/asterisk/blob/master/configs/samples/sip.conf.sample#L624</a><br>
<br>
(Not sure which SIP channel driver you're using.)<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
3. I'm not sure this will work in my case because the endpoint is<br>
reachable, but client state is not in sync with the server: i.e.<br>
Kamailio/Asterisk think it's in a call but the endpoint does not. If<br>
sending OPTIONS could tell me if the endpoint thinks it's in a call or<br>
not, then this could potentially work.<br>
</blockquote>
<br></span>
Would sending a BYE to both peers not have the effect of synchronising them forcefully to a state of "the call is hung up"?<br>
<br>
If you're concerned about sending a BYE to an endpoint that thinks the call is already hung up, don't be. In that case, it'll simply be rejected. You can't negatively affect the state of a dialog that's already dead.<br>
<br>
Curious, however: when you say "Kamailio/Asterisk think it's in a call", how does this apply to Kamailio?<br>
<br>
Stateful SIP proxies are transaction-stateful, not dialog-stateful.<br>
<br>
Thus, by default, Kamailio doesn't know anything about "calls", but only the SIP transactions of which they are made up, and only for so long as those transactions are active. The 'dialog' module allows Kamailio to be call-stateful, at the cost of additional statekeeping complexity, but you should only use this capability if you need it for something (e.g. limiting concurrent calls, keepalive/timeout as described previously, etc.)<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On a side note, is there a SIP message that I can send to a client to<br>
have it report its state? (Registered, Auth Failed, In a call, etc.)<br>
</blockquote>
<br></span>
There's no standard query mechanism like this that I am aware of; the only way of disseminating such state information with which I'm familiar is presence, which is proactively pushed out by the endpoints and requires server-side support.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
4. I do know about SIP Session Timers but chose to not use them during<br>
the initial deployment (because of Asterisk channel timeout which I know<br>
realize is too large). Maybe this will help in conjunction with the<br>
above methods.<br>
</blockquote>
<br></span>
SSTs are rather bureaucratic and, in my experience, often incorrectly implemented or unsupported. In the SST conception of things, the roles in keepalive ping-pong are negotiated entirely between the UAs, and it is up to the UAs to maintain those roles. This goes wrong easily enough that server-side solutions such as periodic reinvites and other "pings" (like the Kamailio dialog module's OPTIONS pings) are a rather popular alternative.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Would you mind expanding on endpoint defense? Specifically with mobile<br>
client applications? I agree this would be the ideal solution, I'm just<br>
not sure where to start here.<br>
</blockquote>
<br></span>
By "endpoint defence" I simply meant that detecting dead peers should be up to the SIP endpoints (mobile SIP client and Asterisk, by the sound of it) first and foremost, and that any proxy-side measures should be a secondary layer.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- Alex</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
-- <br>
Alex Balashov | Principal | Evariste Systems LLC<br>
303 Perimeter Center North, Suite 300<br>
Atlanta, GA 30346<br>
United States<br>
<br>
Tel: <a href="tel:%2B1-800-250-5920" value="+18002505920" target="_blank">+1-800-250-5920</a> (toll-free) / <a href="tel:%2B1-678-954-0671" value="+16789540671" target="_blank">+1-678-954-0671</a> (direct)<br>
Web: <a href="http://www.evaristesys.com/" rel="noreferrer" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.csrpswitch.com/" rel="noreferrer" target="_blank">http://www.csrpswitch.com/</a><br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br></div>