<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6001.18148" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr>Thank you, I will look further after using group, I am also facig&nbsp;some requirements to append prefix, when a call comes in from a defined Gateway.</DIV>
<DIV dir=ltr>Here is a recap, of what I understand after reading testing Dynamic Routing :</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>When a call is comming from a given Gateway we can not use Dynamic Routing to append/strip prefixes, DR module only work on destination Gateway.</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>Therefore I selected to use Dial Plan for append/strip prefix on inbound calls.</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>Outbound number manipulation prefix append/strip : module (Dynamic Routing) <BR>--------------------------------------------------------------------------------<BR>"STRIP" : striped from the RURI when the call is going to the target gateway<BR>"PRI Prefix" : assigned to the RURI when the call is going to the target gateway</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>Inbound number manipulation prefix append/strip : module (Dial Plan) <BR>----------------------------------------------------------------------<BR>Prefix : a lookup in the dialplan table for the source IP address will return a prefix to append if any</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>Example:</DIV>
<DIV dir=ltr>&nbsp;# find if there is a prefix for traffic from the IP address<BR>&nbsp;dp_translate("0", "$src_ip/$avp(s:prefix)");<BR>&nbsp;if($avp(s:prefix) &amp;&amp; method=="INVITE" &amp;&amp; !has_totag()){<BR>&nbsp; xlog("prefix for IP[$src_ip]=[$avp(s:prefix)]\n");<BR>&nbsp; $rU&nbsp; =&nbsp; $avp(s:prefix) + $rU ;<BR>&nbsp;}<BR>&nbsp;else{<BR>&nbsp; xlog("no prefix for IP[$src_ip]\n");<BR>&nbsp;}<BR></DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> users-bounces@lists.opensips.org on behalf of Brett Nemeroff<BR><B>Sent:</B> Thu 10/09/2009 4:18 PM<BR><B>To:</B> OpenSIPS users mailling list<BR><B>Subject:</B> Re: [OpenSIPS-Users] Dynamic Routing - routing using source IPaddress<BR></FONT><BR></DIV>
<DIV>Usually you set the group based on something else. I use memcache for this.. so I toss the IP against memcache, which returns a group id, then I use that in the do_routing() cmd.&nbsp; 
<DIV><BR></DIV>
<DIV>Of course, this requires pre-populating the cache src_ip =&gt; group_id</DIV>
<DIV><BR></DIV>
<DIV>The newly released startup_route can do that for you now. :D</DIV>
<DIV><BR></DIV>
<DIV>-Brett</DIV>
<DIV><BR></DIV>
<DIV><BR>
<DIV class=gmail_quote>On Thu, Sep 10, 2009 at 8:00 AM, Julien Chavanton <SPAN dir=ltr>&lt;<A href="mailto:jc@atlastelecom.com">jc@atlastelecom.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV>
<DIV><FONT face=Arial color=#000000 size=2>With Dynamic Routing, how can we route based on source IP address/Gateway ?</FONT></DIV></DIV><BR>_______________________________________________<BR>Users mailing list<BR><A href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</A><BR><A href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target=_blank>http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></BODY></HTML>