2 opensip-routers with one location database

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

2 opensip-routers with one location database

Uwe Kastens
Hello,

I have two opensip-servers. One is a registrar for abc.domain.de the
other is for xyz.domain.de. It should be possible to register to both
system (one is internal in a trusted ip-range, the other is untrusted)
several times with different devices.

All calls from the pstn will go to abc.domain.de (trusted one). This one
should look up the user location db and fork the calls to the internal
and external users.

question 1)
Is it enough to work with a lookup("location") and start the forking
with t_relay() ?

route[1] {
      if (lookup("location")) {
         if (!t_relay()) {
                xlog("L_DBG","==========\nerror on
sl_reply_error();
         };
        }
exit;
}


question 2)
Can I merge both different domain lookups in one statement to get the
entries from the USRLOC?

BR

Kiste



--

kiste lat: 54.322684, lon: 10.13586

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: 2 opensip-routers with one location database

Bogdan-Andrei Iancu
Hi Kiste,

Uwe Kastens wrote:

> Hello,
>
> I have two opensip-servers. One is a registrar for abc.domain.de the
> other is for xyz.domain.de. It should be possible to register to both
> system (one is internal in a trusted ip-range, the other is untrusted)
> several times with different devices.
>
> All calls from the pstn will go to abc.domain.de (trusted one). This one
> should look up the user location db and fork the calls to the internal
> and external users.
>
> question 1)
> Is it enough to work with a lookup("location") and start the forking
> with t_relay() ?
>  
yes, because if several contacts are registered, the lookup() will
create all the branches and t_relay() will automatically do the parallel
forking.

> route[1] {
>       if (lookup("location")) {
>          if (!t_relay()) {
>                 xlog("L_DBG","==========\nerror on
> sl_reply_error();
>          };
> }
> exit;
> }
>
>
> question 2)
> Can I merge both different domain lookups in one statement to get the
> entries from the USRLOC?
>  
the parameter to the lookup() is a DB table, not a domain, so you can
put multiple domains to be registered in the same table -> use a single
lookup().

Does both your proxies use/share the same "location" table?

Regards,
Bogdan

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: 2 opensip-routers with one location database

Uwe Kastens
Hi Bogdan,

>>
>>
>> question 2)
>> Can I merge both different domain lookups in one statement to get the
>> entries from the USRLOC?
>>  
> the parameter to the lookup() is a DB table, not a domain, so you can
> put multiple domains to be registered in the same table -> use a single
> lookup().
>
> Does both your proxies use/share the same "location" table?

yes, but clients use two different domains (one internal, one external).

Since I want, that the Invite comes from that opensips, the UA are
registred with, I cannot make a simple lookup with t_relay on one
opensips. So what I am doing right now, is that I make a lookup on the
internal opensips and check after that if there are any contacts for the
other opensips. If so, I simply add an branche for user@external, so
that the t_relay forks a call to the external with user@external.
Another lookup on the external system will then start the calls to the
UA registered with the external opensips:

external.domain is know by DNS

internal opensips
 rewritehost("internal.domain");
            if (lookup("location")) {
            rewritehost("external.domain");
            if (registered("location")) {
            append_branch("$[hidden email]");
            }
           t_relay();


external opensips
rewritehost("external.domain");
            if (lookup("location")) {
           t_relay();


My problem is, that t_relay on the internal opensips forks with a UDP
5060. This is ok for internal UA. But für the external opensips I would
like to force this to another port with tcp.

BR

Kiste

--

kiste lat: 54.322684, lon: 10.13586

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: 2 opensip-routers with one location database

Bogdan-Andrei Iancu
Hi Uwe,

what db_mode are you using in the usrloc module ?

I think the problem is you have a registration/contact saved by internal
opensips with the internal IP - if the this contact is looked up by
external proxy, it will not be able to use (as local socket) the IP
saved by the internal server.

So, to simplify things why don't you use a single OpenSIPS listening on
both internal and external IP?

Regards,
Bogdan

Uwe Kastens wrote:

> Hi Bogdan,
>
>  
>>> question 2)
>>> Can I merge both different domain lookups in one statement to get the
>>> entries from the USRLOC?
>>>  
>>>      
>> the parameter to the lookup() is a DB table, not a domain, so you can
>> put multiple domains to be registered in the same table -> use a single
>> lookup().
>>
>> Does both your proxies use/share the same "location" table?
>>    
>
> yes, but clients use two different domains (one internal, one external).
>
> Since I want, that the Invite comes from that opensips, the UA are
> registred with, I cannot make a simple lookup with t_relay on one
> opensips. So what I am doing right now, is that I make a lookup on the
> internal opensips and check after that if there are any contacts for the
> other opensips. If so, I simply add an branche for user@external, so
> that the t_relay forks a call to the external with user@external.
> Another lookup on the external system will then start the calls to the
> UA registered with the external opensips:
>
> external.domain is know by DNS
>
> internal opensips
>  rewritehost("internal.domain");
>             if (lookup("location")) {
>             rewritehost("external.domain");
>             if (registered("location")) {
>             append_branch("$[hidden email]");
>             }
>            t_relay();
>
>
> external opensips
> rewritehost("external.domain");
>             if (lookup("location")) {
>            t_relay();
>
>
> My problem is, that t_relay on the internal opensips forks with a UDP
> 5060. This is ok for internal UA. But für the external opensips I would
> like to force this to another port with tcp.
>
> BR
>
> Kiste
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users