Hi Remco,

Try something like that:

    $var(x) = $rU ; # make a backup of original DID (username part of RURI)
    alias_db_lookup() ;  # alias the DID to the main account
    lookup("location");  # see where the main account is registered from
$rU = $var(x) ; # when sending call to asterisk, for the original DID in RURI.

Regards,
Bogdan

On 12/06/2011 01:33 AM, Remco . wrote:
Hi,
I'm currently using OpenSIPS as a proxy between PSTN gateways and PBX'es (Asterisk based). The PBX'es are registering to OpenSIPS. When a call comes in from the PSTN it get's routed to the PBX correctly. However, I would like to use multiple DIDs on the same AOR (e.g. use it as a trunk).

By using the alias_db module, and the||alias_db_lookup() function I'm able to route calls addressed to alias 1001 to user 1000 but the R-URI/contact header gets rewritten and the PBX is not able determine which DID is being called (it comes in with the same R-URI as the user).

What I would like to do is:
user 1000@1.2.3.4 <mailto:1000@1.2.3.4>
Alias 1...@sip.domain.nl <mailto:1...@sip.domain.nl> => 1...@sip.domain.nl <mailto:1...@sip.domain.nl>

Call comes in, detect whether the R-URI is an alias and point the call to alias@1.2.3.4 <mailto:alias@1.2.3.4> where 1.2.3.4 is the IP address listed in the AOR for the user to which the alias is pointing. Some posts on the list suggest rewriting the contact using subst() from the textopts module but after some fiddling around with regexes I'm not able to produce the desired result.

Could someone point me in the right direction?
Thanks in advance,
Remco.


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


--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
OpenSIPS solutions and "know-how"

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

Reply via email to