<h3>Description</h3>
<ol>
<li>I used kamailio as an scscf (based on the configuration files from kamailio/examples/scscf)</li>
<li>I did some changes according to my needs</li>
<li>I did some Basic tests - the results were satisfying --> OK</li>
<li>I configured a distinct PSI on the HSS (sip:<a href="mailto:04321234501@vict-ims.net">04321234501@vict-ims.net</a>) --> OK</li>
<li>I registered some user from a Zoiper Client --> OK</li>
<li>I told zoiper to call sip:<a href="mailto:04321234501@vict-ims.net">04321234501@vict-ims.net</a> --> I received 555 AS Contacting Failed - iFC terminated dialog</li>
</ol>
<h3>Troubleshooting</h3>
<p>The SIP Response 555...... is misleading, in the WITH_DEBUG Logs we can see, the ims_isc module cannot deliver the INVITE message to the AS, because it "thinks", we are in an "on_failure" route, but the asynchronous SAR to the HSS was sent in an "request" route.</p>
<p>File 2017_06_20_distinct_psi_03_scscf_kamailio.log:<br>
Line 642 - 660:<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: INFO: ims_registrar_scscf [cxdx_avp.c:138]: cxdx_get_avp(): cxdx_get_experimental_result_code: Failed finding avp<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: INFO: ims_registrar_scscf [cxdx_sar.c:84]: create_return_code(): created AVP successfully : [saa_return_code] - [1]<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[UNREG_SAR_REPLY] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=127 a=26 n=xlog<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[UNREG_SAR_REPLY] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=143 a=21 n=switch<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[UNREG_SAR_REPLY] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=130 a=26 n=xlog<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[UNREG_SAR_REPLY] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=131 a=5 n=route<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[term] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=673 a=26 n=xlog<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[term] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=675 a=24 n=t_newtran<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: tm [tm.c:1316]: w_t_newtran(): ERROR: t_newtran: transaction already in process 0x7ff2a6e66a58<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[term] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=677 a=25 n=set_dlg_profile<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[term] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=692 a=16 n=if<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[term] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=685 a=25 n=is_method<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[term] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=686 a=63 n=assign<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[term] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=687 a=63 n=assign<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[term] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=688 a=24 n=record_route<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[term] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=698 a=16 n=if<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: ERROR: *** cfgtrace:failure_route=[term] c=[/usr/local/etc/kamailio-scscf/kamailio-scscf-routes.cfg] l=692 a=26 n=isc_match_filter<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: INFO: ims_isc [mod.c:233]: isc_match_filter(): Checking triggers<br>
Jun 20 16:14:12 vict-ims /usr/local/sbin/kamailio[108125]: CRITICAL: ims_isc [mod.c:284]: isc_match_filter(): SKIP: 0</p>
<p>Root cause must be found in TM module in file t_suspend.c in function t_continue(), where the type of the Routing block, that was suspended is written to the type of the new Routing block:</p>
<p>line 214 - 229<br>
/* which route block type were we in when we were suspended */<br>
cb_type =  FAILURE_CB_TYPE;<br>
switch (t->async_backup.backup_route) {<br>
case REQUEST_ROUTE:<br>
cb_type = <strong>FAILURE_CB_TYPE</strong>;   <------------ this is the root cause, imho<br>
break;<br>
case FAILURE_ROUTE:<br>
cb_type = FAILURE_CB_TYPE;<br>
break;<br>
case TM_ONREPLY_ROUTE:<br>
cb_type = ONREPLY_CB_TYPE;<br>
break;<br>
case BRANCH_ROUTE:<br>
cb_type = FAILURE_CB_TYPE;<br>
break;<br>
}</p>
<h4>Reproduction</h4>
<p>I can help to reproduce the issue. mailto:<a href="mailto:christoph.valentin@kapsch.net">christoph.valentin@kapsch.net</a><br>
Currently I have got an experimental test Setup using Zoiper Clients.<br>
After week 27 I should have simulated test cases to repeat the Scenario "per mouse-click"</p>
<h4>Debugging Data</h4>

<pre><code>(paste your debugging data here)
</code></pre>
<h4>Log Messages</h4>

<pre><code>[logs-tshark-routes_2017_06_21.zip](https://github.com/kamailio/kamailio/files/1091394/logs-tshark-routes_2017_06_21.zip)
</code></pre>
<h4>SIP Traffic</h4>

<pre><code>[logs-tshark-routes_2017_06_21.zip](https://github.com/kamailio/kamailio/files/1091394/logs-tshark-routes_2017_06_21.zip)
</code></pre>
<h3>Possible Solutions</h3>

<h3>Additional Information</h3>
<pre><code>[root@vict-ims ~]# kamailio -v
version: kamailio 4.4.5 (x86_64/linux) b0945e-dirty
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: b0945e -dirty
compiled on 20:06:13 Jun  7 2017 with gcc 4.8.5
[root@vict-ims ~]#
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>[root@vict-ims ~]# uname -a
Linux vict-ims 3.10.0-229.el7.x86_64 #1 SMP Thu Jan 29 18:37:38 EST 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@vict-ims ~]#
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1160">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36Zai93uUpYZ1f5uojzJSc8f5FRiDeks5sGQzJgaJpZM4OA4va">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZXQJMTM_2jiKdFjfAXa8uLaLjBGZks5sGQzJgaJpZM4OA4va.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/1160"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"wrong callback type after asynchronous SAR to HSS (distinct PSI) (#1160)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1160"}}}</script>