Hello! provider trunks registration on kamailio UAC?! it's clear.
but how does asterisk find out through which trunk the call should be made?
I tried to set the header from asterisk dialplan.
for example:
if (is_method("INVITE")) {
#record_route_preset("109.195.102.122");
route(DIRECTION);
setflag(FLT_ACC); # do accounting
}
# ------ LOADBALANCE ROUTE ------------ #
if(!ds_is_from_list()) {
route(DISPATCH);
}
route[DISPATCH] {
#round robin dispatching on gateways group '1'
if(!ds_select_dst("1", "4"))
{
send_reply("404", "No destination");
exit;
}
xlog("L_DBG", "--- SCRIPT: going to <$ru> via <$du>\n");
t_on_failure("RTF_DISPATCH");
route(NATMANAGE);
route(DRELAY);
exit;
}
route[DIRECTION] {
if ($hdr(x-trunk) != $null) {
if (!is_method("BYE")){
$fu="";
t_on_failure("MANAGE_FAILURE");
$dlg_ctx(timeout_route) =
"DIALOG_END";
$avp(i:10)=43200;
$dlg_ctx(timeout_bye) = 0;
sql_pvquery("ca", "select l_uuid, auth_username, auth_password,
realm, l_domain, r_domain from uacreg where id='$hdr(x-trunk)'",
"$avp(uuid), $avp(uname), $avp(passwd), $avp(realm), $avp(src_ipaddr),
$avp(dst_ipaddr)");
t_on_failure("MANAGE_FAILURE");
$dlg_ctx(timeout_route) =
"DIALOG_END";
$avp(i:10)=43200;
$dlg_ctx(timeout_bye) = 0;
$fu="";
uac_replace_from("sip:$avp(uname)@$avp(dst_ipaddr)");
$tu="sip:"+$tU+"@"+$avp(dst_ipaddr);
$ru="sip:"+$tU+"@"+$avp(dst_ipaddr);
remove_hf("Contact");
$var(contact)="sip:"+$avp(uname)+"@10.49.9.2:5060";
insert_hf("Contact: <$var(contact)>\r\n");
#insert_hf("Contact: ");
msg_apply_changes();
fix_nated_register();
xlog("L_INFO","Contact header $var(contact)
111111111111111111111111111111111111111 is $ct {$ct}\n");
route(RELAY);
} #### BYE
} ### XTRUNK
But in this configuration I do not come bye
but when I register providers trunks on asterisk - problem with BYE not
visible.
but I can not register provider-trunks on all the asterisks, because
incoming invite arrives at the link + address, and all the asteriscs ring.
All my asterisk's behind nat
Hello.
Have a following task. Select carrier by carrierroute module from db, try to route (dial, relay, bridge - you name it) call there and if call is failed/rejected due to any reason, go to failure_route(?), perform carrierroute lookup again for another carrier and route call there. Main problem is that different carriers require different From/To format. And Kamailio don't allow to use uac* functions in failure_route. How to resolve this? Maybe entire routing method is wrong for my task? Any advice?
--
sent from myMail for Android
Hello,
at this moment i try to figure out the best way to add an "switch" for
debug/log output.
I use many xlog, like everyone that starts with kamailio too.
Then i go further and add #!ifdef cases around to switch this via #!define.
Is there any other way to turn on/off my "debug"-logging on the fly, while
kamailio is still running?
#!define TESTBED_MODE
request_route{
...
#!ifdef TESTBED_MODE
route(DEBUG);
#!endif
...
#!ifdef TESTBED_MODE
xlog("L_INFO","---FIX_SIPS-after: ru:($ru)");
#!endif
...
}
--
Kind Regards
*Karsten Horsmann*
Hello,
I am considering to release Kamailio v5.0.3 sometime next week,
therefore it is the time to backport patches with fixes from master that
apply to 5.0 branch. If you are aware of such fix that has to be
backported, reply here or make a pull request on github project.
Cheers,
Daniel
--
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com
Hello List,
of course - best way is not to use sips: uri scheme. But i have to deal
with that.
I try to configure an multihomed kamailio (public/private IP) in front of
my SIP-Servers.
One of my softphones variants used TLS for connection but the INVITES of
this softphone use the "sips" URI scheme.
As i saw in other posts, this seems to be an issue for many people.
In my case it breaks the routing to my internal sip-server (only plain udp).
Most of my config is similar to havfos example + TLS.
https://github.com/havfo/WEBRTC-to-SIP/blob/master/etc/kamailio/kamailio.cfg
I tried to fixed that with this extra route -
but this breaks the dialog somewhere - after 60 seconds i have no audio and
the BYE becomes another CSeq:
in the request_route right after route(AUTH) i add my route(FIX_SIPS)
if (is_method("INVITE|SUBSCRIBE")) {
if ($ru =~ "^sips:") {
route(FIX_SIPS);
} else {
record_route();
}
}
route[FIX_SIPS] {
if ($ru =~ "^sips:") {
xlog("L_INFO","---FIX_SIPS-before: ru:($ru)");
$var(orig_uri) = $ru;
$ru = "sip:" + $rU + "@" + $td;
xlog("L_INFO","---FIX_SIPS-now: $rU $td ru:($ru)
orig_uri:($var(orig_uri))");
record_route();
#$ru = $var(orig_uri);
xlog("L_INFO","---FIX_SIPS-after: ru:($ru)");
}
}
172.20.120.81 = Kamailio private IP
172.20.120.79 = My internal SIP-Server (B2BUA)
I used kamailio with CentOS 7 and RTPENGINE 63bdd615 from master
kamailio-5.0.2-3.1.x86_64
kamailio-tls-5.0.2-3.1.x86_64
kamailio-mysql-5.0.2-3.1.x86_64
kamailio-websocket-5.0.2-3.1.x86_64
--
Kind Regards
*Karsten Horsmann*
sqlops README tells:
4.5. sql_query_async(connection, query)
Make an async SQL query using 'connection', if implemented by db
driver module (e.g., db_mysql)
my sqlops sqlcon parameter specifies mysql driver, but still i get to
syslog:
Aug 24 08:02:05 rox1 /usr/bin/sip-proxy[13886]: ERROR: sqlops [sql_api.c:427]: sql_do_query_async(): the db driver module doesn'tsupport async query
any idea why?
-- juha
Good morning! kamailio + dispatcher + provider trunks. How to make RR for
incoming calls from pstn? my trunks are authorized on an asterisk, but i
have problem with multiple calls on each asterisk.
If I do through uac then I have a problem with BYE, and in general the
module is uncomfortable.
Please tell me how to implement a bunch: kamailio + asterisk + provider
trunks..