Compare commits

...

26 Commits
master ... 3.19

Author SHA1 Message Date
  Brian Davis c829766e7a use is_present_hf to check if Expires header is set 11 years ago
  karl anderson b75a1d9013 disable system api commands 11 years ago
  karl anderson b003ff1758 registrar: fix expires value var name 11 years ago
  bmac901 d91cf38443 Fix for secure websocket registrations. 11 years ago
  James Aimonetti a561453189 Treat warnings as warnings 11 years ago
  karl anderson 3b0216bf60 do not failover re-invite rejections 11 years ago
  karl anderson 0ccd9c6c41 KAZOO-3308: backport call-park redirect 11 years ago
  karl anderson 514c7ed445 KAZOO-3336: execute nat correction for recieved OPTIONS 11 years ago
  karl anderson 9811ebbea6 registrar: fix expires value 11 years ago
  lazedo 86e9f783b7 KAZOO-3388 - false duplicate 11 years ago
  karl anderson 171c43468e change min_expires_action 11 years ago
  OnNet f11d73ea7c Looks like semicolon missed 11 years ago
  lazedo de6a34a809 presence: fix expires value 11 years ago
  karl anderson 2680dfe727 update the fs_path to reflect the IP of the interface that recieved the request 11 years ago
  lazedo fd0b64bf98 FIX MESSAGE-ROLE 2 11 years ago
  lazedo 2acf9c4891 FIX MESSAGE-ROLE 11 years ago
  karl anderson f18a1f1f14 removed fix for mixed case uri as it turned out to be a bug in dbtext and fixed upstream 11 years ago
  karl anderson 07a7c94c6d KAZOO-3343: when running sub_db_mode 3 include a waitn parameter to negate the BLF delay 11 years ago
  karl anderson 9efcddf1ef KAZOO-3343: there is not need to keep the locality in two places and we cant use NAT pings with dbtext 11 years ago
  karl anderson 3263389e98 KAZOO-3357: if handle_subscribe failes dont publish a AMQP message 11 years ago
  karl anderson 52ecc7b707 KAZOO-3336: execute nat test and correct in HANDLE_NOTIFY, also updated the db_insert parameter for 4.2 11 years ago
  karl anderson 3c30c8d8df KAZOO-3288: set the default moh on the default conference profile 11 years ago
  karl anderson f421aab008 merged the various changes for Kamailio 4.2 11 years ago
  lazedo 1e0424072b fix mixed case in notifications 11 years ago
  lazedo 0e4d783b69 presence-role fix fo mixed case uri 11 years ago
  karl anderson 3468c72a04 KAZOO-3320 reject subscribe requests if there is nothing to subscribe to (or from) 11 years ago
11 changed files with 246 additions and 60 deletions
Split View
  1. +1
    -0
      freeswitch/autoload_configs/conference.conf.xml
  2. +1
    -0
      freeswitch/freeswitch.xml
  3. +0
    -0
      kamailio/dbtext/active_watchers
  4. +0
    -0
      kamailio/dbtext/location
  5. +1
    -0
      kamailio/dbtext/location_attrs
  6. +100
    -22
      kamailio/default.cfg
  7. +13
    -5
      kamailio/dispatcher-role.cfg
  8. +55
    -0
      kamailio/message-role.cfg
  9. +46
    -27
      kamailio/presence-role.cfg
  10. +26
    -6
      kamailio/registrar-role.cfg
  11. +3
    -0
      vm.args

+ 1
- 0
freeswitch/autoload_configs/conference.conf.xml View File

@ -26,6 +26,7 @@
<param name="bad-pin-sound" value=""/>
<param name="caller-id-name" value="Unknown"/>
<param name="caller-id-number" value="5555555555"/>
<param name="moh-sound" value="$${hold_music}"/>
<!-- <param name="suppress-events" value="start-talking,stop-talking"/> -->
<param name="comfort-noise" value="true"/>
</profile>


+ 1
- 0
freeswitch/freeswitch.xml View File

@ -1,5 +1,6 @@
<?xml version="1.0"?>
<document type="freeswitch/xml">
<X-PRE-PROCESS cmd="set" data="disable_system_api_commands=true"/>
<X-PRE-PROCESS cmd="set" data="be-ring=%(1000,3000,425)"/>
<X-PRE-PROCESS cmd="set" data="ca-ring=%(2000,4000,440,480)"/>


+ 0
- 0
kamailio/dbtext/active_watchers View File


+ 0
- 0
kamailio/dbtext/location View File


+ 1
- 0
kamailio/dbtext/location_attrs View File

@ -0,0 +1 @@
id(int,auto) ruid(string) username(string) domain(string,null) aname(string) atype(int) avalue(string) last_modified(int)

+ 100
- 22
kamailio/default.cfg View File

@ -139,30 +139,34 @@ loadmodule "xlog.so"
loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
######## UAC ########
loadmodule "uac.so"
######## UAC Redirection module ########
loadmodule "uac_redirect.so"
####### DB Text module ##########
loadmodule "db_text.so"
modparam("db_text", "db_mode", 1)
modparam("db_text", "emptystring", 1)
####### Kazoo Integration module ##########
loadmodule "db_kazoo.so"
modparam("db_kazoo", "node_hostname", "MY_HOSTNAME")
modparam("db_kazoo", "amqp_connection", "MY_AMQP_URL")
loadmodule "kazoo.so"
modparam("kazoo", "node_hostname", "MY_HOSTNAME")
modparam("kazoo", "amqp_connection", "MY_AMQP_URL")
#!ifdef MY_AMQP_URL_SECONDARY
modparam("db_kazoo", "amqp_connection", "MY_AMQP_URL_SECONDARY")
modparam("kazoo", "amqp_connection", "MY_AMQP_URL_SECONDARY")
#!endif
#!ifdef MY_AMQP_URL_TERTIARY
modparam("db_kazoo", "amqp_connection", "MY_AMQP_URL_TERTIARY")
modparam("kazoo", "amqp_connection", "MY_AMQP_URL_TERTIARY")
#!endif
#!ifdef MY_AMQP_MAX_CHANNELS
modparam("db_kazoo", "amqp_max_channels", MY_AMQP_MAX_CHANNELS)
modparam("kazoo", "amqp_max_channels", MY_AMQP_MAX_CHANNELS)
#!else
modparam("db_kazoo", "amqp_max_channels", 100)
modparam("kazoo", "amqp_max_channels", 100)
#!endif
modparam("db_kazoo", "amqp_internal_loop_count", 1);
modparam("db_kazoo", "amqp_consumer_loop_count", 4);
modparam("kazoo", "amqp_internal_loop_count", 1);
modparam("kazoo", "amqp_consumer_loop_count", 4);
####### Role Configurations ##########
#!ifdef DISPATCHER-ROLE
@ -201,14 +205,14 @@ modparam("permissions", "db_mode", 1)
####### Routing Logic ########
route
{
route(SANITY_CHECK);
# log the basic info regarding this call
xlog("L_INFO", "$ci|start|recieved $oP request $rm $ou");
xlog("L_INFO", "$ci|start|recieved $pr request $rm $ou");
xlog("L_INFO", "$ci|log|source $si:$sp");
xlog("L_INFO", "$ci|log|from $fu");
xlog("L_INFO", "$ci|log|to $tu");
route(SANITY_CHECK);
route(CLASSIFY_SOURCE);
#!ifdef ANTIFLOOD-ROLE
@ -257,21 +261,21 @@ route
route[SANITY_CHECK]
{
if (!mf_process_maxfwd_header("10")) {
xlog("L_WARN", "$ci|end|too much hops, not enough barley");
send_reply("483", "Too Many Hops");
if (!sanity_check()) {
xlog("L_WARN", "$ci|end|message from $si:$sp is insane");
exit;
}
if (!sanity_check()) {
xlog("L_WARN", "$ci|end|message is insane");
if (!mf_process_maxfwd_header("10")) {
xlog("L_WARN", "$ci|end|too much hops, not enough barley from $si:$sp");
send_reply("483", "Too Many Hops");
exit;
}
if ($ua == "friendly-scanner" ||
$ua == "sundayddr" ||
$ua =~ "sipcli" ) {
xlog("L_WARN", "$ci|end|dropping message with user-agent $ua");
xlog("L_WARN", "$ci|end|dropping message with user-agent $ua from $si:$sp");
exit;
}
}
@ -298,6 +302,10 @@ route[HANDLE_OPTIONS]
route(FILTER_REQUEST_DOMAIN);
#!endif
#!ifdef NAT-TRAVERSAL-ROLE
route(NAT_TEST_AND_CORRECT);
#!endif
sl_send_reply("200", "Rawr!!");
}
exit;
@ -308,13 +316,31 @@ route[HANDLE_NOTIFY]
{
if (is_method("NOTIFY")) {
if (isflagset(FLAG_INTERNALLY_SOURCED)) {
if (registered("location")) {
lookup("location");
xlog("L_INFO", "$ci|log|routing to $ruid");
}
route(INTERNAL_TO_EXTERNAL_RELAY);
} else {
#!ifdef TRAFFIC-FILTER-ROLE
route(FILTER_REQUEST_DOMAIN);
#!endif
sl_send_reply("200", "Rawr!!");
#!ifdef WEBSOCKETS-ROLE
route(NAT_WEBSOCKETS_CORRECT);
#!endif
#!ifdef NAT-TRAVERSAL-ROLE
route(NAT_TEST_AND_CORRECT);
#!endif
if($hdr(Event) == "keep-alive") {
xlog("L_INFO", "$ci|stop|replying to keep alive");
sl_send_reply("405", "Stay Alive / Method Not Allowed");
} else {
xlog("L_INFO", "$ci|stop|consuming event $hdr(Event)");
sl_send_reply("200", "Rawr!!");
}
}
exit;
}
@ -322,20 +348,52 @@ route[HANDLE_NOTIFY]
route[HANDLE_MESSAGE]
{
#!ifdef MESSAGE-ROLE
if (is_method("MESSAGE")) {
if (isflagset(FLAG_INTERNALLY_SOURCED)) {
xlog("L_INFO", "$ci|MESSAGE from $fu to $tu");
t_on_reply("MESSAGE_REPLY");
if (isflagset(FLAG_INTERNALLY_SOURCED) || src_ip == myself) {
xlog("L_INFO", "$ci| routing MESSAGE to external from $fu to $tu");
if (registered("location")) {
lookup("location");
xlog("L_INFO", "$ci|log|routing to $ruid");
}
route(INTERNAL_TO_EXTERNAL_RELAY);
#!ifdef TRAFFIC-FILTER-ROLE
} else if (!isflagset(FLAG_TRUSTED_SOURCE)
&& $rd =~ "[0-9]{1,3}\.[0-9]{1,3}.[0-9]{1,3}\.[0-9]{1,3}") {
xlog("L_WARN", "$ci|end|dropping MESSAGE request with IP domain");
#!endif
} else {
xlog("L_WARN", "$ci|end|MESSAGE $(hdr(Content-Type))");
if( $hdr(Content-Type) == "application/im-iscomposing+xml" ) {
xlog("L_WARN", "$ci|end|dropping MESSAGE application/im-iscomposing+xml");
sl_send_reply("200", "OK");
} else {
route(DISPATCHER_FIND_ROUTES);
route(EXTERNAL_TO_INTERNAL_RELAY);
}
}
exit();
}
#!else
if (is_method("MESSAGE")) {
if (isflagset(FLAG_INTERNALLY_SOURCED)) {
route(INTERNAL_TO_EXTERNAL_RELAY);
} else {
sl_send_reply("202", "delivered to /dev/null");
exit;
exit();
}
}
#!endif
}
route[HANDLE_IN_DIALOG_REQUESTS]
{
if (has_totag()) {
if (is_method("INVITE")) {
setflag(FLAG_SESSION_PROGRESS);
record_route();
}
if (loose_route()) {
@ -522,6 +580,12 @@ onreply_route[INTERNAL_REPLY]
setflag(FLAG_SESSION_PROGRESS);
}
##### CALL-PARK ####
if (is_method("REFER") && t_check_status("(200)|(202)") ) {
$sht(park=>$(avp(refer_to_uri){uri.user})@$(avp(refer_to_uri){uri.domain})) = "sip:" + $(ct{tobody.uri}{uri.host}) + ":" + $(ct{tobody.uri}{uri.port});
xlog("L_INFO", "caching park info $(avp(refer_to_uri){uri.user})@$(avp(refer_to_uri){uri.domain}) = sip:$(ct{tobody.uri}{uri.host}):$(ct{tobody.uri}{uri.port})");
}
if ($rs < 300) {
xlog("L_INFO", "$ci|pass|$T_req($si):$T_req($sp)");
}
@ -625,7 +689,21 @@ event_route[kazoo:mod-init]
kazoo_subscribe("$var(payload)");
#!endif
#!ifdef MESSAGE-ROLE
$var(key) = "kamailio@MY_HOSTNAME";
$var(payload) = '{ "exchange" : "sms" , "type" : "topic", "queue" : "MSG-QUEUE-MY_HOSTNAME", "routing" : "message.route.' + $(var(key){kz.encode}) + '.*", "auto_delete" : 1, "durable" : 0, "no_ack" : 0, "wait_for_consumer_ack" : 1 }';
kazoo_subscribe("$var(payload)");
#!endif
#!ifdef REGISTRAR-ROLE
$var(payload) = "{ 'exchange' : 'callmgr' , 'type' : 'topic', 'queue' : 'MSG-FLUSH-MY_HOSTNAME', 'routing' : 'registration.flush.*', 'auto_delete' : 1, 'durable' : 0, 'no_ack' : 1, 'wait_for_consumer_ack' : 0 }";
kazoo_subscribe("$var(payload)");
#!endif
}
event_route[kazoo:consumer-event]


+ 13
- 5
kamailio/dispatcher-role.cfg View File

@ -1,5 +1,6 @@
######## Generic Hash Table container in shared memory ########
modparam("htable", "htable", "failover=>size=16;autoexpire=120")
modparam("htable", "htable", "park=>size=4;autoexpire=600")
####### Dispatcher module ########
loadmodule "dispatcher.so"
@ -32,11 +33,11 @@ modparam("dispatcher", "ds_ping_from", "sip:sipcheck@MY_IP_ADDRESS")
####### Dispatcher Logic ########
route[DISPATCHER_CLASSIFY_SOURCE]
{
if (ds_is_from_list("1", "1") ||
ds_is_from_list("2", "1") ||
ds_is_from_list("3", "1") ||
ds_is_from_list("10", "1") ||
ds_is_from_list("20", "1")) {
if (ds_is_from_list(1, 3) ||
ds_is_from_list(2, 3) ||
ds_is_from_list(3, 3) ||
ds_is_from_list(10, 3) ||
ds_is_from_list(20, 3)) {
xlog("L_INFO", "$ci|log|originated from internal sources");
setflag(FLAG_INTERNALLY_SOURCED);
@ -82,6 +83,13 @@ route[DISPATCHER_FIND_ROUTES]
}
}
}
##### CALL-PARK ####
if($(ru{uri.user}) =~ "\*3" && $sht(park=>$(ru{uri.user})@$(ru{uri.domain})) != $null) {
$du = $sht(park=>$(ru{uri.user})@$(ruri{uri.domain}));
$sht(park=>$(ru{uri.user})@$(ruri{uri.domain})) = $null;
xlog("L_INFO", "$ci|log|redirecting park request to $du");
return;
}
}
if (!ds_select_dst("$var(ds_group)", "0") || $(avp(ds_dst)[0]) == $null) {


+ 55
- 0
kamailio/message-role.cfg View File

@ -0,0 +1,55 @@
modparam("htable", "htable", "msg=>size=32;autoexpire=60;")
event_route[kazoo:consumer-event-message-route]
{
$var(uri_username) = "";
kazoo_json($kzE, "Endpoints[0].To-Username", "$var(uri_username)");
$var(x) = $(kzE{kz.json,Endpoints[0].To-Username});
xlog("L_INFO", "received message route for $(kzE{kz.json,Endpoints[0].To-DID})");
if( $var(uri_username) != "" ) {
$var(from_uri) = "sip:" + $(kzE{kz.json,Caller-ID-Number}) + "@" + $(kzE{kz.json,Endpoints[0].To-Realm});
$var(to_uri) = "sip:" + $(kzE{kz.json,Endpoints[0].To-Username}) + "@" + $(kzE{kz.json,Endpoints[0].To-Realm});
} else {
$var(from_uri) = "sip:" + $(kzE{kz.json,Caller-ID-Number}) + $(kzE{kz.json,Endpoints[0].To-Realm});
$var(to_uri) = $(kzE{kz.json,Endpoints[0].Route});
}
$sht(msg=>$(kzE{kz.json,Call-ID})) = $kzE;
$uac_req(method)="MESSAGE";
$uac_req(body)= $(kzE{kz.json,Body});
$uac_req(hdrs)="Content-Type: text/plain\r\n";
$uac_req(turi) = $var(to_uri);
$uac_req(ruri) = $var(to_uri);
$uac_req(furi) = $var(from_uri);
$uac_req(ouri) = "sip:MY_IP_ADDRESS:5060";
$uac_req(callid) = $(kzE{kz.json,Call-ID});
xlog("L_INFO", "sending message from $var(from_uri) to $var(to_uri) ");
uac_req_send();
}
onreply_route[MESSAGE_REPLY]
{
if( $(sht(msg=>$ci)) == $null) {
exit();
}
if($T_reply_code != 200 && $T_reply_code != 202) {
$var(Result) = "Failure";
} else {
$var(Result) = "Success";
}
$var(Payload) = '{ "Event-Category" : "message", "Event-Name" : "delivery", "Call-ID" : "' + $(sht(msg=>$ci){kz.json,Call-ID}) + '", "Message-ID" : "' + $(sht(msg=>$ci){kz.json,Message-ID}) +'" , "Delivery-Result-Code" : "sip:" + $T_reply_code + '" , "Msg-ID" : "' + $(sht(msg=>$ci){kz.json,Msg-ID}) + '" , "Status" : "' + $var(Result) + '"}';
$var(RoutingKey) = $(sht(msg=>$ci){kz.json,Server-ID});
$var(exchange) = "targeted";
if($var(RoutingKey) == "") {
$var(exchange) = "sms";
$var(RoutingKey) = "message.delivery." + $(sht(msg=>$ci){kz.json,Call-ID}{kz.encode});
}
xlog("L_INFO", "sending delivery message for $ci");
kazoo_publish($var(exchange), $var(RoutingKey), $var(Payload));
}
# vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab

+ 46
- 27
kamailio/presence-role.cfg View File

@ -1,4 +1,8 @@
######## Presence server module ########
#!trydef PRESENCE_MIN_EXPIRES 300
#!trydef PRESENCE_MIN_EXPIRES_ACTION 1
#!trydef PRESENCE_MAX_EXPIRES 3600
modparam("htable", "htable", "p=>size=32;autoexpire=600;")
loadmodule "presence.so"
@ -6,34 +10,24 @@ loadmodule "presence_dialoginfo.so"
loadmodule "presence_mwi.so"
loadmodule "presence_xml.so"
modparam("presence", "subs_db_mode", 1)
modparam("presence_dialoginfo", "force_dummy_dialog", 1)
modparam("presence_xml", "force_active", 1)
modparam("presence", "subs_db_mode", 3)
modparam("presence", "expires_offset", 60)
modparam("presence", "send_fast_notify", 0)
modparam("presence", "send_fast_notify", 1)
modparam("presence", "clean_period", 30)
modparam("presence", "publ_cache", 0)
modparam("presence", "min_expires", 0)
modparam("presence", "max_expires", 3600)
## use this
#modparam("presence", "db_url", "MY_AMQP_URL/dialoginfo")
## or this
modparam("presence", "min_expires_action", PRESENCE_MIN_EXPIRES_ACTION)
modparam("presence", "min_expires", PRESENCE_MIN_EXPIRES)
modparam("presence", "max_expires", PRESENCE_MAX_EXPIRES)
modparam("presence", "sip_uri_match", 1)
modparam("presence", "waitn_time", 1)
modparam("presence", "notifier_processes", 5)
modparam("presence", "db_url", "text:///etc/kazoo/kamailio/dbtext")
modparam("db_kazoo", "db_url", "text:///etc/kazoo/kamailio/dbtext")
modparam("db_kazoo", "pua_mode", 1)
modparam("presence_xml", "force_active", 1)
######## Presence User Agent module ########
#loadmodule "pua.so"
#modparam("pua", "db_mode", 0)
#modparam("pua", "db_url", "text:///etc/kazoo/kamailio/dbtext")
#modparam("pua", "update_period", 6)
#modparam("pua", "min_expires", 300)
#modparam("pua", "outbound_proxy", "sip:MY_IP_ADDRESS")
modparam("kazoo", "db_url", "text:///etc/kazoo/kamailio/dbtext")
modparam("kazoo", "pua_mode", 1)
####### Presence Logic ########
route[HANDLE_SUBSCRIBE]
@ -48,8 +42,33 @@ route[HANDLE_SUBSCRIBE]
exit;
}
handle_subscribe();
if ($tU == $null) {
xlog("L_INFO", "$ci|stop|ignoring subscribe with empty TO username from a $ua");
sl_send_reply(400, "Missing TO username");
t_release();
exit;
}
if ($fU == $null) {
xlog("L_INFO", "$ci|stop|ignoring subscribe with empty FROM username from a $ua");
sl_send_reply(400, "Missing FROM username");
t_release();
exit;
}
if (!handle_subscribe()) {
xlog("L_INFO", "$ci|stop|unsupported subsribe");
t_release();
exit;
}
$var(Expires) = $hdr(Expires);
if($var(Expires) < PRESENCE_MIN_EXPIRES) {
$var(Expires) = PRESENCE_MIN_EXPIRES;
} else if($var(Expires) > PRESENCE_MAX_EXPIRES) {
$var(Expires) = PRESENCE_MAX_EXPIRES;
}
##RabbitMQ
$var(fs_path) = "%3C" + $rz + "%3A" + $Ri + "%3A" + $Rp + "%3Btransport=" + $proto + "%3Blr%3Breceived=" + $si+":"+$sp+"%3E";
$var(fs_contact) = "<" + $(ct{tobody.uri}) + ";fs_path=" + $var(fs_path) + ">";
@ -57,7 +76,7 @@ route[HANDLE_SUBSCRIBE]
$var(fs_contact) = $var(fs_contact) + ";" + $(ct{tobody.params});
}
$var(amqp_payload_request) = "{'Event-Category' : 'presence', 'Event-Name' : 'subscription', 'Event-Package' : '" + $hdr(event) + "', 'Expires' : " + $hdr(Expires) + ", 'Queue' : 'BLF-MY_HOSTNAME', 'Server-ID' : 'BLF-MY_HOSTNAME' ,'Contact' : '" + $var(fs_contact) + "', 'Call-ID' : '" + $ci + "', 'From' : '" + $fu +"', 'User' : '" + $tu + "', 'User-Agent' : '" + $ua + "' }";
$var(amqp_payload_request) = '{"Event-Category" : "presence", "Event-Name" : "subscription", "Event-Package" : "$hdr(event)", "Expires" : "$var(Expires)", "Queue" : "BLF-MY_HOSTNAME", "Server-ID" : "BLF-MY_HOSTNAME" , "Contact" : "$(ct{s.escape.common})", "Call-ID" : "$ci", "From" : "$fu", "User" : "$tu", "User-Agent" : "$(ua{s.escape.common})" }';
kazoo_publish("dialoginfo_subs", "dialoginfo_subs", $var(amqp_payload_request));
@ -85,10 +104,10 @@ route[HANDLE_PUBLISH]
event_route[kazoo:consumer-event-presence-update]
{
if( $(kzE{kz.json,Event-Package}) == "dialog") {
if($sht(p=>$(kzE{kz.json,Call-ID})) != $(kzE{kz.json,State})) {
if($sht(p=>$(kzE{kz.json,Call-ID})-$(kzE{kz.json,From})) != $(kzE{kz.json,State})) {
xlog("L_INFO", "received $(kzE{kz.json,Event-Package}) update for $(kzE{kz.json,From})");
xlog("L_INFO", "payload $kzE");
$sht(p=>$(kzE{kz.json,Call-ID})) = $(kzE{kz.json,State});
$sht(p=>$(kzE{kz.json,Call-ID})-$(kzE{kz.json,From})) = $(kzE{kz.json,State});
kazoo_pua_publish($kzE);
pres_refresh_watchers("$(kzE{kz.json,From})", "$(kzE{kz.json,Event-Package})", 1);
} else {


+ 26
- 6
kamailio/registrar-role.cfg View File

@ -11,10 +11,17 @@ loadmodule "auth.so"
####### User Location Implementation module ##########
loadmodule "usrloc.so"
modparam("usrloc", "db_mode", 0)
modparam("usrloc", "db_update_as_insert", 1)
modparam("usrloc", "db_update_as_insert", 0)
modparam("usrloc", "use_domain", 1)
modparam("usrloc", "nat_bflag", FLB_NATB)
modparam("usrloc", "db_url", "text:///etc/kazoo/kamailio/dbtext")
modparam("usrloc", "db_mode", 0)
modparam("usrloc", "handle_lost_tcp", 1)
modparam("usrloc", "xavp_contact", "ulattrs")
modparam("usrloc", "db_check_update", 1)
modparam("usrloc", "timer_interval", 30)
modparam("usrloc", "timer_procs", 1)
######## NAT Traversal module - signaling functions ########
#!ifdef NAT-TRAVERSAL-ROLE
@ -110,7 +117,7 @@ route[ATTEMPT_AUTHORIZATION]
if(@contact.expires) {
$var(expires) = @contact.expires;
} else {
if($hdr(Expires)) {
if(is_present_hf("Expires")) {
$var(expires) = $hdr(Expires);
} else {
$var(expires) = REGISTRAR_MIN_EXPIRES;
@ -120,15 +127,28 @@ route[ATTEMPT_AUTHORIZATION]
if($var(expires) == 0) {
xlog("L_INFO", "$ci|end|unregister request from $Au $si:$sp");
exit;
} else if($var(expires) < REGISTRAR_MIN_EXPIRES) {
$var(expires) = REGISTRAR_MIN_EXPIRES;
} else if($var(expires) > REGISTRAR_MAX_EXPIRES) {
$var(expires) = REGISTRAR_MAX_EXPIRES;
}
## Fix for wss websockets.
## RFC 7118 says transport MUST be "ws" not "wss"
## http://tools.ietf.org/html/rfc7118#section-5.2
if ($(proto{s.tolower}) == 'wss') {
$var(transport) = "ws";
} else {
$var(transport) = $(proto{s.tolower});
}
if($(proto{s.tolower}) == "udp" || $(proto{s.tolower}) == "tcp" || $(proto{s.tolower}) == "tls") {
if($var(transport) == "udp" ||$var(transport) == "tcp" || $var(transport) == "tls") {
$var(return_port) = $Rp;
} else {
$var(return_port) = "5060";
}
$var(params) = "fs_path=<sip:MY_IP_ADDRESS:" + $var(return_port) + ";lr;received='" + $rz + ":" + $si + ":" + $sp + ";transport=" + $proto + "'>";
$var(params) = "fs_path=<sip:" + $Ri + ":" + $var(return_port) + ";lr;received='" + $rz + ":" + $si + ":" + $sp + ";transport=" + $var(transport) + "'>";
## TODO: fix escaping, some phones send us -- reg-id=1;+sip.instance="urn:uuid:9b8bd513-0e6e-4660-ad5e-5e35d88cc68f";
## and if we can store it but not use it because it looses the escapes (that weren't there...)
@ -139,7 +159,7 @@ route[ATTEMPT_AUTHORIZATION]
if ($avp(AVP_RECV_PARAM) == $null) {
$var(fs_contact) = "<" + $(ct{tobody.uri}) + ";" + $var(params) + ">";
} else {
$var(fs_contact) = "<sip:" + $(ct{tobody.user}) + "@" + $si + ":" + $sp + ";transport=" + $proto + ";" + $var(params) + ">";
$var(fs_contact) = "<sip:" + $(ct{tobody.user}) + "@" + $si + ":" + $sp + ";transport=" + $var(transport) + ";" + $var(params) + ">";
}
$var(register_contants) = ' "Presence-Hosts" : "n/a", "Profile-Name" : "sipinterface_1", "Status" : "Registered", "Event-Timestamp" : "' + $TS + '", "Expires" : ' + $var(expires);


+ 3
- 0
vm.args View File

@ -15,3 +15,6 @@
# Comment this line out if you want the Erlang shell
+Bd
# Treat error_logger:warning_msg/2 as warnings instead of errors (default)
+W w

Loading…
Cancel
Save