<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Remco,<br>
<br>
Try something like that:<br>
<br>
$var(x) = $rU ; # make a backup of original DID (username part
of RURI)<br>
alias_db_lookup() ; # alias the DID to the main account<br>
lookup("location"); # see where the main account is registered
from <br>
$rU = $var(x) ; # when sending call to asterisk, for the
original DID in RURI.<br>
<br>
Regards,<br>
Bogdan<br>
<br>
On 12/06/2011 01:33 AM, Remco . wrote:
<blockquote
cite="mid:CAJy1ugyGvXPJ4iN14XxxD1OR1jb8dEM44Ta+6O2_DiTpRWWavQ@mail.gmail.com"
type="cite">Hi,<br>
I'm currently using OpenSIPS as a proxy between PSTN gateways and
PBX'es (Asterisk based).<br>
The PBX'es are registering to OpenSIPS. When a call comes in from
the PSTN it get's routed to the PBX correctly.<br>
However, I would like to use multiple DIDs on the same AOR (e.g.
use it as a trunk).<br>
<br>
By using the alias_db module, and the<code> </code>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).<br>
<br>
What I would like to do is:<br>
user <a moz-do-not-send="true" href="mailto:1000@1.2.3.4">1000@1.2.3.4</a><br>
Alias <a moz-do-not-send="true" href="mailto:1001@sip.domain.nl">1001@sip.domain.nl</a>
=> <a moz-do-not-send="true" href="mailto:1000@sip.domain.nl">1000@sip.domain.nl</a><br>
<br>
Call comes in, detect whether the R-URI is an alias and point the
call to <a moz-do-not-send="true" href="mailto:alias@1.2.3.4">alias@1.2.3.4</a>
where 1.2.3.4 is the IP address listed in the AOR for the user to
which the alias is pointing.<br>
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.<br>
<br>
Could someone point me in the right direction?<br>
Thanks in advance,<br>
Remco.<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
OpenSIPS solutions and "know-how"</pre>
</body>
</html>