[OpenSIPS-Users] Get IP/Port of registered user (or from Location table?)

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Nov 14 11:37:47 CET 2013


Hello,

yes, the lookup("location") function (from the REGISTRAR module) is the
right one.

Also take a look at the dbalises module to see how you can create an
alias from 2135551212 to Chris1234 .

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


On 11/14/2013 12:31 AM, bluerain wrote:
> Or will location("username") function do it?
>
> So what I mean is that if I do
>
> If(is_method("INVITE")) {
>   lookup("username");
>   t_relay();
> }
>
> So that if 
>
> 1. asterisk server sent an INVITE to OpenSIP (with an username of unknown by
> OpenSIPs)
> 2. Opensips goes into the code above
> 3. rewrite the INVITE destination IP/port to the IP/port of the username it
> finds in the location table
> 4. sent the INVITE to that server.
>
> So what I mean is that when the INVITE came from the Asterisk Server, the
> TO-URI looks like:
>
> 2135551212 at IP_address
>
> will, Opensips, obviously don't know who is "2135551212" because the
> registered user is, let say, Chris1234.
>
> So thus I need to replace find the IP/port of registered user Chris1234 and
> then rewrite the original INVITE (came from Asterisk) with the IP/port of
> the registered user Chris1234 and then sent it out.
>
> Well, you say why don't I just do Chris1234 at IP_address, then this way,
> Opensips will automatically sent out to the user because Chris1234 is an
> registerd user. 
>
> The issue is that the end user do not want to see call come in with
> Chris1234, they want to see the number 2135551212.
>
>
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Get-IP-Port-of-registered-user-or-from-Location-table-tp7588494p7588495.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



More information about the Users mailing list