[OpenSIPS-Users] LRN dips with Dynamic Routing

Bogdan-Andrei Iancu bogdan at opensips.org
Wed Nov 23 15:17:36 CET 2011

Hi Jeff,

Well, according to RFC3261, a Contact hdr must carry a valid SIP URI - 
now, in dip lookups, the answer is added as params to the SIP URI or to 
the CT SIP hdr...depending...

If you uac_redirect does not server your purpose (like answer in in CT 
hdr params), you can access the hdr directly like getting params : 


On 11/23/2011 03:25 PM, Jeff Pyle wrote:
> Bogdan,
> I don't think the uac_redirect module in this case is helpful.  The 
> Contact data that comes back from an LRN DIP's 302 isn't a real SIP 
> URI, but rather just some routing data that happens to be using a 
> 302's Contact field as a transport mechanism.
> Kent,
> Sorry for the late reply...  I do not.  I use string transformations 
> to yank out the portions I need.  Something like this in the 
> onreply_route from a 302 dip:
> $var(lrnct) = $ct;
> if !($(var(lrnct){param.value,rn}) == '') {
>     $var(call_lrn1) = $(var(lrnct){param.value,rn});
>     #....  more processing to clean up any leading 1's or +1s
> }
> I do not use the drouting module because my config is too old.  I use 
> a combination of the lcr module to load gateways for a particular 
> carrier, or if a carrier has only one IP/hostname, I pull it directly 
> from a DB into an AVP and route to it.
> I take the LRN data from the DIP along with some other items 
> (jurisdiction/ani/etc) and feel it to a Perl script to do the actual 
> LCR carrier selection.  I keep all my carriers' rates in separate DB 
> tables and use mysql stored functions to normalize the rate lookup 
> into a standard format used by a while loop in the Perl script.  The 
> rate function name that gets called is another usr_preference per carrier.
> I certainly don't pretend this is the most efficient way, but it does 
> all our needs better than anything else I have been able to come up with.
> - Jeff
> On Tue, Nov 22, 2011 at 9:27 AM, Bogdan-Andrei Iancu 
> <bogdan at opensips.org <mailto:bogdan at opensips.org>> wrote:
>     Hi Kpirlo,
>     When sending the call to the dip provider, use a failure route in
>     order to catch the 3xx reply you get back. In the failure route,
>     use the uac_redirect module with the get_redirects() function
>     (http://www.opensips.org/html/docs/modules/1.7.x/uac_redirect.html#id250367)
>     in order to extract the redirect contacts from the reply and push
>     them as new destinations.
>     Regards,
>     Bogdan
>     On 11/20/2011 08:04 PM, Kpirlo wrote:
>>     We are currently using the Dynamic routing module for our least
>>     cost routing.
>>     Now we are looking at implementing an LRN dipping service, where
>>     we will send the call to a dip provider first and receive a 302
>>     redirect back which will have the LRN returned in the contact
>>     header as "rn=" if the number has been ported or will include
>>     ";npdi"  in the contact header if it has not been ported.
>>     Im asking for any advice anyone has on how to implement this and
>>     how it could work with dymanic routing to choose the route based
>>     on rn if available, but actually send the call using the original
>>     "to" number.
>>     Thank you in advance for any help.
>>     Kent
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
OpenSIPS solutions and "know-how"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20111123/dcfeb765/attachment.htm>

More information about the Users mailing list