[OpenSIPS-Users] better solution possible? => lookup and routing with 2 location databases
Uwe Kastens
kiste at kiste.org
Sun Jun 14 20:10:50 CEST 2009
Hi Bogdan,
Thanks for your answer.
If I understood you scripting correctly, the lookup("locinternal"); will
have the value of the 1st lookup, if there is an entry in locinternal.
If the 2nd if (registered("location ...) will match, than I will have
the entry from location only, correct?
BR
Uwe
Bogdan-Andrei Iancu schrieb:
> Hi Uwe,
>
> I think the problem is in the branch management. If I get is right, you
> get the records from locinternal table and if records are present in
> location, you fork a branch to the other server, right ?
>
> If so, you do something like :
>
> route[1] {
> if (!loose_route()){
> rewritehostport("domain1.de");
> $var(x) = $rU+"@domain2.de";
> lookup("locinternal");
> if (registered("location","$var(x)")) {
> $rb = $var(x);
> }
> }
>
> See:
> http://www.opensips.org/html/docs/modules/1.5.x/registrar.html#id271315
>
> Regards,
> Bogdan
>
> Uwe Kastens wrote:
>> Hi,
>>
>> Perhaps somebody has a better idea to solve the following issue. I have
>> two opensips servers. UA can register at both opensips with different
>> domains and credentials.
>>
>> opensips1 will get the calls from pstn and should route them to
>> opensips2 , if the UA is registered as well with opensips2.
>>
>> I would like to have parallel invites to all registered UAs. But the
>> invites should come from that opensips, with which the UA is registered.
>>
>> 1st I was wondering, why a call is forked to opensips2 as well, even if
>> no UA is registered there. I think it might be caused by the
>> rewritehostport("domain2.de") which is working on the current URI?
>>
>> route[1] {
>> if (!loose_route()){
>> rewritehostport("domain1.de");
>> if lookup("locinternal") {
>> append_branch();
>> }
>> rewritehostport("domain2.de");
>> if (registered("location")) {
>> append_branch("$rU at domain2.de");
>> }
>> }
>>
>> if (!t_relay()) {
>> sl_reply_error();
>> };
>> t_on_reply("1");
>> }
>>
>>
>> BR
>>
>> Uwe
>>
>
>
--
kiste lat: 54.322684, lon: 10.13586
More information about the Users
mailing list