<p>George Joseph <strong>uploaded patch set #3</strong> to this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13804">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_outbound_registration: Fix SRV failover on timeout<br><br>In order to retry outbound registrations for some situations, we<br>need access to the tdata from the original request. For instance,<br>for 401/407 responses we need it to properly construct the<br>subsequent request with the authentication. We also need it if<br>we're iterating over a DNS SRV response record set so we can skip<br>entries we've already tried.<br><br>We've been getting the tdata from the server response rdata and<br>transaction but that only works for the failures where there was<br>actually a response (4XX, 5XX, etc). For timeouts there's no<br>response and therefore no rdata or transaction from which to get<br>the tdata. When processing a single A/AAAA record for a server,<br>this wasn't an issue as we just retried that same server after the<br>retry timer expired. If we got an SRV record set for the server<br>though, without the state from the tdata, we just kept trying the<br>first entry in the set repeatedly instead of skipping to the next<br>one in the list.<br><br>* Added a "last_tdata" member to the client state structure to keep<br> track of the sent tdata.<br><br>* Updated registration_client_send() to save the tdata it used into<br> the client_state.<br><br>* Updated sip_outbound_registration_response_cb() to use the tdata<br> saved in client_state when we don't get a response from the<br> server. We still use the tdata from the transaction when we DO<br> get a response from the server so we can properly handle 4XX<br> responses where our new request depends on it.<br><br>General note on timeouts:<br><br>Although res_pjsip_outbound_registration skips to the next record<br>immediately when a timeout occurs during SRV set traversal, it's<br>pjproject that determines how long to wait before a timeout is<br>declared. As with other SIP message types, pjproject will continue<br>trying the same server at an interval specified by "timer_t1" until<br>"timer_b" expires. Both of those timers are set in the pjsip.conf<br>"system" section.<br><br>ASTERISK-28746<br><br>Change-Id: I199b8274392d17661dd3ce3b4d69a3968368fa06<br>---<br>M res/res_pjsip_outbound_registration.c<br>1 file changed, 47 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/04/13804/3</pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13804">change 13804</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/13804"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I199b8274392d17661dd3ce3b4d69a3968368fa06 </div>
<div style="display:none"> Gerrit-Change-Number: 13804 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-CC: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>