[OpenSIPS-Users] Dynamic Routing - routing using source IPaddress

Julien Chavanton jc at atlastelecom.com
Thu Sep 10 19:15:24 CEST 2009


Thank you, I will look further after using group, I am also facig some requirements to append prefix, when a call comes in from a defined Gateway.
Here is a recap, of what I understand after reading testing Dynamic Routing :
 
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.
 
Therefore I selected to use Dial Plan for append/strip prefix on inbound calls.
 
 
Outbound number manipulation prefix append/strip : module (Dynamic Routing) 
--------------------------------------------------------------------------------
"STRIP" : striped from the RURI when the call is going to the target gateway
"PRI Prefix" : assigned to the RURI when the call is going to the target gateway
 
 
Inbound number manipulation prefix append/strip : module (Dial Plan) 
----------------------------------------------------------------------
Prefix : a lookup in the dialplan table for the source IP address will return a prefix to append if any
 
Example:
 # find if there is a prefix for traffic from the IP address
 dp_translate("0", "$src_ip/$avp(s:prefix)");
 if($avp(s:prefix) && method=="INVITE" && !has_totag()){
  xlog("prefix for IP[$src_ip]=[$avp(s:prefix)]\n");
  $rU  =  $avp(s:prefix) + $rU ;
 }
 else{
  xlog("no prefix for IP[$src_ip]\n");
 }

 

________________________________

From: users-bounces at lists.opensips.org on behalf of Brett Nemeroff
Sent: Thu 10/09/2009 4:18 PM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] Dynamic Routing - routing using source IPaddress


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.  

Of course, this requires pre-populating the cache src_ip => group_id

The newly released startup_route can do that for you now. :D

-Brett


On Thu, Sep 10, 2009 at 8:00 AM, Julien Chavanton <jc at atlastelecom.com> wrote:


	With Dynamic Routing, how can we route based on source IP address/Gateway ?

	_______________________________________________
	Users mailing list
	Users at lists.opensips.org
	http://lists.opensips.org/cgi-bin/mailman/listinfo/users
	
	


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090910/6763d8f8/attachment.htm 


More information about the Users mailing list