two way routing

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

two way routing

Jean Cérien

Hello

I am looking at the following configuration: 

1/ voip providers, with different external sip servers, will send calls to kamailio, that will dispatch them to asterisk servers, with load balancing & failover. The IP of the asterisk servers are known and fixed.

2/ the asterisk servers will also place calls, going through kamailio, that will dispatch them to the voip provider sip servers, based on R-URI / Prefix.

I've achieved #1 with dispatcher module, I've seen carrierroute module that can achieve #2, but I dont really grasp how to put the two together.

I have the feeling that #1 can also be done with carrierroute, and that I only need to check if the 'from' domain is one my asterisk, and chose a different routing table, but I dont see how to do that

is that a valid approch ? where should I look to do that ?

thanks

J.

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: two way routing

Daniel-Constantin Mierla-6

Hello,

I typically blend several modules to achieve your routing needs:

  - permissions module with address table to detect if calls are coming from providers or asterisk farm

  - based on result use load balancer to send out to asterisk farm

  - or use pdt (if each provider has one gateway) or mtree+dispatcher (mtree to translate from a prefix to a dispatcher set id of the provider with many gateways) to send out to providers

If least cost routing is needed towards providers, then you can decide to use one of next modules:

   - lcr

   - carrierroute

   - drouting

Cheers,
Daniel


On 12.06.17 21:21, Jean Cérien wrote:

Hello

I am looking at the following configuration: 

1/ voip providers, with different external sip servers, will send calls to kamailio, that will dispatch them to asterisk servers, with load balancing & failover. The IP of the asterisk servers are known and fixed.

2/ the asterisk servers will also place calls, going through kamailio, that will dispatch them to the voip provider sip servers, based on R-URI / Prefix.

I've achieved #1 with dispatcher module, I've seen carrierroute module that can achieve #2, but I dont really grasp how to put the two together.

I have the feeling that #1 can also be done with carrierroute, and that I only need to check if the 'from' domain is one my asterisk, and chose a different routing table, but I dont see how to do that

is that a valid approch ? where should I look to do that ?

thanks

J.


_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: two way routing

Jean Cérien

Thanks, I went for the permission + dispatcher, and so far it looks good.

One last thing.... I need the kamailio server to explicitly register to a provider. Googling the archive, I could only find an old reference to use sipsak. Does that mean that sipsak (or any other sip crafting tool like sipsak) should send a register request to Kamailio, which in turn will forward it to the voip provider ?


Rgds
J


On Tue, Jun 13, 2017 at 3:01 AM, Daniel-Constantin Mierla <[hidden email]> wrote:

Hello,

I typically blend several modules to achieve your routing needs:

  - permissions module with address table to detect if calls are coming from providers or asterisk farm

  - based on result use load balancer to send out to asterisk farm

  - or use pdt (if each provider has one gateway) or mtree+dispatcher (mtree to translate from a prefix to a dispatcher set id of the provider with many gateways) to send out to providers

If least cost routing is needed towards providers, then you can decide to use one of next modules:

   - lcr

   - carrierroute

   - drouting

Cheers,
Daniel


On 12.06.17 21:21, Jean Cérien wrote:

Hello

I am looking at the following configuration: 

1/ voip providers, with different external sip servers, will send calls to kamailio, that will dispatch them to asterisk servers, with load balancing & failover. The IP of the asterisk servers are known and fixed.

2/ the asterisk servers will also place calls, going through kamailio, that will dispatch them to the voip provider sip servers, based on R-URI / Prefix.

I've achieved #1 with dispatcher module, I've seen carrierroute module that can achieve #2, but I dont really grasp how to put the two together.

I have the feeling that #1 can also be done with carrierroute, and that I only need to check if the 'from' domain is one my asterisk, and chose a different routing table, but I dont see how to do that

is that a valid approch ? where should I look to do that ?

thanks

J.


_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: two way routing

Daniel-Constantin Mierla-6

Sipsak or other tool pointing via Contact header to Kamailio is still an option, but you can use directly uac module -- you have to set the details for remote registrations inside uac_reg database table and configure uac module, some details also at:

  - https://kamailio.org/docs/modules/5.0.x/modules/uac.html#idp38102932

Cheers,
Daniel


On 14.06.17 18:17, Jean Cérien wrote:

Thanks, I went for the permission + dispatcher, and so far it looks good.

One last thing.... I need the kamailio server to explicitly register to a provider. Googling the archive, I could only find an old reference to use sipsak. Does that mean that sipsak (or any other sip crafting tool like sipsak) should send a register request to Kamailio, which in turn will forward it to the voip provider ?


Rgds
J


On Tue, Jun 13, 2017 at 3:01 AM, Daniel-Constantin Mierla <[hidden email]> wrote:

Hello,

I typically blend several modules to achieve your routing needs:

  - permissions module with address table to detect if calls are coming from providers or asterisk farm

  - based on result use load balancer to send out to asterisk farm

  - or use pdt (if each provider has one gateway) or mtree+dispatcher (mtree to translate from a prefix to a dispatcher set id of the provider with many gateways) to send out to providers

If least cost routing is needed towards providers, then you can decide to use one of next modules:

   - lcr

   - carrierroute

   - drouting

Cheers,
Daniel


On 12.06.17 21:21, Jean Cérien wrote:

Hello

I am looking at the following configuration: 

1/ voip providers, with different external sip servers, will send calls to kamailio, that will dispatch them to asterisk servers, with load balancing & failover. The IP of the asterisk servers are known and fixed.

2/ the asterisk servers will also place calls, going through kamailio, that will dispatch them to the voip provider sip servers, based on R-URI / Prefix.

I've achieved #1 with dispatcher module, I've seen carrierroute module that can achieve #2, but I dont really grasp how to put the two together.

I have the feeling that #1 can also be done with carrierroute, and that I only need to check if the 'from' domain is one my asterisk, and chose a different routing table, but I dont see how to do that

is that a valid approch ? where should I look to do that ?

thanks

J.


_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com
_______________________________________________ Kamailio (SER) - Users Mailing List [hidden email] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: two way routing

Jean Cérien

Thanks

I have the registration working, but when my kamailio receives an INVITE, I am a bit lost regarding what to do. in my route(AUTH), I am trying to check uac_reg_status, but no success.

my db: 
kamailio:/etc/kamailio# kamcmd uac.reg_dump
{
l_uuid: 123
l_username: passgwada
l_domain: 192.168.2.228
r_username: passgwada
r_domain: 192.168.2.230
realm: xivo
auth_username: passgwada
auth_password: 1234
auth_proxy: sip:192.168.2.230
expires: 60
flags: 2
diff_expires: -1497475389
timer_expires: 0
reg_init: 1497475386
reg_delay: 5
}

and the invite arriving
INVITE [hidden email] SIP/2.0
Via: SIP/2.0/UDP 192.168.2.230:5060;branch=z9hG4bK17eeae32;rport
Max-Forwards: 70
From: "0512345678" <sip:0512345678@192.168.2.230>;tag=as0541bcd3
Contact: <sip:0512345678@192.168.2.230:5060>
CSeq: 102 INVITE
User-Agent: XiVO PBX
Date: Wed, 14 Jun 2017 21:09:29 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 300
......


Any help will be greatly appreciated

J.

On Wed, Jun 14, 2017 at 12:45 PM, Daniel-Constantin Mierla <[hidden email]> wrote:

Sipsak or other tool pointing via Contact header to Kamailio is still an option, but you can use directly uac module -- you have to set the details for remote registrations inside uac_reg database table and configure uac module, some details also at:

  - https://kamailio.org/docs/modules/5.0.x/modules/uac.html#idp38102932

Cheers,
Daniel


On 14.06.17 18:17, Jean Cérien wrote:

Thanks, I went for the permission + dispatcher, and so far it looks good.

One last thing.... I need the kamailio server to explicitly register to a provider. Googling the archive, I could only find an old reference to use sipsak. Does that mean that sipsak (or any other sip crafting tool like sipsak) should send a register request to Kamailio, which in turn will forward it to the voip provider ?


Rgds
J


On Tue, Jun 13, 2017 at 3:01 AM, Daniel-Constantin Mierla <[hidden email]> wrote:

Hello,

I typically blend several modules to achieve your routing needs:

  - permissions module with address table to detect if calls are coming from providers or asterisk farm

  - based on result use load balancer to send out to asterisk farm

  - or use pdt (if each provider has one gateway) or mtree+dispatcher (mtree to translate from a prefix to a dispatcher set id of the provider with many gateways) to send out to providers

If least cost routing is needed towards providers, then you can decide to use one of next modules:

   - lcr

   - carrierroute

   - drouting

Cheers,
Daniel


On 12.06.17 21:21, Jean Cérien wrote:

Hello

I am looking at the following configuration: 

1/ voip providers, with different external sip servers, will send calls to kamailio, that will dispatch them to asterisk servers, with load balancing & failover. The IP of the asterisk servers are known and fixed.

2/ the asterisk servers will also place calls, going through kamailio, that will dispatch them to the voip provider sip servers, based on R-URI / Prefix.

I've achieved #1 with dispatcher module, I've seen carrierroute module that can achieve #2, but I dont really grasp how to put the two together.

I have the feeling that #1 can also be done with carrierroute, and that I only need to check if the 'from' domain is one my asterisk, and chose a different routing table, but I dont see how to do that

is that a valid approch ? where should I look to do that ?

thanks

J.


_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com
_______________________________________________ Kamailio (SER) - Users Mailing List [hidden email] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com


_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: two way routing

Daniel Tryba-2
On Wed, Jun 14, 2017 at 05:28:35PM -0400, Jean Cérien wrote:
> I have the registration working, but when my kamailio receives an INVITE, I
> am a bit lost regarding what to do. in my route(AUTH), I am trying to check
> uac_reg_status, but no success.
 
> and the invite arriving
> INVITE sip:1100@192.168.2.228 SIP/2.0
>
> Any help will be greatly appreciated

Either accept all INVITEs from the IPs you are registering, use
something like db_aliases to map 1100 to your known username or change
the setup of the PBX you are registering to to not use the dialed nummer
in the R-URI but the username (it is an asterisk so it is the difference
between Dial(SIP/${EXTEN}@username) and Dial(SIP/username))

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: two way routing

Jean Cérien

Thanks.
I dont have control over the host I need to register to, so I cant unfortunately retrieve the luuid.

Is there a way to lookup in the uacreg table with the IP ? I could only find uac_reg_lookup, but it required the luuid. I've worked around that adding an entry into address, but I am not really satisfied with this method, 

Regards, 
J

On Thu, Jun 15, 2017 at 4:24 AM, Daniel Tryba <[hidden email]> wrote:
On Wed, Jun 14, 2017 at 05:28:35PM -0400, Jean Cérien wrote:
> I have the registration working, but when my kamailio receives an INVITE, I
> am a bit lost regarding what to do. in my route(AUTH), I am trying to check
> uac_reg_status, but no success.

> and the invite arriving
> INVITE [hidden email] SIP/2.0
>
> Any help will be greatly appreciated

Either accept all INVITEs from the IPs you are registering, use
something like db_aliases to map 1100 to your known username or change
the setup of the PBX you are registering to to not use the dialed nummer
in the R-URI but the username (it is an asterisk so it is the difference
between Dial(SIP/${EXTEN}@username) and Dial(SIP/username))

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: two way routing

Daniel Tryba-2
On Fri, Jun 16, 2017 at 11:55:06AM -0400, Jean Cérien wrote:
> Is there a way to lookup in the uacreg table with the IP ? I could only
> find uac_reg_lookup, but it required the luuid. I've worked around that
> adding an entry into address, but I am not really satisfied with this
> method,

You could use slqops to query the database manually.


_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Loading...