<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span>Hi Robert,</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span><br></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span>My model: kapanga --> sipproxy (opensips-1.6.2) --> asterisk (1.6)</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span>kapanga: 192.168.0.34</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span>sipproxy: 192.168.0.35</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span>asterisk: 192.168.0.179</span></div><div style="font-family: 'times new
roman', 'new york', times, serif; font-size: 12pt; "><span><br></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span>This is my config file (reduce):</span></div><div><span><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if (is_method("INFO")){</div><div> #t_relay();<span class="Apple-tab-span" style="white-space:pre">                </span></div><div> if (!vega_process_info()){</div><div> xlog("L_ERR","New service is not accept\n");</div><div> sl_send_reply("503", "Service unavaiable");</div><div> exit;</div><div>
}<span class="Apple-tab-span" style="white-space:pre">                                </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div> }</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if (is_method("BYE")){</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>xlog("BYE from user $fU===========\n");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>vega_process_bye();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div>.</div><div>.</div><div>.</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if (!lookup("location","m")) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>switch ($retcode) {</div><div><span class="Apple-tab-span" style="white-space:pre">        
                </span>case -1:</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>case -3:</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>route(2);</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>exit;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>case -2:</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>sl_send_reply("405", "Method Not Allowed");</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>exit;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br></div><div><div>route[2]{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if (is_method("INVITE")){</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if (!has_totag()){</div><div><span class="Apple-tab-span"
style="white-space:pre">                        </span>if (vega_process_invite()){</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>t_on_branch("2");</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>t_on_failure("1");</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>t_on_reply("2");</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>if ($fU =~"999887[0-9][0-9][0-9]"){</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>load_balance("1","pstn");</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>if (!t_relay()){</div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span>sl_reply_error();</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>else
{</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>load_balance("2","pstn");</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>if (!t_relay()){</div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span>sl_reply_error();</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>}</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>else {</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>xlog("Process INVITE failed, drop call anyway\n");</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>sl_send_reply("404","Not Here");</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>exit;</div><div><span class="Apple-tab-span"
style="white-space:pre">                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>exit;</div><div>}</div><div><br></div><div>and this is some messages that I capture on sipproxy</div></div></div></div></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">invite from kapanga to sipproxy</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div><div>INVITE sip:1909@192.168.0.35 SIP/2.0</div><div>Via: SIP/2.0/UDP 192.168.0.34:5060;branch=z9hG4bK2FCE61014FFB157699D2906A0C7172F2;rport</div><div>From: "977887006"
<sip:977887006@192.168.0.34:5060>;tag=A41C8BEBD152FC23D0F86F05097433AD</div><div>To: <sip:1909@192.168.0.35></div><div>Contact: <sip:977887006@192.168.0.34:5060;transport=udp></div><div>Call-ID: 2290815DDEAF262E60B1857F1F4FEDF1@192.168.0.34</div><div>User-Agent: Kapanga Softphone Desktop Windows 1.00/2178d+1305879468_00FF3CC2A86A_0026C685F9F7_0026C685F9F6_0022681CF3DC_005056C00001_005056C00008</div><div>Supported: timer, replaces</div><div>CSeq: 1 INVITE</div><div>Max-Forwards: 70</div><div>Session-Expires: 1800;refresher=uac</div><div>Content-Type: application/sdp</div><div>Content-Length: 328</div><div><br></div><div>v=0</div><div>o=977887006 1316061208 1316061969 IN IP4 192.168.0.34</div><div>s=Kapanga [1316061208]</div><div>c=IN IP4 192.168.0.34</div><div>t=0 0</div><div>m=audio 5124 RTP/AVP 0 8</div><div>a=rtpmap:0
pcmu/8000</div><div>a=sendrecv</div><div>a=rtcp:5125</div><div>a=maxptime:20</div><div>a=ptime:20</div><div>a=rtpmap:8 pcma/8000</div><div>m=video 5126 RTP/AVP 34</div><div>a=rtpmap:34 h263/90000</div><div>a=fmtp:34 QCIF=2</div><div>a=sendrecv</div><div>a=rtcp:5127</div><div><br></div><div>invite from sipproxy to asterisk</div><div><br></div><div><div>INVITE sip:1909@192.168.0.35 SIP/2.0</div><div>Record-Route: <sip:192.168.0.35;lr;did=6e.f7fe4794></div><div>Via: SIP/2.0/UDP 192.168.0.35;branch=z9hG4bKd111.31b776c6.0</div><div>Via: SIP/2.0/UDP 192.168.0.34:5060;received=192.168.0.34;branch=z9hG4bK2FCE61014FFB157699D2906A0C7172F2;rport=5060</div><div>From: "977887006" <sip:977887006@192.168.0.34:5060>;tag=A41C8BEBD152FC23D0F86F05097433AD</div><div>To: <sip:1909@192.168.0.35></div><div>Contact: <sip:977887006@192.168.0.34:5060;transport=udp></div><div>Call-ID: 2290815DDEAF262E60B1857F1F4FEDF1@192.168.0.34</div><div>User-Agent:
Kapanga Softphone Desktop Windows 1.00/2178d+1305879468_00FF3CC2A86A_0026C685F9F7_0026C685F9F6_0022681CF3DC_005056C00001_005056C00008</div><div>Supported: timer, replaces</div><div>CSeq: 1 INVITE</div><div>Max-Forwards: 69</div><div>Session-Expires: 1800;refresher=uac</div><div>Content-Type: application/sdp</div><div>Content-Length: 328</div><div><br></div><div>v=0</div><div>o=977887006 1316061208 1316061969 IN IP4 192.168.0.34</div><div>s=Kapanga [1316061208]</div><div>c=IN IP4 192.168.0.34</div><div>t=0 0</div><div>m=audio 5124 RTP/AVP 0 8</div><div>a=rtpmap:0 pcmu/8000</div><div>a=sendrecv</div><div>a=rtcp:5125</div><div>a=maxptime:20</div><div>a=ptime:20</div><div>a=rtpmap:8 pcma/8000</div><div>m=video 5126 RTP/AVP 34</div><div>a=rtpmap:34 h263/90000</div><div>a=fmtp:34 QCIF=2</div><div>a=sendrecv</div><div>a=rtcp:5127</div><div><br></div><div>INVITE message can reach destination.</div><div><br></div><div>200 ok from asterisk to sipproxy, and
sipproxy cannot forward it to destination (kapanga). This message repeat six times.</div><div><div>SIP/2.0 200 OK</div><div>Via: SIP/2.0/UDP 192.168.0.35;branch=z9hG4bKd111.31b776c6.0;received=192.168.0.35</div><div>Via: SIP/2.0/UDP 192.168.0.34:5060;received=192.168.0.34;branch=z9hG4bK2FCE61014FFB157699D2906A0C7172F2;rport=5060</div><div>Record-Route: <sip:192.168.0.35;lr;did=6e.f7fe4794></div><div>From: "977887006" <sip:977887006@192.168.0.34:5060>;tag=A41C8BEBD152FC23D0F86F05097433AD</div><div>To: <sip:1909@192.168.0.35>;tag=as73bce553</div><div>Call-ID: 2290815DDEAF262E60B1857F1F4FEDF1@192.168.0.34</div><div>CSeq: 1 INVITE</div><div>Server: Asterisk PBX 1.8.4.2</div><div>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH</div><div>Supported: replaces, timer</div><div>Session-Expires: 1800;refresher=uac</div><div>Contact: <sip:1909@192.168.0.179:5060></div><div>Content-Type:
application/sdp</div><div>Content-Length: 255</div><div><br></div><div>v=0</div><div>o=root 1931374264 1931374264 IN IP4 192.168.0.179</div><div>s=Asterisk PBX 1.8.4.2</div><div>c=IN IP4 192.168.0.179</div><div>t=0 0</div><div>m=audio 18222 RTP/AVP 0 8</div><div>a=rtpmap:0 PCMU/8000</div><div>a=rtpmap:8 PCMA/8000</div><div>a=silenceSupp:off - - - -</div><div>a=ptime:20</div><div>a=sendrecv</div><div>m=video 0 RTP/AVP 34</div><div><br></div><div>200 OK message cannot reach to destination, I captured 6 messages.</div><div><br></div><div><div>INFO sip:1909@192.168.0.179 SIP/2.0</div><div>Via: SIP/2.0/UDP 192.168.0.34:5060;branch=z9hG4bK1D752E2B2641DAF42286B4D2B874F6DA;rport</div><div>Route: <sip:192.168.0.35;lr;did=6e.f7fe4794></div><div>From: "977887006" <sip:977887006@192.168.0.34:5060>;tag=A41C8BEBD152FC23D0F86F05097433AD</div><div>To: <sip:1909@192.168.0.35>;tag=as73bce553</div><div>Contact:
<sip:977887006@192.168.0.34:5060;transport=udp></div><div>Call-ID: 2290815DDEAF262E60B1857F1F4FEDF1@192.168.0.34</div><div>User-Agent: Kapanga Softphone Desktop Windows 1.00/2178d+1305879468_00FF3CC2A86A_0026C685F9F7_0026C685F9F6_0022681CF3DC_005056C00001_005056C00008</div><div>Supported: timer, replaces</div><div>CSeq: 2 INFO</div><div>Max-Forwards: 70</div><div>Content-Type: application/dtmf-relay</div><div>Content-Length: 24</div><div><br></div><div>Signal=1</div><div>Duration=150</div><div><br></div><div>INFO message is same, it cannot reach to destination</div><div><br></div><div>Khue Nguyen</div></div></div></div></div><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Robert Thomas <thomcr@gmail.com><br><b><span
style="font-weight: bold;">To:</span></b> nguyen khue <minhkhue49da@yahoo.com>; OpenSIPS users mailling list <users@lists.opensips.org><br><b><span style="font-weight: bold;">Sent:</span></b> Thursday, September 15, 2011 11:22 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [OpenSIPS-Users] error when use function t_relay<br></font><br><div id="yiv2129297151">Hi Khue,<div><br></div><div>Can you please post your full opensips.cfg file, and a packet capture so we can understand better what opensips is doing to the sip packets. A capture with ngrep with work as well. </div><div><br>
</div><div>That way we can try to help.<br><br><div class="yiv2129297151gmail_quote">On Mon, Sep 12, 2011 at 10:19 PM, nguyen khue <span dir="ltr"><<a rel="nofollow" ymailto="mailto:minhkhue49da@yahoo.com" target="_blank" href="mailto:minhkhue49da@yahoo.com">minhkhue49da@yahoo.com</a>></span> wrote:<br>
<blockquote class="yiv2129297151gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; ">
<div>Hi all,</div><div><br></div><div>I have a module to process SIP message (INVITE, INFO, 200 OK, BYE). I have use t_relay function to capture 200 OK message in block onreply_route. But, After I use t_relay function, INFO, BYE, some ACKs messages cannot route to destination. If I insert some t_relay function in config file, it work normal.</div>
<div><br></div><div>ex:</div><div>if (is_method("INFO")){</div><div><span style="white-space:pre-wrap;">        </span>t_relay(); /<span style="background-color:rgb(0, 0, 0);">/ </span><b><i style="background-color:rgb(255, 255, 255);">if this function is missing, the SIP INFO cannot reach the destination</i></b></div>
<div><span style="white-space:pre-wrap;">
        </span>process_info_msg();</div><div>}</div><div>.</div><div>.</div><div>.</div><div><br></div><div>route[1]{</div><div><span style="white-space:pre-wrap;">        t_on_branch("2");
        t_on_failure("1");
        t_on_reply("2");</span></div><div><span style="white-space:pre-wrap;">        </span>process_invite_msg();</div><div><span style="white-space:pre-wrap;">        </span>if ($fU == xxxx){</div><div><span style="white-space:pre-wrap;">                </span>load_balance("1","transc");</div>
<div><span style="white-space:pre-wrap;">        </span>}</div><div><span style="white-space:pre-wrap;">        </span>else {</div><div><span style="white-space:pre-wrap;">                </span>load_balance("2","transc");</div><div>
<span style="white-space:pre-wrap;">        </span>}</div><div><div><span style="white-space:pre-wrap;">        </span>if(!t_relay()){</div><div><span style="white-space:pre-wrap;">                </span>sl_reply_error():</div><div><span style="white-space:pre-wrap;">        </span>}</div>
</div><div><span style="white-space:pre-wrap;">
        </span>exit;</div><div>}</div><div><br></div><div>onreply_route[2]{</div><div><span style="white-space:pre-wrap;">        </span>process_ok_msg();<br>}</div><div><br></div><div>I using opensips-1.6.2. My module is : kapanga -> opensips -> asterisk. Kapanga and Asterisk don't register to opensips.</div>
<div>Please help me resolve this problem.</div><div><br></div><div>Thank you very much</div><div>Khue Nguyen.</div></div></div><br>_______________________________________________<br>
Users mailing list<br>
<a rel="nofollow" ymailto="mailto:Users@lists.opensips.org" target="_blank" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Robert<br>
</div>
</div><br><br></div></div></div></body></html>