<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div>Hi,<div><br></div><div>i have a use case where i need to use failure_route for local transactions like this.</div><div><br></div><div>route[TIMER_ROUTE]</div><div>{</div><div>    ... do sql</div><div>    while rows</div><div>      t_uac_send ...</div><div>}</div><div><br></div><div><div>event_route[tm:local-request]</div><div>{</div></div><div>    if this is my request</div><div>       t_on_reply("MY_REPLY");</div><div>       t_on_failure("MY_FAULT");</div><div>       t_set_fr(0, MY_TIMEOUT);</div><div>       handle_ruri_alias();</div><div>       record_route();      </div><div>}</div><div><br></div><div>but MY_FAULT is never called even for 408 (timeout)</div><div><br></div><div>i tracked down to t_reply:run_failure_handlers where the check fails.</div><div>...</div><div>struct sip_msg *shmem_msg = t->uas.request;</div><div>...</div><div><div><span style="white-space:pre">      </span>if (!shmem_msg) {</div><div><span style="white-space:pre">             </span>LM_WARN("no UAC support (%d, %d) \n", on_failure, t->tmcb_hl.reg_types);<br></div><div><span style="white-space:pre">               </span>return 0;</div><div><span style="white-space:pre">     </span>}</div></div><div>...</div><div><br></div><div>i changed the code a bit  to check for is_local and parse the the request and it works for me, however i would like other to comment on this approach as there may be a simpler solution.</div><div>thanks</div><div><br></div><div><div><span style="white-space:pre">    </span>if (!shmem_msg) {</div><div><span style="white-space:pre">             </span>sip_msg_t local_msg;</div><div><br></div><div><span style="white-space:pre">         </span>if(!is_local(t)) {</div><div><span style="white-space:pre">                    </span>LM_WARN("no UAC support (%d, %d) \n", on_failure, t->tmcb_hl.reg_types);</div><div><span style="white-space:pre">                 </span>return 0;</div><div><span style="white-space:pre">             </span>}</div><div><br></div><div><span style="white-space:pre">            </span>/* parse the retr. buffer */</div><div><span style="white-space:pre">          </span>memset(&local_msg, 0, sizeof(struct sip_msg));</div><div><span style="white-space:pre">            </span>local_msg.buf = t->uac[picked_branch].request.buffer;</div><div><span style="white-space:pre">              </span>local_msg.len = t->uac[picked_branch].request.buffer_len;</div><div><span style="white-space:pre">          </span>if (parse_msg(local_msg.buf, local_msg.len, &local_msg) != 0) {</div><div><span style="white-space:pre">                   </span>LM_ERR("failed to parse retr buffer (weird!): \n%.*s\n",</div><div><span style="white-space:pre">                                    </span>(int)local_msg.len, local_msg.buf);</div><div><span style="white-space:pre">                   </span>return 0;</div><div><span style="white-space:pre">             </span>}</div><div><br></div><div><span style="white-space:pre">            </span>t->uas.request = sip_msg_shm_clone(&local_msg, NULL, 1);</div><div><br></div><div><span style="white-space:pre">              </span>free_sip_msg(&local_msg);</div><div><br></div><div><span style="white-space:pre">                </span>if(!t->uas.request) {</div><div><span style="white-space:pre">                      </span>LM_ERR("UAS REQ IS NULL AFTER PARSE \n");</div><div><span style="white-space:pre">                   </span>return 0;</div><div><span style="white-space:pre">             </span>}</div><div><br></div><div><span style="white-space:pre">            </span>shmem_msg = t->uas.request;</div><div><br></div><div><span style="white-space:pre">       </span>}</div></div><div><br></div><div><br></div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
</blockquote></div></div></div></div></div></div></div></div></div>