All,
I would like to use Kamailio as a frontend/proxy for an asterisk machine/cluster. I'm very well versed in Asterisk, but VERY noob to Kamailio.
I've watched so many Kamailio presentations and feel like I've scoured the web for any article that could help me. There is alot out there, but I'm not finding my exact situation.
I believe I understand the dispatcher stuff that I'll need down the road, but I'm having issues understanding the setup of my SIP trunk and Kamailio.
I used UAC to setup the trunk connection in Kamailio and it sort of worked. I'm not sure what I do for Asterisk. I'd suspect that in this situation Kamailio would handle the registration and trunk connection for me.
What role is Kamailio to my Asterisk? Just an Outbound proxy? Do I need to still register the trunk from each Asterisk box "thru" the Kamailio proxy, etc?
Also, I'm merely accepting outside calls and then validating the caller and bridging them back out to the PSTN, so I don't have any local SIP clients, etc., so no need to register the sip devices, etc.
Thanks!
Travis
Hello,
You can just set the outbound proxy on asterisk to use kamailio. Thats should work properly. Kamailio will simply act as a proxy.
Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Tue, Aug 20, 2019 at 3:23 PM Travis Ryan travis@travisryan.com wrote:
All,
I would like to use Kamailio as a frontend/proxy for an asterisk machine/cluster. I'm very well versed in Asterisk, but VERY noob to Kamailio.
I've watched so many Kamailio presentations and feel like I've scoured the web for any article that could help me. There is alot out there, but I'm not finding my exact situation.
I believe I understand the dispatcher stuff that I'll need down the road, but I'm having issues understanding the setup of my SIP trunk and Kamailio.
I used UAC to setup the trunk connection in Kamailio and it sort of worked. I'm not sure what I do for Asterisk. I'd suspect that in this situation Kamailio would handle the registration and trunk connection for me.
What role is Kamailio to my Asterisk? Just an Outbound proxy? Do I need to still register the trunk from each Asterisk box "thru" the Kamailio proxy, etc?
Also, I'm merely accepting outside calls and then validating the caller and bridging them back out to the PSTN, so I don't have any local SIP clients, etc., so no need to register the sip devices, etc.
Thanks!
Travis
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Tue, Aug 20, 2019 at 10:22:26AM -0400, Travis Ryan wrote:
What role is Kamailio to my Asterisk? Just an Outbound proxy? Do I need to still register the trunk from each Asterisk box "thru" the Kamailio proxy, etc?
Also, I'm merely accepting outside calls and then validating the caller and bridging them back out to the PSTN, so I don't have any local SIP clients, etc., so no need to register the sip devices, etc.
The real question is what do you need kamailio to do? You answer this with as a simple proxy.
A possible solution for you is to use kamilio with the dispatcher module. One id (1) for the PSTN side, one id (2) for the Asterisk side. If a call comes in from 1, route it to 2 and v.v.
This makes the kamailio machine the "endpoint" for both PSTN and Asterisk side.
With the "default" config that comes with kamailio all you need to do is strip out anything from the accounting bit in request_route (line 508) https://github.com/kamailio/kamailio/blob/master/etc/kamailio.cfg and insert something like:
if(ds_is_from_list("1",3)) { $avp(dispatcherid)="2"; } else if(ds_is_from_list("2",3)) { $avp(dispatcherid)="1"; } else { send_reply("403", "Go away"); exit; }
route(DISPATCHER); route(RELAY);
With route DISPATCHER being: route[DISPATCHER] { if(!ds_select_dst($avp(dispatcherid), "4")) { send_reply("501", "No dispatcher available"); exit; }
t_on_failure("RTF_DISPATCH");
return; }
See https://kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatcher.... for more info on integrating the dispatcher module.
More advanced subjects to look at are: -do you need an rtp proxy? -do you need topology hiding? -is NAT involved?
But leave them until you have a clue about how to use kamailio as a sip proxy in a simple test environment (e.g. between 2 asterisk servers).
Thanks,
I want to eventually get to a setup like the one here: https://github.com/CyCoreSystems/asterisk-k8s-demo
But since I'll need Kamailio to handle a high load of incoming calls, I think I need it to direct traffic, etc for any number of Asterisk servers behind it.
In this setup it indeed has RTPProxy, etc. I just want to understand how to use it rather than just drop it in, etc. Also the demo doesn't have any config for an outside SIP trunk, etc.
Maybe this helps?
Thanks, Travis
On 8/20/19 11:01 AM, Daniel Tryba wrote:
On Tue, Aug 20, 2019 at 10:22:26AM -0400, Travis Ryan wrote:
What role is Kamailio to my Asterisk? Just an Outbound proxy? Do I need to still register the trunk from each Asterisk box "thru" the Kamailio proxy, etc?
Also, I'm merely accepting outside calls and then validating the caller and bridging them back out to the PSTN, so I don't have any local SIP clients, etc., so no need to register the sip devices, etc.
The real question is what do you need kamailio to do? You answer this with as a simple proxy.
A possible solution for you is to use kamilio with the dispatcher module. One id (1) for the PSTN side, one id (2) for the Asterisk side. If a call comes in from 1, route it to 2 and v.v.
This makes the kamailio machine the "endpoint" for both PSTN and Asterisk side.
With the "default" config that comes with kamailio all you need to do is strip out anything from the accounting bit in request_route (line 508) https://github.com/kamailio/kamailio/blob/master/etc/kamailio.cfg and insert something like:
if(ds_is_from_list("1",3)) { $avp(dispatcherid)="2"; } else if(ds_is_from_list("2",3)) { $avp(dispatcherid)="1"; } else { send_reply("403", "Go away"); exit; }
route(DISPATCHER); route(RELAY);
With route DISPATCHER being: route[DISPATCHER] { if(!ds_select_dst($avp(dispatcherid), "4")) { send_reply("501", "No dispatcher available"); exit; }
t_on_failure("RTF_DISPATCH");
return; }
See https://kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatcher.... for more info on integrating the dispatcher module.
More advanced subjects to look at are: -do you need an rtp proxy? -do you need topology hiding? -is NAT involved?
But leave them until you have a clue about how to use kamailio as a sip proxy in a simple test environment (e.g. between 2 asterisk servers).
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi Travis,
two projects that enables siptrunking and routing:
https://github.com/voiceboys/sbcOS (ip-auth based or registrar on your side) https://dsiprouter.readthedocs.io/en/latest/
Also intressting to see how they solved this problems.
If you could describe your siptrunk a bit more, then would here many people that can point you in the right direction how to solve that with or without kamailio.
Cheers Karsten
Am Di., 20. Aug. 2019 um 17:11 Uhr schrieb Travis Ryan < travis@travisryan.com>:
Thanks,
I want to eventually get to a setup like the one here: https://github.com/CyCoreSystems/asterisk-k8s-demo
But since I'll need Kamailio to handle a high load of incoming calls, I think I need it to direct traffic, etc for any number of Asterisk servers behind it.
In this setup it indeed has RTPProxy, etc. I just want to understand how to use it rather than just drop it in, etc. Also the demo doesn't have any config for an outside SIP trunk, etc.
Maybe this helps?
Thanks, Travis
On 8/20/19 11:01 AM, Daniel Tryba wrote:
On Tue, Aug 20, 2019 at 10:22:26AM -0400, Travis Ryan wrote:
What role is Kamailio to my Asterisk? Just an Outbound proxy? Do I need
to
still register the trunk from each Asterisk box "thru" the Kamailio
proxy,
etc?
Also, I'm merely accepting outside calls and then validating the caller
and
bridging them back out to the PSTN, so I don't have any local SIP
clients,
etc., so no need to register the sip devices, etc.
The real question is what do you need kamailio to do? You answer this with as a simple proxy.
A possible solution for you is to use kamilio with the dispatcher
module. One
id (1) for the PSTN side, one id (2) for the Asterisk side. If a call
comes in
from 1, route it to 2 and v.v.
This makes the kamailio machine the "endpoint" for both PSTN and Asterisk side.
With the "default" config that comes with kamailio all you need to do is strip out anything from the accounting bit in request_route (line 508) https://github.com/kamailio/kamailio/blob/master/etc/kamailio.cfg and insert something like:
if(ds_is_from_list("1",3)) { $avp(dispatcherid)="2"; } else if(ds_is_from_list("2",3)) { $avp(dispatcherid)="1"; } else { send_reply("403", "Go away"); exit; }
route(DISPATCHER); route(RELAY);
With route DISPATCHER being: route[DISPATCHER] { if(!ds_select_dst($avp(dispatcherid), "4")) { send_reply("501", "No dispatcher available"); exit; }
t_on_failure("RTF_DISPATCH"); return;
}
See
https://kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatcher....
for more info on integrating the dispatcher module.
More advanced subjects to look at are: -do you need an rtp proxy? -do you need topology hiding? -is NAT involved?
But leave them until you have a clue about how to use kamailio as a sip
proxy in a
simple test environment (e.g. between 2 asterisk servers).
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
I'm using sip.digiumcloud.net but eventually will be using wholesale at bandwidth.com. I'll take a look at your links. Thanks!
On 8/21/19 10:08 AM, Karsten Horsmann wrote:
Hi Travis,
two projects that enables siptrunking and routing:
https://github.com/voiceboys/sbcOS (ip-auth based or registrar on your side) https://dsiprouter.readthedocs.io/en/latest/
Also intressting to see how they solved this problems.
If you could describe your siptrunk a bit more, then would here many people that can point you in the right direction how to solve that with or without kamailio.
Cheers Karsten
Am Di., 20. Aug. 2019 um 17:11 Uhr schrieb Travis Ryan <travis@travisryan.com mailto:travis@travisryan.com>:
Thanks, I want to eventually get to a setup like the one here: https://github.com/CyCoreSystems/asterisk-k8s-demo But since I'll need Kamailio to handle a high load of incoming calls, I think I need it to direct traffic, etc for any number of Asterisk servers behind it. In this setup it indeed has RTPProxy, etc. I just want to understand how to use it rather than just drop it in, etc. Also the demo doesn't have any config for an outside SIP trunk, etc. Maybe this helps? Thanks, Travis On 8/20/19 11:01 AM, Daniel Tryba wrote: > On Tue, Aug 20, 2019 at 10:22:26AM -0400, Travis Ryan wrote: >> What role is Kamailio to my Asterisk? Just an Outbound proxy? Do I need to >> still register the trunk from each Asterisk box "thru" the Kamailio proxy, >> etc? >> >> Also, I'm merely accepting outside calls and then validating the caller and >> bridging them back out to the PSTN, so I don't have any local SIP clients, >> etc., so no need to register the sip devices, etc. > The real question is what do you need kamailio to do? You answer this > with as a simple proxy. > > A possible solution for you is to use kamilio with the dispatcher module. One > id (1) for the PSTN side, one id (2) for the Asterisk side. If a call comes in > from 1, route it to 2 and v.v. > > This makes the kamailio machine the "endpoint" for both PSTN and > Asterisk side. > > With the "default" config that comes with kamailio all you need to do is > strip out anything from the accounting bit in request_route (line 508) > https://github.com/kamailio/kamailio/blob/master/etc/kamailio.cfg > and insert something like: > > if(ds_is_from_list("1",3)) > { > $avp(dispatcherid)="2"; > } > else if(ds_is_from_list("2",3)) > { > $avp(dispatcherid)="1"; > } > else > { > send_reply("403", "Go away"); > exit; > } > > route(DISPATCHER); > route(RELAY); > > With route DISPATCHER being: > route[DISPATCHER] > { > if(!ds_select_dst($avp(dispatcherid), "4")) > { > send_reply("501", "No dispatcher available"); > exit; > } > > t_on_failure("RTF_DISPATCH"); > > return; > } > > See https://kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatcher.ex.config > for more info on integrating the dispatcher module. > > More advanced subjects to look at are: > -do you need an rtp proxy? > -do you need topology hiding? > -is NAT involved? > > But leave them until you have a clue about how to use kamailio as a sip proxy in a > simple test environment (e.g. between 2 asterisk servers). > > _______________________________________________ > Kamailio (SER) - Users Mailing List > sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Mit freundlichen Grüßen *Karsten Horsmann*
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users