<div dir="ltr">Hello everyone,<div><br>According to the routing flow set in kamailio.cfg<div><br></div><div> # handle retransmissions<br></div><div><div> if(t_precheck_trans()) {</div><div> t_check_trans();</div><div> exit;</div><div> }</div></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">t_check_trans()</span><span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(106,115,125);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre"><span class="gmail-pl-c" style="box-sizing:border-box">;</span></span><br></div><div><span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(106,115,125);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre"><span class="gmail-pl-c" style="box-sizing:border-box"><br></span></span></div><div><font color="#000000" face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre">After I traced the flow it seems that SUBSCRIBE message failed on </span></font><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">t_check_trans() and stopped there.</span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">I add some logs to keep tracing this function and found that:</span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre"><br></span></div><div><span style="white-space:pre">int t_check_trans(struct sip_msg* msg)
{
struct cell* t;
int branch;
int ret;
/* already processing a T */
if(is_route_type(FAILURE_ROUTE)
|| is_route_type(BRANCH_ROUTE)
|| is_route_type(BRANCH_FAILURE_ROUTE)
|| is_route_type(TM_ONREPLY_ROUTE)) {
return 1;
}
if (msg->first_line.type==SIP_REPLY) {
branch = 0;
ret = (t_check_msg( msg , &branch)==1) ? 1 : -1;
tm_ctx_set_branch_index(branch);
return ret;
} else if (msg->REQ_METHOD==METHOD_CANCEL) {
return w_t_lookup_cancel(msg, 0, 0);
} else {
switch(t_check_msg(msg, 0)){
case -2: /* possible e2e ack */
return 1;
case 1: /* found */
t=get_t();
if (msg->REQ_METHOD==METHOD_ACK){
/* ack to neg. reply or ack to local trans.
=> process it and end the script */
/* FIXME: there's no way to distinguish here
between acks to local trans. and neg. acks */
if (unlikely(has_tran_tmcbs(t, TMCB_ACK_NEG_IN)))
run_trans_callbacks(TMCB_ACK_NEG_IN, t, msg,
0, msg->REQ_METHOD);
t_release_transaction(t);
} else {
/* is a retransmission */
if (unlikely(has_tran_tmcbs(t, TMCB_REQ_RETR_IN)))
run_trans_callbacks(TMCB_REQ_RETR_IN, t, msg,
0, msg->REQ_METHOD);
t_retransmit_reply(t);
}
/* no need for UNREF(t); set_t(0) - the end-of-script
t_unref callback will take care of them */
return 0; /* exit from the script */</span> <---------------------------- THE POINT !!<span style="white-space:pre">
}
/* not found or error */
}
return -1;
}</span>
</div><div><br></div><div>If the line "<span style="white-space:pre">return 0; /* exit from the script */" was changed to </span>"<span style="white-space:pre">return 1; /* exit from the script */" , it works ---- means that the configuration script can keep being proceeded now.</span></div><div><span style="white-space:pre"><br></span></div><div><span style="white-space:pre">Any suggestions?</span></div><div><span style="white-space:pre"><br></span></div><div><span style="white-space:pre">
</span></div></div></div>