<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
<tt>And starting with trunk version, OpenSIPS implements a REST
client - see
<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/devel/rest_client.html">http://www.opensips.org/html/docs/modules/devel/rest_client.html</a><br>
<br>
Regards,</tt><br>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<br>
On 05/23/2013 08:14 AM, Daniel Yu wrote:
<blockquote
cite="mid:CAEyK8ur=XJPWJmeGabjG6qD+3zVOM0wR4bDHvmuCOzHb=T3veg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div style="">M.Khaled,</div>
<div style=""><br>
</div>
<div style="">It may be easier to perform HTTP Queries to
perform the LRN lookup. Have a look at <a
moz-do-not-send="true" href="http://www.bulkvs.com">www.bulkvs.com</a>
where we offer HTTP based LRN DIPs.</div>
<div style=""><br>
</div>
<div style="">Cheers -</div>
<div style=""><br>
</div>
<div style="">Daniel</div>
<div><br>
</div>
<br>
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div dir="ltr"><br>
<div class="gmail_quote">---------- Forwarded message
----------<br>
From: <b class="gmail_sendername">M.Khaled W Chehab</b>
<span dir="ltr"><<a moz-do-not-send="true"
href="mailto:kchehab@icucall.com" target="_blank">kchehab@icucall.com</a>></span><br>
Date: Tue, May 14, 2013 at 6:17 AM<br>
Subject: [OpenSIPS-Users] Sip server dipping/advice<br>
To: <a moz-do-not-send="true"
href="mailto:users@lists.opensips.org"
target="_blank">users@lists.opensips.org</a>, <a
moz-do-not-send="true"
href="mailto:users-bounces@lists.opensips.org"
target="_blank">users-bounces@lists.opensips.org</a><br>
<br>
<br>
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I am using opensips 1.8.x
with do_routing module ,and trying to implement
the US dipping service in my script</p>
<p class="MsoNormal">I am sending the call to the
dipping sip server gateway and receive the 302
message containing the LRN number ,</p>
<p class="MsoNormal">As as result I can have the
rn number but I am sending the invite to the
dipping provider twice ,please can you advice
how to setup it in the right way </p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">if ($rU=~"^.") {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> route(7);</span></p>
<p class="MsoNormal">
<span style="color: rgb(31, 73, 125);">
route(1);</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> exit;</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">route[1] {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> if (subst_uri('/(<a
moz-do-not-send="true">sip:.*);nat=yes/\1/')</a>)
{</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> setbflag(6);</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> }</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> if (isflagset(5)) {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> search_append('Contact:.*sip:[^>[:cntrl:]]*',
';nat=yes');</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> }</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> # for INVITEs enable some
additional helper routes</span></p>
<p class="MsoNormal">
<span style="color: rgb(31, 73, 125);">
if (is_method("INVITE")) {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> t_on_branch("2");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> t_on_reply("2");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> t_on_failure("1");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
avp_db_query("UPDATE `opensips`.`invites` set
`trunkip` ='$rd' where `CALLID` = '$ci' ");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> } else if
(is_method("BYE")) {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> setflag(1); # do
accounting ...</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> setflag(3);
#transaction falis</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> setflag(4); #CDR
Table</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
xlog("----------------------------------------Route
1 Bye---------------");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> } else if
(is_method("ACK")) {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> # call answered an
ACKed, start billing here</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> } else if
(is_method("CANCEL")) {</span></p>
<p class="MsoNormal">
<span style="color: rgb(31, 73, 125);">
# call cancelled by caller, do clean up here'
");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> }</span></p>
<p class="MsoNormal">
<span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> if (!t_relay()) {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> xlog("L_INFO",
"--Debug Customer
ID:$avp(Cusid)/IP:$si------#11###Reply:
$T_reply_code\n");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> send_reply("500","Internal
Error");</span></p>
<p class="MsoNormal">
<span style="color: rgb(31, 73, 125);">
};</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> exit;</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">}</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">route[7]{</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">if
(!do_routing("$avp(Cusid)","FW")) {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">drop();</span></p>
<p class="MsoNormal">
<span style="color: rgb(31, 73, 125);">
exit;</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> }</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">}</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">route[6] {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">if ( use_next_gw() ) {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
$var(prefix) = $(avp(gw_attrs){csv.value,1});</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> $rU
= $var(prefix) + $avp(dst);</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
xlog("L_INFO", "--Debug Customer
ID:$avp(Cusid)/IP:$si-----Calling number to
Next Provier $rU\n");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
setflag(26); #Missed calls</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
t_on_failure("1");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
t_relay();</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
exit;</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> }</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">}</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">branch_route[2] {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> xlog("L_INFO", "--Debug
Customer ID:$avp(Cusid)/IP:$si-----new branch
at $ru\n");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> route(7);</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">}</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">failure_route[1] {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> if
(!t_check_status("302")) {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> if
(!next_routing()){</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
xlog("L_INFO", "LRN - Unable to DIP");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
t_reply("500","Unable to DIP");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> exit;</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> }</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> xlog("L_INFO", "LRN
- Unable to DIP - Trying Next");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> t_on_failure("1");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> t_relay();</span></p>
<p class="MsoNormal">
<span style="color: rgb(31, 73, 125);">
exit; </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> }</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> if
(!$(<reply>ct.fields(uri){param.value,rn})){</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
xlog("L_INFO", "LRN - No redirect
information found");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
route(1);</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
}else if
($(<reply>ct.fields(uri){param.value,rn})
== $tU){</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> xlog("L_INFO",
"LRN - Returned same number, no need to
redirect");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
route(1);</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
}else{ </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> xlog("LRN-----$rU-------Else
lRN $avp(lrnct)---------");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
$rU=$avp(lrnct); </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> xlog("LRN-----$rU-------Else
lRN $avp(lrnct)---------");</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> route(1);</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> }</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> if
(!t_check_status("487")) {</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">
#$avp(failure_count) = $avp(failure_count) +
1; 480|486|603</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> route(6);</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> }</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> }</span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31,
73, 125);">}</span></p>
<p class="MsoNormal"> </p>
</div>
</div>
<br>
_______________________________________________<br>
Users mailing list<br>
<a moz-do-not-send="true"
href="mailto:Users@lists.opensips.org"
target="_blank">Users@lists.opensips.org</a><br>
<a moz-do-not-send="true"
href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
</body>
</html>