[SR-Users] Ringing Timeout

2021-08-09 Thread Edward Romanenco
Hey all,

I'm trying to find the best way for settings a timeout for the 'ringing' stage 
of a call - meaning - I would like to wait for 20 seconds between receiving 
status 180 / 183 / early media from the remote end and 200, if I fail to 
receive the expected response in this timeframe - call should be dropped. Most 
of the documented timeouts I saw count between the first invite to any of the 
aforementioned stages - but I'm actually looking for the opposite.

Edward

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Kamailio + RTPEngine - Destinations Behind NAT

2021-06-30 Thread Edward Romanenco
Hi everyone,

I'm using Kamailio (Ver 5.5.1, Public IP X.X.X.11, Private IP 172.18.0.20) + 
RTPEngine (Ver 9.4.1.1, Public IP X.X.X.7, Private IP 172.18.0.50) alongside 
Freeswitch (Private IP 172.18.0.40) in my backend and delivering calls to a 
mobile application (call flow is Freeswitch -> Kamailio + RTPEngine -> 
Applicaiton). While calls made to NATted destination generally works fine - 
from time to time, we've experiencing one-sided audio due to the rtpengine 
sending the media stream to the remote end's private IP instead of his public 
one. For instance, in the attached logs - media was sent towards 192.168.1.93 
instead of 79.179.1.2, which is the expected destination. Problem appears 
almost randomly; I can make 20 fine calls in a row for the same destination 
until experiencing it, and I didn't find any difference as it comes to the SIP 
invite exchange between the two. Has anyone ever experienced the same behavior 
and can share some general instructions on how to troubleshoot it?

Relevant Kamailio config section is attached.

Invite Kamailio->Device

INVITE sip:972587102881@79.179.1.2:56308;transport=TLS;ob SIP/2.0
Record-Route: 
Record-Route: 
Via: SIP/2.0/TLS 
X.X.X.11:443;branch=z9hG4bK24bf.52b1dd68e26010ba103bd8d6fdb53cf4.0
Via: SIP/2.0/UDP 
172.18.0.40;received=172.18.0.40;rport=5060;branch=z9hG4bKH234Q58HpHNKK
Max-Forwards: 66
From: "972522149596" ;tag=cvcHy5UcS9pjj
To: 
Call-ID: be55bd1e-537d-123a-65a9-0242ac120028
CSeq: 37932220 INVITE
Contact: 

User-Agent: 
FreeSWITCH-mod_sofia/1.10.6-release+git~20210325T131609Z~1ff9d0a60e~64bit
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, 
REFER, NOTIFY
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 567
X-SESSION-ID: 721533765
X-INCOMING: PSTN
X-from-freeswitch: +972522149596
X-FS-Support: update_display,send_info
Remote-Party-ID: "972522149596" 
;party=calling;screen=yes;privacy=off

v=0
o=FreeSWITCH 1624937621 1624937622 IN IP4 X.X.X.7
s=FreeSWITCH
c=IN IP4 X.X.X.7
t=0 0
m=audio 30018 RTP/AVP 102 101
a=rtpmap:102 opus/48000/2
a=fmtp:102 useinbandfec=1; maxaveragebitrate=3; maxplaybackrate=48000; 
ptime=20; minptime=10; maxptime=40
a=rtpmap:101 telephone-event/48000
a=fmtp:101 0-16
a=sendrecv
a=rtcp:30019
a=ptime:20
a=ice-ufrag:bKPZt0dW
a=ice-pwd:H4qyL7mPUOvoiAjosiLasXAdzj
a=candidate:41sXGEsTafxHi8ms 1 UDP 2130706431 X.X.X.7 30018 typ host
a=candidate:41sXGEsTafxHi8ms 2 UDP 2130706430 X.X.X.7 30019 typ host

Response Device->Kamailio

SIP/2.0 200 OK
Via: SIP/2.0/TLS 
X.X.X.11:443;received=X.X.X.11;branch=z9hG4bK24bf.52b1dd68e26010ba103bd8d6fdb53cf4.0
Via: SIP/2.0/UDP 
172.18.0.40;rport=5060;received=172.18.0.40;branch=z9hG4bKH234Q58HpHNKK
Record-Route: 
Record-Route: 
Call-ID: be55bd1e-537d-123a-65a9-0242ac120028
From: "972522149596" ;tag=cvcHy5UcS9pjj
To: ;tag=5f75877e-58c2-44f3-a5b3-43f8786c42a1
CSeq: 37932220 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, 
MESSAGE, OPTIONS
Contact: 
Supported: replaces, 100rel, timer, norefersub
Content-Type: application/sdp
Content-Length:   348

v=0
o=- 3833960833 3833960834 IN IP4 192.168.1.93
s=pjmedia
b=AS:117
t=0 0
a=X-nat:0
m=audio 4002 RTP/AVP 96 120
c=IN IP4 192.168.1.93
b=TIAS:96000
a=rtcp:4003 IN IP4 192.168.1.93
a=sendrecv
a=rtpmap:96 opus/48000/2
a=fmtp:96 useinbandfec=1
a=rtpmap:120 telephone-event/48000
a=fmtp:120 0-16
a=ssrc:816694098 cname:72cdb5f53fc2e8fb

Kamailio NAT Detect/Manage Routes


# Caller NAT detection

route[NATDETECT] {
#!ifdef WITH_NAT
xinfo("NATDETECT: Adding the rport parameter to the first Via header of the 
received message\n");
   force_rport();
   xinfo("NATDETECT: Trying to guess if client's request originated behind a 
nat. Testing 19.\n");
   if (nat_uac_test("19")) {
  if (is_method("REGISTER")) {
  xinfo("NATDETECT: REGISTER request. Creating a URI consisting of the 
source IP, port, and protocol and storing the URI in an 
Attribute-Value-Pair.\n");
 fix_nated_register();
  } else {
 if(is_first_hop()) {
 xinfo("NATDETECT: Adding an ;alias=ip~port~transport parameter to 
the contact URI containing the received ip, port, and transport protocol.\n");
set_contact_alias();
 }
  }
   xinfo("NATDETECT: Setting flag FLT_NATS.\n");
  setflag(FLT_NATS);
   } else {
   xinfo("NATDETECT: Didn't detect natted request by any of the given 
heuristics\n");
   }
#!endif
   return;
}

# RTPProxy control and signaling updates for NAT traversal
route[NATMANAGE] {
#!ifdef WITH_NAT
   if (is_request()) {
  if(has_totag()) {
 if(check_route_param("nat=yes")) {
xinfo("NATMANAGE: This is a request with to-tag that has 'nat=yes', 
setting branch flag FLB_NATB.\n");
setbflag(FLB_NATB);
 }
  }
   }

   if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB))) {
   xinfo("NATMANAGE: No NAT

[SR-Users] Kamailio + RTPEngine - Destinations Behind NAT

2021-06-30 Thread Edward Romanenco
Hi everyone,

I'm using Kamailio (Ver 5.5.1, Public IP X.X.X.11, Private IP 172.18.0.20) + 
RTPEngine (Ver 9.4.1.1, Public IP X.X.X.7, Private IP 172.18.0.50) alongside 
Freeswitch (Private IP 172.18.0.40) in my backend and delivering calls to a 
mobile application (call flow is Freeswitch -> Kamailio + RTPEngine -> 
Applicaiton). While calls made to NATted destination generally works fine - 
from time to time, we've experiencing one-sided audio due to the rtpengine 
sending the media stream to the remote end's private IP instead of his public 
one. For instance, in the attached logs - media was sent towards 192.168.1.93 
instead of 79.179.1.2, which is the expected destination. Problem appears 
almost randomly; I can make 20 fine calls in a row for the same destination 
until experiencing it, and I didn't find any difference as it comes to the SIP 
invite exchange between the two. Has anyone ever experienced the same behavior 
and can share some general instructions on how to troubleshoot it?

Relevant Kamailio config section is attached.

Invite Kamailio->Device

INVITE sip:972587102881@79.179.1.2:56308;transport=TLS;ob SIP/2.0
Record-Route: 
Record-Route: 
Via: SIP/2.0/TLS 
X.X.X.11:443;branch=z9hG4bK24bf.52b1dd68e26010ba103bd8d6fdb53cf4.0
Via: SIP/2.0/UDP 
172.18.0.40;received=172.18.0.40;rport=5060;branch=z9hG4bKH234Q58HpHNKK
Max-Forwards: 66
From: "972522149596" ;tag=cvcHy5UcS9pjj
To: 
Call-ID: be55bd1e-537d-123a-65a9-0242ac120028
CSeq: 37932220 INVITE
Contact: 

User-Agent: 
FreeSWITCH-mod_sofia/1.10.6-release+git~20210325T131609Z~1ff9d0a60e~64bit
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, 
REFER, NOTIFY
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 567
X-SESSION-ID: 721533765
X-INCOMING: PSTN
X-from-freeswitch: +972522149596
X-FS-Support: update_display,send_info
Remote-Party-ID: "972522149596" 
;party=calling;screen=yes;privacy=off

v=0
o=FreeSWITCH 1624937621 1624937622 IN IP4 X.X.X.7
s=FreeSWITCH
c=IN IP4 X.X.X.7
t=0 0
m=audio 30018 RTP/AVP 102 101
a=rtpmap:102 opus/48000/2
a=fmtp:102 useinbandfec=1; maxaveragebitrate=3; maxplaybackrate=48000; 
ptime=20; minptime=10; maxptime=40
a=rtpmap:101 telephone-event/48000
a=fmtp:101 0-16
a=sendrecv
a=rtcp:30019
a=ptime:20
a=ice-ufrag:bKPZt0dW
a=ice-pwd:H4qyL7mPUOvoiAjosiLasXAdzj
a=candidate:41sXGEsTafxHi8ms 1 UDP 2130706431 X.X.X.7 30018 typ host
a=candidate:41sXGEsTafxHi8ms 2 UDP 2130706430 X.X.X.7 30019 typ host

Response Device->Kamailio

SIP/2.0 200 OK
Via: SIP/2.0/TLS 
X.X.X.11:443;received=X.X.X.11;branch=z9hG4bK24bf.52b1dd68e26010ba103bd8d6fdb53cf4.0
Via: SIP/2.0/UDP 
172.18.0.40;rport=5060;received=172.18.0.40;branch=z9hG4bKH234Q58HpHNKK
Record-Route: 
Record-Route: 
Call-ID: be55bd1e-537d-123a-65a9-0242ac120028
From: "972522149596" ;tag=cvcHy5UcS9pjj
To: ;tag=5f75877e-58c2-44f3-a5b3-43f8786c42a1
CSeq: 37932220 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, 
MESSAGE, OPTIONS
Contact: 
Supported: replaces, 100rel, timer, norefersub
Content-Type: application/sdp
Content-Length:   348

v=0
o=- 3833960833 3833960834 IN IP4 192.168.1.93
s=pjmedia
b=AS:117
t=0 0
a=X-nat:0
m=audio 4002 RTP/AVP 96 120
c=IN IP4 192.168.1.93
b=TIAS:96000
a=rtcp:4003 IN IP4 192.168.1.93
a=sendrecv
a=rtpmap:96 opus/48000/2
a=fmtp:96 useinbandfec=1
a=rtpmap:120 telephone-event/48000
a=fmtp:120 0-16
a=ssrc:816694098 cname:72cdb5f53fc2e8fb

Kamailio NAT Detect/Manage Routes


# Caller NAT detection

route[NATDETECT] {
#!ifdef WITH_NAT
xinfo("NATDETECT: Adding the rport parameter to the first Via header of the 
received message\n");
   force_rport();
   xinfo("NATDETECT: Trying to guess if client's request originated behind a 
nat. Testing 19.\n");
   if (nat_uac_test("19")) {
  if (is_method("REGISTER")) {
  xinfo("NATDETECT: REGISTER request. Creating a URI consisting of the 
source IP, port, and protocol and storing the URI in an 
Attribute-Value-Pair.\n");
 fix_nated_register();
  } else {
 if(is_first_hop()) {
 xinfo("NATDETECT: Adding an ;alias=ip~port~transport parameter to 
the contact URI containing the received ip, port, and transport protocol.\n");
set_contact_alias();
 }
  }
   xinfo("NATDETECT: Setting flag FLT_NATS.\n");
  setflag(FLT_NATS);
   } else {
   xinfo("NATDETECT: Didn't detect natted request by any of the given 
heuristics\n");
   }
#!endif
   return;
}

# RTPProxy control and signaling updates for NAT traversal
route[NATMANAGE] {
#!ifdef WITH_NAT
   if (is_request()) {
  if(has_totag()) {
 if(check_route_param("nat=yes")) {
xinfo("NATMANAGE: This is a request with to-tag that has 'nat=yes', 
setting branch flag FLB_NATB.\n");
setbflag(FLB_NATB);
 }
  }
   }

   if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB))) {
   xinfo("NATMANAGE: No NAT

Re: [SR-Users] Manipulating SDP IP for Inbound Calls

2020-08-04 Thread Edward Romanenco
I moved in to an ONREPLAY route and it seems to be working well with the 
mangler.

Thank you all.

Edward

From: Daniel-Constantin Mierla 
Sent: Tuesday, August 4, 2020 12:05 PM
To: Edward Romanenco ; Kamailio (SER) - Users Mailing 
List 
Subject: Re: [SR-Users] Manipulating SDP IP for Inbound Calls


Hello,


hard to track the execution path without a test environment ... I would suggest 
to load debugger module and enable cfgtrace for it to see what actions in 
configuration file are executed, to be sure it gets to the fix_nated_sdp().


Cheers,
Daniel


On 04.08.20 10:44, Edward Romanenco wrote:
I tried using nathelper in the following way -  
fix_nated_sdp("2","XX.XX.XX.XX"); - it still shows my internal IP.
Attaching my request routes, can you kindly check and see if I am using it 
correctly?

SDP
.
v=0.
o=FreeSWITCH 1596486133 1596486134 IN IP4 172.18.0.40.
s=FreeSWITCH.
c=IN IP4 172.18.0.40.
t=0 0.
m=audio 43954 RTP/AVP 8 101.
a=rtpmap:8 PCMA/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=ptime:20.


REQUEST ROUTES
request_route {
setflag(22);
route(REQINIT);

if (is_method("CANCEL")) {
if (t_check_trans()) {
route(RELAY);
}
exit;
}

route(WITHINDLG);

if(t_precheck_trans()) {
t_check_trans();
exit;
}
t_check_trans();

remove_hf("Route");
if (is_method("INVITE|SUBSCRIBE")){// && is_present_hf("X-SESSION-ID")){
  record_route();
}
if (is_method("INVITE")) {
setflag(FLT_ACC);
}

if ($rU==$null) {
sl_send_reply("484","Address Incomplete");
exit;
}

route(OUTGOING);
route(PSTN);
route(INCOMING);
route(RELAY);
}

route[REMOVE_X_HEADERS] {
if(is_present_hf("X-SESSION-ID")) {
remove_hf("X-FS-Support");
   remove_hf("X-Src");
   remove_hf("X-DESTINATIONS");
   remove_hf("X-SESSION-ID");
}
xinfo("Remove X Headers; Contact Header is $ct");
}

route[INCOMING] {
if(is_present_hf("X-SESSION-ID")) {
  return;
}

if(ds_is_from_list("4")) {
route(TRANSLATE_SRC_IN);
}

route(REQUEST_PERMISSIONS);
fix_nated_sdp("2","XX.XX.XX.XX");
exit;
}

route[REQUEST_PERMISSIONS] {
$var(body) = 0;
$var(from) = $fU;

if($(var(from){s.substr,1,4})=="0972") {
$var(from)=$(var(from){s.substr,2,0});
$fU = $var(from);
}

jansson_set("string", "from", "$var(from)", "$var(body)");

if(is_present_hf("Diversion")) {
xlog("L_INFO", "Call has been forwarded.");
jansson_set("string","to","$oU","$var(body)");
} else {
   jansson_set("string","to","$tU","$var(body)");
}

jansson_set("string","forcepstn","false","$var(body)");
jansson_set("string", "source", "EGRESS", "$var(body)");
$http_req(all) = $null;
$http_req(method) = "POST";
$http_req(hdr) = "Content-Type: application/json";
$http_req(hdr) = "Accept: application/json";
$http_req(hdr) = "Connection: keep-alive";
$http_req(body) = $var(body);
$var(re_url)= 
"https://VNVHOST/voiceandvideo/makeCall";<https://VNVHOST/voiceandvideo/makeCall>;
t_newtran();

if (http_async_query("$var(re_url)", "REQUEST_PERMISSIONS_REPLY") < 0) {
t_reply("500", "Server Internal Error");
exit;
}
}

route[REQUEST_PERMISSIONS_REPLY] {
if ($(http_err{s.len})) {
xlog("L_ERR","Got error from server 1");
   t_reply("500", "Server Internal Error");
exit;
} else if ($http_rs != 200) {
xlog("L_ERR","Got error from server 2");
t_reply("500", "Server Error");
exit;
}

# Populate dialog variables for CDR Creation
$var(count) = 0;
jansson_get("list",$http_rb,"$dlg_var(destinations_array)");
jansson_get("msgID", $http_rb, "$dlg_var(session_id)");
jansson_get("resultCode",$http_rb,"$dlg_var(resultCode)");

if($dlg_var(resultCode)!=0) {
t_reply("500","Server Internal Error");
exit;
}

## EGRESS Server Information
route(ADD_TELEMESSAGE_HDRS);
$var(setid) = "1";

if(!ds_select_dst("1", "4")) {
send_reply("404", "No destination");
exit;
}

route(RELAY);
exit;
}

route[RELAY] {
if (is_method(&q

Re: [SR-Users] Manipulating SDP IP for Inbound Calls

2020-08-04 Thread Edward Romanenco
return;
}
if(is_method("INVITE")) {
if($avp(oexten)==$null) return;

$ru = "sip:" + $avp(oexten) + "@" + $sel(cfg_get.voicemail.srv_ip)
+ ":" + $sel(cfg_get.voicemail.srv_port);
} else {
if($rU==$null) return;

$ru = "sip:" + $rU + "@" + $sel(cfg_get.voicemail.srv_ip)
+ ":" + $sel(cfg_get.voicemail.srv_port);
}
route(RELAY);
exit;
#!endif

return;
}

//convert phone number from international to internal
//+972112223344 <-> 011222334
route[TRANSLATE_DST_OUT] {
xinfo("__META TRANSLATE_DST_OUT");
xdbg("__META To: $hdr(To)");
xdbg("__META Regexp: NUM_TRANSLATE_OUT_RE");

if(subst_uri("/NUM_TRANSLATE_OUT_RE/0\2/"))
xdbg("__META URI translated");
else
xdbg("__META Not translating number in URI");

if(subst_hf("To", "/NUM_TRANSLATE_OUT_RE/0\2/", "a"))
xdbg("__META To header translated");
else
xdbg("__META Not translating number in to header");
}

//convert phone number from internal format to international
//011222334 <-> +<972>112223344
route[TRANSLATE_SRC_IN] {
$var(number)=$rU;
if($(var(number){s.substr,1,4})=="+972") {
 $rU="0"+$(var(number){s.substr,5,0});
}
}
/////

# Manage outgoing branches
branch_route[MANAGE_BRANCH] {
xdbg("new branch [$T_branch_idx] to $ru\n");
route(NATMANAGE);
}

# Manage incoming replies
onreply_route[MANAGE_REPLY] {
xdbg("incoming reply\n");

// fix_nated_contact();
xlog("L_ERR","2020202020202 Got reply $ct");

if(status=~"[12][0-9][0-9]") {
route(NATMANAGE);
}

if(is_method("INVITE") && is_present_hf("P-Asserted-Identity")) {
remove_hf("P-Asserted-Identity");
}
}

# Manage failure routing cases
failure_route[MANAGE_FAILURE] {
xlog("Failure! Going to failure route.");
route(NATMANAGE);
if (t_is_canceled()) exit;

#!ifdef WITH_BLOCK3XX
# block call redirect based on 3xx replies.
if (t_check_status("3[0-9][0-9]")) {
t_reply("404","Not found");
exit;
}
#!endif

#!ifdef WITH_BLOCK401407
# block call redirect based on 401, 407 replies.
if (t_check_status("401|407")) {
t_reply("404","Not found");
exit;
}
#!endif

#!ifdef WITH_VOICEMAIL
# serial forking
# - route to voicemail on busy or no answer (timeout)
if (t_check_status("486|408")) {
$du = $null;
route(TOVOICEMAIL);
exit;
}
#!endif
}

event_route[topoh:msg-outgoing] {
  if($sndto(ip)=="freeswitch") {
drop;
  }
  if($sndto(ip)=="81.24.193.248") {
drop;
  }
}

Edward

From: Daniel-Constantin Mierla 
Sent: Tuesday, August 4, 2020 11:19 AM
To: Kamailio (SER) - Users Mailing List ; Edward 
Romanenco 
Subject: Re: [SR-Users] Manipulating SDP IP for Inbound Calls


Hello,

the mangler module does not have any idea of inbound/outbound directions, so 
you can use it for any of them.


Also, the nathelper module should have a function allowing to change the ip in 
the sdp, iirc.


On the other hand, if you use rtppengine for the calls, then the ips should be 
replaced by it.


Do not forget to use msg_apply_changes() in case you want those changes to be 
visible immediately in the configuration file.


Cheers,
Daniel


On 29.07.20 13:18, Edward Romanenco wrote:
Hey guys,

I am working on a project involving Kamailio dockerezation, which is meant to 
run alongside Freeswitch and RTPEngine containers, on the basis of a 
Docker-Compose file which is launched on top of a CentOS 7.7 host system.

Anyway, I would love to know if there is any way to manipulate / mask the IP 
addresses that are being appended to a status 183 response for an incoming 
invite.

For some reason which I am trying to figure out in parallel, Freeswitch uses 
the local network bridge subnet instead of the defined external RTP IPs, and I 
was wondering - Can I manipulate them using Kamailio? I know that Mangler 
module can do it for outbound calls, but can I do the same for inbound?

v=0.
o=FreeSWITCH 1595974788 1595974789 IN IP4 172.18.0.40.
s=FreeSWITCH.
c=IN IP4 172.18.0.40.
t=0 0.
m=audio 45878 RTP/AVP 8 101.
a=rtpmap:8 PCMA/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16

Edward



___
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


--
Daniel-Constantin Mierla -- www.asipto.com<http://www.asipto.com>
www.twitter.com/miconda<http://www.twitter.com/miconda> -- 
www.linkedin.com/in/miconda<http://www.linkedin.com/in/miconda>
Funding: https://www.paypal.me/dcmierla
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Manipulating SDP IP for Inbound Calls

2020-08-01 Thread Edward Romanenco
Hey guys,



I am working on a project involving Kamailio dockerezation, which is meant to 
run alongside Freeswitch and RTPEngine containers, on the basis of a 
Docker-Compose file which is launched on top of a CentOS 7.7 host system.



Anyway, I would love to know if there is any way to manipulate / mask the IP 
addresses that are being appended to a status 183 response for an incoming 
invite.



For some reason which I am trying to figure out in parallel, Freeswitch uses 
the local network bridge subnet instead of the defined external RTP IPs, and I 
was wondering - Can I manipulate them using Kamailio? I know that Mangler 
module can do it for outbound calls, but can I do the same for inbound?



v=0.

o=FreeSWITCH 1595974788 1595974789 IN IP4 172.18.0.40.

s=FreeSWITCH.

c=IN IP4 172.18.0.40.

t=0 0.

m=audio 45878 RTP/AVP 8 101.

a=rtpmap:8 PCMA/8000.

a=rtpmap:101 telephone-event/8000.

a=fmtp:101 0-16



Edward


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Manipulating SDP IP for Inbound Calls

2020-07-30 Thread Edward Romanenco
Hey guys,

I am working on a project involving Kamailio dockerezation, which is meant to 
run alongside Freeswitch and RTPEngine containers, on the basis of a 
Docker-Compose file which is launched on top of a CentOS 7.7 host system.

Anyway, I would love to know if there is any way to manipulate / mask the IP 
addresses that are being appended to a status 183 response for an incoming 
invite.

For some reason which I am trying to figure out in parallel, Freeswitch uses 
the local network bridge subnet instead of the defined external RTP IPs, and I 
was wondering - Can I manipulate them using Kamailio? I know that Mangler 
module can do it for outbound calls, but can I do the same for inbound?

v=0.
o=FreeSWITCH 1595974788 1595974789 IN IP4 172.18.0.40.
s=FreeSWITCH.
c=IN IP4 172.18.0.40.
t=0 0.
m=audio 45878 RTP/AVP 8 101.
a=rtpmap:8 PCMA/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16

Edward
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Kamailio Dockerization

2020-07-27 Thread Edward Romanenco
Hi,

I am working on a project involving Kamailio dockerezation, which is meant to 
run alongside Freeswitch and RTPEngine containers, on the basis of a 
Docker-Compose file which is launched on top of a CentOS 7.7 host system.
I was able to create and run the containers successfully, they are starting and 
listening to the correct ports, but for some unexplained reason - the incoming 
SIP traffic is not getting picked up by Kamailio. I can easily trace the 
traffic from the host, but when SSHing the container and running a test from 
within, no traffic goes by.
I've used netcat to generate plain UDP traffic to the container, and it was 
logged into the Kamailio log files, but real-life traffic doesn't seem to work.
I've tried moving to host mode (from bridge), but it didn't make any 
difference. All required firewall rules were opened obviously, I've also tried 
shutting the firewall off completely but it didn't help.

Does anyone experienced anything similar while running Kamailio in Dockers, and 
could provide me a go-through on what steps did he take to fix it?

EXCERPT FROM MY DOCKERFILE

# Getting Kamailio source code from GIT
RUN mkdir -p /usr/local/src/kamailio-5.3
WORKDIR /usr/local/src/kamailio-5.3
RUN git clone --depth 1 --no-single-branch https://github.com/kamailio/kamailio
WORKDIR /usr/local/src/kamailio-5.3/kamailio
RUN git checkout -b 5.3.2

# Compile the source code and install Kamailio
RUN make include_modules="phonenum db_mysql xmlrpc http_async_client jansson 
auth_db nathelper websocket tls outbound topoh http_client" cfg && \
make all && make install

# Default setting is to run Kamailio as user “kamailio” and group “kamailio”
RUN adduser --quiet --system --group --disabled-password \
--shell /bin/false --gecos "Kamailio" \
--home /var/run/kamailio kamailio

# To use init.d script for starting/stopping the Kamailio server
COPY Init/kamailio /etc/init.d/
RUN chmod 755 /etc/init.d/kamailio
COPY Default/kamailio /etc/default/
COPY kamailio.service /etc/systemd/system/
RUN mkdir -p /var/run/kamailio
RUN chown kamailio:kamailio /var/run/kamailio

COMPOSE (BRIDGE NETWORK VERSION)

kamailioegress:
  build: kamailio_egress
  image: kamailioegress:latest
  container_name: kamailioegress
  restart: always
  environment:
- DATABASE=kamailioe
- SIP_DOMAIN=XXX
- DBHOST=kamailiodb
- DBROOTUSER=root
- DBROOTPASS=XXX
- PUBLIC_IPV4=XXX
  depends_on:
- Kamailio-Base
- kmdb
- freeswitch
- rtpengine
  expose:
- "5060/udp"
- "5060/tcp"
  ports:
- "XXX:5060:5060/udp"
  networks:
private-net:
  ipv4_address: "172.18.0.30"
  deploy:
mode: replicated
replicas: 1
restart_policy:
  condition: always
  delay: 5s
  max_attempts: 3
  window: 120s

networks:
  private-net:
driver: bridge
ipam:
  config:
- subnet: 172.18.0.0/16
driver_opts:
  com.docker.network.bridge.name: wrtcpriv
  public-net:
external:
  name: host

​COMPOSE (HOST MODE VERSION)

kamailioegress:
  build: kamailio_egress
  image: kamailioegress:latest
  container_name: kamailioegress
  network_mode: host
  restart: always
  environment:
- DATABASE=kamailioe
- SIP_DOMAIN=XXX
- DBHOST=172.18.0.10
- DBROOTUSER=root
- DBROOTPASS=XXX
- PUBLIC_IPV4=XXX
- EGPORT=5060
- LINTE=ens224
- LINTI=ens192
- RTPENGINE=localhost
  depends_on:
- Kamailio-Base
- kmdb
- freeswitch
- rtpengine
  expose:
- "5060/udp"
  ports:
- "213.8.76.13:5060:5060/udp"
  deploy:
mode: replicated
replicas: 1
restart_policy:
  condition: always
  delay: 5s
  max_attempts: 3
  window: 120s

CONFIG FILE

/* uncomment and configure the following line if you want Kamailio to
 * bind on a specific interface/port/proto (default bind on all available) */
listen=udp:0.0.0.0:LPORT advertise PUBLIC_IP:LPORT

KAMAILIO-LOCALE

#!define DBURL "mysql://root:XXX@DBHOST/kamailioe"
#!substdef "!MY_DBURL!mysql://root:XXX@DBHOST/kamailioe!g"
#!substdef "!RTPENGINE!MY_RTPENGINE!g"
#!substdef "!SIP_DOMAIN!MY_SIP_DOMAIN!g"
#!substdef "!PUBLIC_IP!MY_PUBLIC_IP!g"
#!substdef "!PRIVATE_IP!MY_PRIVATE_IP!g"
#!substdef "!LPORT!MY_LPORT!g"
#!substdef "!LINT!MY_LINT!g"
#!substdef "!HOMER_IP!10.1.0.100!g"
#!substdef "!API_URL!http://localhost:3000/v1/mock!g";
#!substdef "/CCODES/972|380/"
#!substdef "/NUM_TRANSLATE_OUT_RE/+?(CCODES)([0-9]+)/"
#!substdef "/NUM_TRANSLATE_IN_RE/0([0-9]+)/"

​FIREWALL RULES

-bash-4.2# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens192 ens224
  sources: 192.168.1.39
  services: dhcpv6-client http https sip ssh
  ports: 9323/tcp 9323/udp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:
rule family="ipv4" destination address="XXX" port port="5060" 
protocol="udp" accept
rule family="ipv4" destination address="XXX" port port="5060" 
protocol="

Re: [SR-Users] Digest authentication w/ Kamailio & Freeswitch

2020-05-12 Thread Edward Romanenco
In my topology, Kamailio is the one making contact with a remote VOIP company, 
meaning, as it comes for my scope – Kamailio acts as the gateway.

I also have the dialog module loaded.

[cid:image001.png@01D627AB.1FEFD2F0]

Does it change your answer in any way?

Also, if I choose to authenticate with Freeswitch, do you have any idea how to 
choose the username/password by the realm? I'm using a singular 'gateway' 
settings that goes straight to Kamailio, but I may want to have multiple sets 
of username/password for different providers.

Edward

From: Daniel-Constantin Mierla<mailto:mico...@gmail.com>
Sent: Monday, 11 May 2020 14:33
To: Kamailio (SER) - Users Mailing List<mailto:sr-users@lists.kamailio.org>; 
Edward Romanenco<mailto:edw...@telemessage.com>
Subject: Re: [SR-Users] Digest authentication w/ Kamailio & Freeswitch


Hello,





if you have this topology:



[freeswitch] > [kamailio] > [gateway]



and the gateway is sending back 407, the I would still use freeswitch to do the 
authentication, otherwise you need dialog module in kamailio to track cseq 
changes. FreeSwitch originates the call and then can increase the cseq as it 
needs. If the gateway is a proxy (e.g., another Kamailio), then cseq increase 
is not needed and you can just do it with uac module without dialog module.



Regarding your question of adding the Proxy-Authorization header in the first 
INVITE, that can work sometimes if you know the nonce the gateway is going to 
use, which can be the case of caching the nonce when receiving the 407 first 
time and reusing it later. However, the nonce typically is invalidated after a 
while (or even on first usage), so reusing it is not going to work always. 
Which is for good reasons, otherwise there can be reply-attacks.



Cheers,
Daniel


On 10.05.20 18:53, Edward Romanenco wrote:
Hi!

I've using a SIP setup that includes both Kamailio & Freeswitch, invites are 
passed from Freeswitch and relayed by Kamailio to various dispatchers, I would 
like to have Kamailio authenticating when Proxy Authentication is required.

As I understood, this can be achieved with the help of a failure route, problem 
is, when I'm utilizing this method - the 407 response gets reverted back to 
Freeswitch, which returns the revised invite filled with the default Freeswitch 
username/password, how can let Kamailio handle the authentication once 
receiving the 407? Can I work straight without relying on a failure route, but 
having the Proxy Authentication header on my original invite?

This is my relevant configuration -
route[RELAY] {
if (is_method("INVITE|BYE|SUBSCRIBE|UPDATE")) {
if(!t_is_set("branch_route")) {
t_on_branch("MANAGE_BRANCH");
 }
}
if (is_method("INVITE|SUBSCRIBE|UPDATE")) {
if(!t_is_set("onreply_route")) {
  t_on_reply("MANAGE_REPLY");
}
}
if (is_method("INVITE")) {
if(!t_is_set("failure_route")) {
 t_on_failure("KAM_AUTH");
}
}

if (!t_relay()) {
sl_reply_error();
}
exit;
}

failure_route[KAM_AUTH] {
  if(t_check_status("401|407")) {
$avp(auser) = "xxx";
$avp(apass) = "yyy";
t_on_failure("OUTGOING_FAILURE");
uac_auth();
t_relay();
exit;
  }
}

Edward



___

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

--

Daniel-Constantin Mierla -- www.asipto.com<http://www.asipto.com>

www.twitter.com/miconda<http://www.twitter.com/miconda> -- 
www.linkedin.com/in/miconda<http://www.linkedin.com/in/miconda>

Funding: https://www.paypal.me/dcmierla

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Digest authentication w/ Kamailio & Freeswitch

2020-05-11 Thread Edward Romanenco
Hi!

I've using a SIP setup that includes both Kamailio & Freeswitch, invites are 
passed from Freeswitch and relayed by Kamailio to various dispatchers, I would 
like to have Kamailio authenticating when Proxy Authentication is required.

As I understood, this can be achieved with the help of a failure route, problem 
is, when I'm utilizing this method - the 407 response gets reverted back to 
Freeswitch, which returns the revised invite filled with the default Freeswitch 
username/password, how can let Kamailio handle the authentication once 
receiving the 407? Can I work straight without relying on a failure route, but 
having the Proxy Authentication header on my original invite?

This is my relevant configuration -
route[RELAY] {
if (is_method("INVITE|BYE|SUBSCRIBE|UPDATE")) {
if(!t_is_set("branch_route")) {
t_on_branch("MANAGE_BRANCH");
 }
}
if (is_method("INVITE|SUBSCRIBE|UPDATE")) {
if(!t_is_set("onreply_route")) {
  t_on_reply("MANAGE_REPLY");
}
}
if (is_method("INVITE")) {
if(!t_is_set("failure_route")) {
 t_on_failure("KAM_AUTH");
}
}

if (!t_relay()) {
sl_reply_error();
}
exit;
}

failure_route[KAM_AUTH] {
  if(t_check_status("401|407")) {
$avp(auser) = "xxx";
$avp(apass) = "yyy";
t_on_failure("OUTGOING_FAILURE");
uac_auth();
t_relay();
exit;
  }
}

Edward
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] How to install the PHONENUM module?

2020-04-21 Thread Edward Romanenco
Last question, what's the easiest way to check if a country-name exists in a 
list of given countries?

For example, if I want to have a certain logic for GB or FR, can I use 
something similar to the following?

if($phn(src=>ccname) == GB|FR) {
...
...
...
}

Edward
____
From: Edward Romanenco 
Sent: Monday, April 20, 2020 2:52 PM
To: Kamailio (SER) - Users Mailing List ; 
sr-us...@lists.sip-router.org ; 
mico...@gmail.com 
Subject: Re: [SR-Users] How to install the PHONENUM module?

Never-mind, I knew I was missing something, CCNAME is what I was looking for.

Edward
____
From: Edward Romanenco 
Sent: Monday, April 20, 2020 2:31 PM
To: Kamailio (SER) - Users Mailing List ; 
sr-us...@lists.sip-router.org ; 
mico...@gmail.com 
Subject: Re: [SR-Users] How to install the PHONENUM module?

The phonenum_match_cn(num, cnc, pvc) method doesn't help me much, as I want to 
be able to pull the country name instead of giving it on my own.

Edward
____
From: Edward Romanenco 
Sent: Monday, April 20, 2020 2:26 PM
To: Kamailio (SER) - Users Mailing List ; 
sr-us...@lists.sip-router.org ; 
mico...@gmail.com 
Subject: Re: [SR-Users] How to install the PHONENUM module?

Thank you Daniel! I was able to install the library, finally. You are a 
lifesaver.

My first and foremost motivation for using this module is to extract the 
country name from the number, the ndesc value of the phn variable gives me 
that... sometimes.
For example +442033202609 returns London when queried using this module, while 
+972779211923 returns Israel.

Is there any way to always show the country name? Maybe a key that I'm missing?

Edward

From: Daniel-Constantin Mierla 
Sent: Monday, April 20, 2020 1:34 PM
To: Edward Romanenco ; Kamailio (SER) - Users Mailing 
List ; sr-us...@lists.sip-router.org 

Subject: Re: [SR-Users] How to install the PHONENUM module?


Use also "make install" inside kamailio source tree to deploy the module, 
rather than manual copy.


Then, be sure that the location of libphonenumber library is in the path for 
linker and also run a 'ldconfig' to rebuild ld cache.


Otherwise, it would be recommended to use the available packages, when 
available and they are ok to compile kamailio, in case you are not that 
familiar to tune the system options to make everything work when compiling 
sources.


Cheers,
Daniel


On 20.04.20 12:22, Edward Romanenco wrote:
Awesome, trying Make Install on the libphonenumber source did help me to 
complete the phonenum.so build, I've copied it into the lib64/kamailio/modules 
and added it into my config file.

But... the Kamailio service fails to start now. I'm getting the following error 
logs:
Apr 20 13:00:35 kamaillioegress kamailio[920]: ERROR:  
[core/sr_module.c:582]: load_module(): could not open module 
: 
libphonenumber.so.8: cannot open shared object file:
Apr 20 13:00:35 kamaillioegress kamailio[920]: CRITICAL:  
[core/cfg.y:3488]: yyerror_at(): parse error in config file 
/usr/local/kamailio-5.1/etc/kamailio/kamailio.cfg, line 241, column 12-24: 
failed to load module

Did anyone meet with this error before?
Should I even bother with building the libphonenumber sources, or maybe switch 
to the 'libphonenumber7' package that seems to be available for installation on 
my Ubuntu machine?

Edward


From: Daniel-Constantin Mierla <mailto:mico...@gmail.com>
Sent: Monday, April 20, 2020 12:19 PM
To: Edward Romanenco <mailto:edw...@telemessage.com>; 
Kamailio (SER) - Users Mailing List 
<mailto:sr-users@lists.kamailio.org>; 
sr-us...@lists.sip-router.org<mailto:sr-us...@lists.sip-router.org> 
<mailto:sr-us...@lists.sip-router.org>
Subject: Re: [SR-Users] How to install the PHONENUM module?



On 20.04.20 08:47, Edward Romanenco wrote:

Ubuntu 16.04, doesn't seem like it, any idea on how should I be verifying it?


Did you wanted to say that "doesn't seem to have it"? Referring to 
libphonenumber? Use "apt-cache search" to find out what packages are available. 
Ubuntu 16.04 is quite old, so I am not sure what is available there.



As for the installation, I followed the process as it was written in their 
README page, what additional steps should I take to finalize the installation?


I installed it from packages so far, but with the usual unix/linux way there 
should be a "make install" for proper installation.

Cheers,
Daniel




Edward



מאת: Daniel-Constantin Mierla<mailto:mico...@gmail.com>
נשלח: יום שני 20 אפריל 2020 09:45
אל: Kamailio (SER) - Users Mailing List<mailto:sr-users@lists.kamailio.org>; 
Edward Romanenco<mailto:edw...@telemessage.com>; 
sr-us...@lists.sip-router.org<mailto:sr-us...@lists.sip-router.org>
נושא: Re: [SR-Users] How to install the PHONENUM module?



Hello,



wha

Re: [SR-Users] How to install the PHONENUM module?

2020-04-21 Thread Edward Romanenco
Never-mind, I knew I was missing something, CCNAME is what I was looking for.

Edward

From: Edward Romanenco 
Sent: Monday, April 20, 2020 2:31 PM
To: Kamailio (SER) - Users Mailing List ; 
sr-us...@lists.sip-router.org ; 
mico...@gmail.com 
Subject: Re: [SR-Users] How to install the PHONENUM module?

The phonenum_match_cn(num, cnc, pvc) method doesn't help me much, as I want to 
be able to pull the country name instead of giving it on my own.

Edward

From: Edward Romanenco 
Sent: Monday, April 20, 2020 2:26 PM
To: Kamailio (SER) - Users Mailing List ; 
sr-us...@lists.sip-router.org ; 
mico...@gmail.com 
Subject: Re: [SR-Users] How to install the PHONENUM module?

Thank you Daniel! I was able to install the library, finally. You are a 
lifesaver.

My first and foremost motivation for using this module is to extract the 
country name from the number, the ndesc value of the phn variable gives me 
that... sometimes.
For example +442033202609 returns London when queried using this module, while 
+972779211923 returns Israel.

Is there any way to always show the country name? Maybe a key that I'm missing?

Edward

From: Daniel-Constantin Mierla 
Sent: Monday, April 20, 2020 1:34 PM
To: Edward Romanenco ; Kamailio (SER) - Users Mailing 
List ; sr-us...@lists.sip-router.org 

Subject: Re: [SR-Users] How to install the PHONENUM module?


Use also "make install" inside kamailio source tree to deploy the module, 
rather than manual copy.


Then, be sure that the location of libphonenumber library is in the path for 
linker and also run a 'ldconfig' to rebuild ld cache.


Otherwise, it would be recommended to use the available packages, when 
available and they are ok to compile kamailio, in case you are not that 
familiar to tune the system options to make everything work when compiling 
sources.


Cheers,
Daniel


On 20.04.20 12:22, Edward Romanenco wrote:
Awesome, trying Make Install on the libphonenumber source did help me to 
complete the phonenum.so build, I've copied it into the lib64/kamailio/modules 
and added it into my config file.

But... the Kamailio service fails to start now. I'm getting the following error 
logs:
Apr 20 13:00:35 kamaillioegress kamailio[920]: ERROR:  
[core/sr_module.c:582]: load_module(): could not open module 
: 
libphonenumber.so.8: cannot open shared object file:
Apr 20 13:00:35 kamaillioegress kamailio[920]: CRITICAL:  
[core/cfg.y:3488]: yyerror_at(): parse error in config file 
/usr/local/kamailio-5.1/etc/kamailio/kamailio.cfg, line 241, column 12-24: 
failed to load module

Did anyone meet with this error before?
Should I even bother with building the libphonenumber sources, or maybe switch 
to the 'libphonenumber7' package that seems to be available for installation on 
my Ubuntu machine?

Edward


From: Daniel-Constantin Mierla <mailto:mico...@gmail.com>
Sent: Monday, April 20, 2020 12:19 PM
To: Edward Romanenco <mailto:edw...@telemessage.com>; 
Kamailio (SER) - Users Mailing List 
<mailto:sr-users@lists.kamailio.org>; 
sr-us...@lists.sip-router.org<mailto:sr-us...@lists.sip-router.org> 
<mailto:sr-us...@lists.sip-router.org>
Subject: Re: [SR-Users] How to install the PHONENUM module?



On 20.04.20 08:47, Edward Romanenco wrote:

Ubuntu 16.04, doesn't seem like it, any idea on how should I be verifying it?


Did you wanted to say that "doesn't seem to have it"? Referring to 
libphonenumber? Use "apt-cache search" to find out what packages are available. 
Ubuntu 16.04 is quite old, so I am not sure what is available there.



As for the installation, I followed the process as it was written in their 
README page, what additional steps should I take to finalize the installation?


I installed it from packages so far, but with the usual unix/linux way there 
should be a "make install" for proper installation.

Cheers,
Daniel




Edward



מאת: Daniel-Constantin Mierla<mailto:mico...@gmail.com>
נשלח: יום שני 20 אפריל 2020 09:45
אל: Kamailio (SER) - Users Mailing List<mailto:sr-users@lists.kamailio.org>; 
Edward Romanenco<mailto:edw...@telemessage.com>; 
sr-us...@lists.sip-router.org<mailto:sr-us...@lists.sip-router.org>
נושא: Re: [SR-Users] How to install the PHONENUM module?



Hello,



what operating system do you use? Isn't the libphonenumber packaged there? 
Should be easier if you install from packages.



Otherwise, have you installed the libphonenumber in the system? The commands 
shown suggest only compilation and testing in the source code library.



On the other hand, not that kamailio 5.1 is out of maintenance time frame, you 
better start with 5.3 at this moment.



Cheers,
Daniel



On 19.04.20 17:46, Edward Romanenco wrote:

Hi, I'm trying to add the PHONENUM module into my Ka

Re: [SR-Users] How to install the PHONENUM module?

2020-04-21 Thread Edward Romanenco
The phonenum_match_cn(num, cnc, pvc) method doesn't help me much, as I want to 
be able to pull the country name instead of giving it on my own.

Edward

From: Edward Romanenco 
Sent: Monday, April 20, 2020 2:26 PM
To: Kamailio (SER) - Users Mailing List ; 
sr-us...@lists.sip-router.org ; 
mico...@gmail.com 
Subject: Re: [SR-Users] How to install the PHONENUM module?

Thank you Daniel! I was able to install the library, finally. You are a 
lifesaver.

My first and foremost motivation for using this module is to extract the 
country name from the number, the ndesc value of the phn variable gives me 
that... sometimes.
For example +442033202609 returns London when queried using this module, while 
+972779211923 returns Israel.

Is there any way to always show the country name? Maybe a key that I'm missing?

Edward

From: Daniel-Constantin Mierla 
Sent: Monday, April 20, 2020 1:34 PM
To: Edward Romanenco ; Kamailio (SER) - Users Mailing 
List ; sr-us...@lists.sip-router.org 

Subject: Re: [SR-Users] How to install the PHONENUM module?


Use also "make install" inside kamailio source tree to deploy the module, 
rather than manual copy.


Then, be sure that the location of libphonenumber library is in the path for 
linker and also run a 'ldconfig' to rebuild ld cache.


Otherwise, it would be recommended to use the available packages, when 
available and they are ok to compile kamailio, in case you are not that 
familiar to tune the system options to make everything work when compiling 
sources.


Cheers,
Daniel


On 20.04.20 12:22, Edward Romanenco wrote:
Awesome, trying Make Install on the libphonenumber source did help me to 
complete the phonenum.so build, I've copied it into the lib64/kamailio/modules 
and added it into my config file.

But... the Kamailio service fails to start now. I'm getting the following error 
logs:
Apr 20 13:00:35 kamaillioegress kamailio[920]: ERROR:  
[core/sr_module.c:582]: load_module(): could not open module 
: 
libphonenumber.so.8: cannot open shared object file:
Apr 20 13:00:35 kamaillioegress kamailio[920]: CRITICAL:  
[core/cfg.y:3488]: yyerror_at(): parse error in config file 
/usr/local/kamailio-5.1/etc/kamailio/kamailio.cfg, line 241, column 12-24: 
failed to load module

Did anyone meet with this error before?
Should I even bother with building the libphonenumber sources, or maybe switch 
to the 'libphonenumber7' package that seems to be available for installation on 
my Ubuntu machine?

Edward


From: Daniel-Constantin Mierla <mailto:mico...@gmail.com>
Sent: Monday, April 20, 2020 12:19 PM
To: Edward Romanenco <mailto:edw...@telemessage.com>; 
Kamailio (SER) - Users Mailing List 
<mailto:sr-users@lists.kamailio.org>; 
sr-us...@lists.sip-router.org<mailto:sr-us...@lists.sip-router.org> 
<mailto:sr-us...@lists.sip-router.org>
Subject: Re: [SR-Users] How to install the PHONENUM module?



On 20.04.20 08:47, Edward Romanenco wrote:

Ubuntu 16.04, doesn't seem like it, any idea on how should I be verifying it?


Did you wanted to say that "doesn't seem to have it"? Referring to 
libphonenumber? Use "apt-cache search" to find out what packages are available. 
Ubuntu 16.04 is quite old, so I am not sure what is available there.



As for the installation, I followed the process as it was written in their 
README page, what additional steps should I take to finalize the installation?


I installed it from packages so far, but with the usual unix/linux way there 
should be a "make install" for proper installation.

Cheers,
Daniel




Edward



מאת: Daniel-Constantin Mierla<mailto:mico...@gmail.com>
נשלח: יום שני 20 אפריל 2020 09:45
אל: Kamailio (SER) - Users Mailing List<mailto:sr-users@lists.kamailio.org>; 
Edward Romanenco<mailto:edw...@telemessage.com>; 
sr-us...@lists.sip-router.org<mailto:sr-us...@lists.sip-router.org>
נושא: Re: [SR-Users] How to install the PHONENUM module?



Hello,



what operating system do you use? Isn't the libphonenumber packaged there? 
Should be easier if you install from packages.



Otherwise, have you installed the libphonenumber in the system? The commands 
shown suggest only compilation and testing in the source code library.



On the other hand, not that kamailio 5.1 is out of maintenance time frame, you 
better start with 5.3 at this moment.



Cheers,
Daniel



On 19.04.20 17:46, Edward Romanenco wrote:

Hi, I'm trying to add the PHONENUM module into my Kamailio installation. For 
this, I've cloned the main branch of 
Libphonenumber<https://github.com/google/libphonenumber/tree/master/cpp> and 
followed the installation rules as they appear in the relevant README file:

Building and testing the library



  $ cd libphonenumber/cpp

  $ mkdir buil

Re: [SR-Users] How to install the PHONENUM module?

2020-04-21 Thread Edward Romanenco
Thank you Daniel! I was able to install the library, finally. You are a 
lifesaver.

My first and foremost motivation for using this module is to extract the 
country name from the number, the ndesc value of the phn variable gives me 
that... sometimes.
For example +442033202609 returns London when queried using this module, while 
+972779211923 returns Israel.

Is there any way to always show the country name? Maybe a key that I'm missing?

Edward

From: Daniel-Constantin Mierla 
Sent: Monday, April 20, 2020 1:34 PM
To: Edward Romanenco ; Kamailio (SER) - Users Mailing 
List ; sr-us...@lists.sip-router.org 

Subject: Re: [SR-Users] How to install the PHONENUM module?


Use also "make install" inside kamailio source tree to deploy the module, 
rather than manual copy.


Then, be sure that the location of libphonenumber library is in the path for 
linker and also run a 'ldconfig' to rebuild ld cache.


Otherwise, it would be recommended to use the available packages, when 
available and they are ok to compile kamailio, in case you are not that 
familiar to tune the system options to make everything work when compiling 
sources.


Cheers,
Daniel


On 20.04.20 12:22, Edward Romanenco wrote:
Awesome, trying Make Install on the libphonenumber source did help me to 
complete the phonenum.so build, I've copied it into the lib64/kamailio/modules 
and added it into my config file.

But... the Kamailio service fails to start now. I'm getting the following error 
logs:
Apr 20 13:00:35 kamaillioegress kamailio[920]: ERROR:  
[core/sr_module.c:582]: load_module(): could not open module 
: 
libphonenumber.so.8: cannot open shared object file:
Apr 20 13:00:35 kamaillioegress kamailio[920]: CRITICAL:  
[core/cfg.y:3488]: yyerror_at(): parse error in config file 
/usr/local/kamailio-5.1/etc/kamailio/kamailio.cfg, line 241, column 12-24: 
failed to load module

Did anyone meet with this error before?
Should I even bother with building the libphonenumber sources, or maybe switch 
to the 'libphonenumber7' package that seems to be available for installation on 
my Ubuntu machine?

Edward


From: Daniel-Constantin Mierla <mailto:mico...@gmail.com>
Sent: Monday, April 20, 2020 12:19 PM
To: Edward Romanenco <mailto:edw...@telemessage.com>; 
Kamailio (SER) - Users Mailing List 
<mailto:sr-users@lists.kamailio.org>; 
sr-us...@lists.sip-router.org<mailto:sr-us...@lists.sip-router.org> 
<mailto:sr-us...@lists.sip-router.org>
Subject: Re: [SR-Users] How to install the PHONENUM module?



On 20.04.20 08:47, Edward Romanenco wrote:

Ubuntu 16.04, doesn't seem like it, any idea on how should I be verifying it?


Did you wanted to say that "doesn't seem to have it"? Referring to 
libphonenumber? Use "apt-cache search" to find out what packages are available. 
Ubuntu 16.04 is quite old, so I am not sure what is available there.



As for the installation, I followed the process as it was written in their 
README page, what additional steps should I take to finalize the installation?


I installed it from packages so far, but with the usual unix/linux way there 
should be a "make install" for proper installation.

Cheers,
Daniel




Edward



מאת: Daniel-Constantin Mierla<mailto:mico...@gmail.com>
נשלח: יום שני 20 אפריל 2020 09:45
אל: Kamailio (SER) - Users Mailing List<mailto:sr-users@lists.kamailio.org>; 
Edward Romanenco<mailto:edw...@telemessage.com>; 
sr-us...@lists.sip-router.org<mailto:sr-us...@lists.sip-router.org>
נושא: Re: [SR-Users] How to install the PHONENUM module?



Hello,



what operating system do you use? Isn't the libphonenumber packaged there? 
Should be easier if you install from packages.



Otherwise, have you installed the libphonenumber in the system? The commands 
shown suggest only compilation and testing in the source code library.



On the other hand, not that kamailio 5.1 is out of maintenance time frame, you 
better start with 5.3 at this moment.



Cheers,
Daniel



On 19.04.20 17:46, Edward Romanenco wrote:

Hi, I'm trying to add the PHONENUM module into my Kamailio installation. For 
this, I've cloned the main branch of 
Libphonenumber<https://github.com/google/libphonenumber/tree/master/cpp> and 
followed the installation rules as they appear in the relevant README file:

Building and testing the library



  $ cd libphonenumber/cpp

  $ mkdir build

  $ cd build

  $ cmake ..

  $ make

  $ ./libphonenumber_test



It all went through and the library was created, but when I try to make and 
install the module itself, I'm getting the following error. Looks like the 
library wasn't included in the building context, can you please lend me a hand 
and tell me how do I include it?



root@kamaillioegress:/usr/local/src/kamailio-5.1/kamailio/s

Re: [SR-Users] How to install the PHONENUM module?

2020-04-21 Thread Edward Romanenco
Awesome, trying Make Install on the libphonenumber source did help me to 
complete the phonenum.so build, I've copied it into the lib64/kamailio/modules 
and added it into my config file.

But... the Kamailio service fails to start now. I'm getting the following error 
logs:
Apr 20 13:00:35 kamaillioegress kamailio[920]: ERROR:  
[core/sr_module.c:582]: load_module(): could not open module 
: 
libphonenumber.so.8: cannot open shared object file:
Apr 20 13:00:35 kamaillioegress kamailio[920]: CRITICAL:  
[core/cfg.y:3488]: yyerror_at(): parse error in config file 
/usr/local/kamailio-5.1/etc/kamailio/kamailio.cfg, line 241, column 12-24: 
failed to load module

Did anyone meet with this error before?
Should I even bother with building the libphonenumber sources, or maybe switch 
to the 'libphonenumber7' package that seems to be available for installation on 
my Ubuntu machine?

Edward


From: Daniel-Constantin Mierla 
Sent: Monday, April 20, 2020 12:19 PM
To: Edward Romanenco ; Kamailio (SER) - Users Mailing 
List ; sr-us...@lists.sip-router.org 

Subject: Re: [SR-Users] How to install the PHONENUM module?



On 20.04.20 08:47, Edward Romanenco wrote:

Ubuntu 16.04, doesn't seem like it, any idea on how should I be verifying it?


Did you wanted to say that "doesn't seem to have it"? Referring to 
libphonenumber? Use "apt-cache search" to find out what packages are available. 
Ubuntu 16.04 is quite old, so I am not sure what is available there.



As for the installation, I followed the process as it was written in their 
README page, what additional steps should I take to finalize the installation?


I installed it from packages so far, but with the usual unix/linux way there 
should be a "make install" for proper installation.

Cheers,
Daniel




Edward



מאת: Daniel-Constantin Mierla<mailto:mico...@gmail.com>
נשלח: יום שני 20 אפריל 2020 09:45
אל: Kamailio (SER) - Users Mailing List<mailto:sr-users@lists.kamailio.org>; 
Edward Romanenco<mailto:edw...@telemessage.com>; 
sr-us...@lists.sip-router.org<mailto:sr-us...@lists.sip-router.org>
נושא: Re: [SR-Users] How to install the PHONENUM module?



Hello,



what operating system do you use? Isn't the libphonenumber packaged there? 
Should be easier if you install from packages.



Otherwise, have you installed the libphonenumber in the system? The commands 
shown suggest only compilation and testing in the source code library.



On the other hand, not that kamailio 5.1 is out of maintenance time frame, you 
better start with 5.3 at this moment.



Cheers,
Daniel



On 19.04.20 17:46, Edward Romanenco wrote:

Hi, I'm trying to add the PHONENUM module into my Kamailio installation. For 
this, I've cloned the main branch of 
Libphonenumber<https://github.com/google/libphonenumber/tree/master/cpp> and 
followed the installation rules as they appear in the relevant README file:

Building and testing the library



  $ cd libphonenumber/cpp

  $ mkdir build

  $ cd build

  $ cmake ..

  $ make

  $ ./libphonenumber_test



It all went through and the library was created, but when I try to make and 
install the module itself, I'm getting the following error. Looks like the 
library wasn't included in the building context, can you please lend me a hand 
and tell me how do I include it?



root@kamaillioegress:/usr/local/src/kamailio-5.1/kamailio/src/modules/phonenum#<mailto:root@kamaillioegress:/usr/local/src/kamailio-5.1/kamailio/src/modules/phonenum>
 make

Compiling cphonenumber.cpp

g++ -fPIC -DPIC -g -funroll-loops -Wcast-align -m64 -minline-all-stringops 
-falign-loops -ftree-vectorize -fno-strict-overflow -Wall -Wno-write-strings 
-Wno-deprecated -Wno-unused-function -Wno-sign-compare -Wno-strict-aliasing 
-fPIC -DPIC -g -funroll-loops -Wcast-align -m64 -minline-all-stringops 
-falign-loops -ftree-vectorize -fno-strict-overflow -Wall  -DNAME='"kamailio"' 
-DVERSION='"5.2.0-dev6"' -DARCH='"x86_64"' -DOS='linux_' -DOS_QUOTED='"linux"' 
-DCOMPILER='"gcc 5.4.0"' -D__CPU_x86_64 -D__OS_linux -DVERSIONVAL=5002000 
-DCFG_DIR='"/usr/local/kamailio-5.1/etc/kamailio/"' 
-DRUN_DIR='"/var/run/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP 
-DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES 
-DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP 
-DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS 
-DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT 
-DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 
-DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD 
-DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_A

Re: [SR-Users] How to install the PHONENUM module?

2020-04-20 Thread Edward Romanenco
Ubuntu 16.04, doesn't seem like it, any idea on how should I be verifying it?

As for the installation, I followed the process as it was written in their 
README page, what additional steps should I take to finalize the installation?

Edward

מאת: Daniel-Constantin Mierla<mailto:mico...@gmail.com>
נשלח: יום שני 20 אפריל 2020 09:45
אל: Kamailio (SER) - Users Mailing List<mailto:sr-users@lists.kamailio.org>; 
Edward Romanenco<mailto:edw...@telemessage.com>; 
sr-us...@lists.sip-router.org<mailto:sr-us...@lists.sip-router.org>
נושא: Re: [SR-Users] How to install the PHONENUM module?


Hello,



what operating system do you use? Isn't the libphonenumber packaged there? 
Should be easier if you install from packages.



Otherwise, have you installed the libphonenumber in the system? The commands 
shown suggest only compilation and testing in the source code library.



On the other hand, not that kamailio 5.1 is out of maintenance time frame, you 
better start with 5.3 at this moment.



Cheers,
Daniel


On 19.04.20 17:46, Edward Romanenco wrote:
Hi, I'm trying to add the PHONENUM module into my Kamailio installation. For 
this, I've cloned the main branch of 
Libphonenumber<https://github.com/google/libphonenumber/tree/master/cpp> and 
followed the installation rules as they appear in the relevant README file:
Building and testing the library

  $ cd libphonenumber/cpp
  $ mkdir build
  $ cd build
  $ cmake ..
  $ make
  $ ./libphonenumber_test

It all went through and the library was created, but when I try to make and 
install the module itself, I'm getting the following error. Looks like the 
library wasn't included in the building context, can you please lend me a hand 
and tell me how do I include it?

root@kamaillioegress:/usr/local/src/kamailio-5.1/kamailio/src/modules/phonenum#<mailto:root@kamaillioegress:/usr/local/src/kamailio-5.1/kamailio/src/modules/phonenum>
 make
Compiling cphonenumber.cpp
g++ -fPIC -DPIC -g -funroll-loops -Wcast-align -m64 -minline-all-stringops 
-falign-loops -ftree-vectorize -fno-strict-overflow -Wall -Wno-write-strings 
-Wno-deprecated -Wno-unused-function -Wno-sign-compare -Wno-strict-aliasing 
-fPIC -DPIC -g -funroll-loops -Wcast-align -m64 -minline-all-stringops 
-falign-loops -ftree-vectorize -fno-strict-overflow -Wall  -DNAME='"kamailio"' 
-DVERSION='"5.2.0-dev6"' -DARCH='"x86_64"' -DOS='linux_' -DOS_QUOTED='"linux"' 
-DCOMPILER='"gcc 5.4.0"' -D__CPU_x86_64 -D__OS_linux -DVERSIONVAL=5002000 
-DCFG_DIR='"/usr/local/kamailio-5.1/etc/kamailio/"' 
-DRUN_DIR='"/var/run/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP 
-DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES 
-DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP 
-DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS 
-DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT 
-DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 
-DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD 
-DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM 
-DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DUSE_RAW_SOCKS -DHAVE_EPOLL 
-DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT  
-I/opt/local/include -DKAMAILIO_MOD_INTERFACE -DMOD_NAME='"phonenum"' -c 
cphonenumber.cpp -o cphonenumber.o
cphonenumber.cpp:24:65: fatal error: 
phonenumbers/geocoding/phonenumber_offline_geocoder.h: No such file or directory
compilation terminated.
Makefile:22: recipe for target 'cphonenumber.o' failed
make: *** [cphonenumber.o] Error 1

Edward



___

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

--

Daniel-Constantin Mierla -- www.asipto.com<http://www.asipto.com>

www.twitter.com/miconda<http://www.twitter.com/miconda> -- 
www.linkedin.com/in/miconda<http://www.linkedin.com/in/miconda>

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] How to install the PHONENUM module?

2020-04-19 Thread Edward Romanenco
Hi, I'm trying to add the PHONENUM module into my Kamailio installation. For 
this, I've cloned the main branch of 
Libphonenumber and 
followed the installation rules as they appear in the relevant README file:
Building and testing the library

  $ cd libphonenumber/cpp
  $ mkdir build
  $ cd build
  $ cmake ..
  $ make
  $ ./libphonenumber_test

It all went through and the library was created, but when I try to make and 
install the module itself, I'm getting the following error. Looks like the 
library wasn't included in the building context, can you please lend me a hand 
and tell me how do I include it?

root@kamaillioegress:/usr/local/src/kamailio-5.1/kamailio/src/modules/phonenum# 
make
Compiling cphonenumber.cpp
g++ -fPIC -DPIC -g -funroll-loops -Wcast-align -m64 -minline-all-stringops 
-falign-loops -ftree-vectorize -fno-strict-overflow -Wall -Wno-write-strings 
-Wno-deprecated -Wno-unused-function -Wno-sign-compare -Wno-strict-aliasing 
-fPIC -DPIC -g -funroll-loops -Wcast-align -m64 -minline-all-stringops 
-falign-loops -ftree-vectorize -fno-strict-overflow -Wall  -DNAME='"kamailio"' 
-DVERSION='"5.2.0-dev6"' -DARCH='"x86_64"' -DOS='linux_' -DOS_QUOTED='"linux"' 
-DCOMPILER='"gcc 5.4.0"' -D__CPU_x86_64 -D__OS_linux -DVERSIONVAL=5002000 
-DCFG_DIR='"/usr/local/kamailio-5.1/etc/kamailio/"' 
-DRUN_DIR='"/var/run/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP 
-DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES 
-DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP 
-DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS 
-DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT 
-DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 
-DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD 
-DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM 
-DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DUSE_RAW_SOCKS -DHAVE_EPOLL 
-DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT  
-I/opt/local/include -DKAMAILIO_MOD_INTERFACE -DMOD_NAME='"phonenum"' -c 
cphonenumber.cpp -o cphonenumber.o
cphonenumber.cpp:24:65: fatal error: 
phonenumbers/geocoding/phonenumber_offline_geocoder.h: No such file or directory
compilation terminated.
Makefile:22: recipe for target 'cphonenumber.o' failed
make: *** [cphonenumber.o] Error 1

Edward
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] LCR and fallback

2020-04-19 Thread Edward Romanenco
Hi!

I would like to implement LCR and fallback capabilities for my Kamailio 
installation. I'm currently using the dispatcher module with a simple 
configuration file.
As I understood, there are multiple modules (carrier route, dynamic routing) 
that can be used to achieve that, what I'm aiming for is -

  *   Country-based (or prefix-based) routing with up to 4 different carriers 
(could be expanded in the future, but I won't have more than a dozen), while 
also maintaining a fallback route if the 1st priority is not available.
  *   Each of my carriers have his own requirements for headers and formatting, 
for instance, for one of our carriers, having a '+' prefix before dialing to a 
non-US number is mandatory, while on the others - it is not, or another example 
- one of my carriers doesn't allow having a P-Asserted-Identity header in my 
invite, while others do. I would love to have the option to manipulate headers 
based on the route that I have chosen, both on the default and fallback routes.
  *   It would be nice to receive SMTP or SNMP alerts if a fallback does occur.
  *   Easy management, having the ability to load and reload the routing table 
on a monthly basis, once the pricing list is changed.

What would be your suggestion?

Edward
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio breaks RFC's 'Contact Header'

2020-04-01 Thread Edward Romanenco
Yes I did actually, I didn't remove it completely but gave an exception in the 
vein of -

event_route[topoh:msg-outgoing] {
  if($sndto(ip)=="10.1.1.10") {
drop;
  }

Thanks Daniel and Henning!

Edward

From: Henning Westerholt 
Sent: Monday, March 30, 2020 9:40 PM
To: Kamailio (SER) - Users Mailing List ; 
sr-us...@lists.sip-router.org 
Cc: Edward Romanenco 
Subject: RE: Kamailio breaks RFC's 'Contact Header'


Hello,



Quoting from the bug report, where Daniel already replied:



“It looks like you are using topoh module, which has the purpose of changing 
the headers that contain ip addresses. Remove it from your config.”



Have you tried already to deactivate this module in your cfg?



Cheers,



Henning





--

Henning Westerholt – https://skalatan.de/blog/

Kamailio services – https://gilawa.com<https://gilawa.com/>



From: sr-users  On Behalf Of Edward 
Romanenco
Sent: Sunday, March 29, 2020 2:51 PM
To: sr-us...@lists.sip-router.org
Subject: [SR-Users] Kamailio breaks RFC's 'Contact Header'



Description

I'm running Kamailio 5.2.0, whenever I relay an invite via Kamailio, my 
original contact header is changed from the original:

sip:+xx...@yyy.yyy.yyy.:5060;transport=udp;gw=netvision

To

sip:YYY.YYY.YYY.YYY;line=sr-.n274i0TMfsHMcCAlVyAMV5IlgCXvV8n4edQlgIUlgKQ4Vk74gI1LmZ69NM79FZAR3JC.cDNLfHUj3Wnp3MP9nd*.

Even when I set it correctly on my route, using:

remove_hf("Contact");

append_hf("Contact: 
sip:$t...@yyy.yyy.yyy.yyy:5060;transport=udp;gw=netvision\r\n", "Contact");



It still ends up being modified.

What can I do to keep the contact header as it is?



SIP Traffic

U YYY.YYY.YYY.YYY:5060 -> 81.24.193.248:5060

INVITE sip:+442033202609@81.24.193.248:5060 SIP/2.0.

Record-Route: 
.

Record-Route: 
.

Via: SIP/2.0/UDP 
YYY.YYY.YYY.YYY;branch=z9hG4bK53e9.308596b23ed683368534c9d609dce0f6.0.

Via: SIP/2.0/UDP 
YYY.YYY.YYY.YYY;branch=z9hG4bKsr-kA2uvfsUlerJWtIylgCXvV8n4edQlgIUlgKQ4Vk74gI1.oJVjb2njburlgCXvV8n4edQlgIUlgKQ4HWsRbWPLVDX.GrXLcAHlcC74nZXKbTVpcHh4b6mMGZvJgLsLcJTkgtGu2PGgy**.

Max-Forwards: 67.

From: +18702935016 ;tag=mp0S9yH11vryH.

To: .

Call-ID: !!:jbkfMgyHjbsDjblfjqAQlVldvgyHKolDlcIHlcknKVIdjcIT.

CSeq: 18182498 INVITE.

Contact: 
.

User-Agent: FreeSWITCH-mod_sofia/1.9.0+git~20180706T160334Z~de3df8dc0e~64bit.

Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, 
REFER, NOTIFY.

Supported: timer, path, replaces.

Allow-Events: talk, hold, conference, refer.

Content-Type: application/sdp.

Content-Disposition: session.

Content-Length: 224.

Remote-Party-ID: "+18702935016" 
;party=calling;screen=yes;privacy=off.

.

v=0.

o=FreeSWITCH 1585439298 1585439299 IN IP4 ZZZ.ZZZ.ZZZ.ZZZ.

s=FreeSWITCH.

c=IN IP4 ZZZ.ZZZ
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Kamailio breaks RFC's 'Contact Header'

2020-03-30 Thread Edward Romanenco
Description
I'm running Kamailio 5.2.0, whenever I relay an invite via Kamailio, my 
original contact header is changed from the original:
sip:+xx...@yyy.yyy.yyy.:5060;transport=udp;gw=netvision
To
sip:YYY.YYY.YYY.YYY;line=sr-.n274i0TMfsHMcCAlVyAMV5IlgCXvV8n4edQlgIUlgKQ4Vk74gI1LmZ69NM79FZAR3JC.cDNLfHUj3Wnp3MP9nd*.
Even when I set it correctly on my route, using:
remove_hf("Contact");
append_hf("Contact: 
sip:$t...@yyy.yyy.yyy.yyy:5060;transport=udp;gw=netvision\r\n", "Contact");

It still ends up being modified.
What can I do to keep the contact header as it is?

SIP Traffic
U YYY.YYY.YYY.YYY:5060 -> 81.24.193.248:5060
INVITE sip:+442033202609@81.24.193.248:5060 SIP/2.0.
Record-Route: 
.
Record-Route: 
.
Via: SIP/2.0/UDP 
YYY.YYY.YYY.YYY;branch=z9hG4bK53e9.308596b23ed683368534c9d609dce0f6.0.
Via: SIP/2.0/UDP 
YYY.YYY.YYY.YYY;branch=z9hG4bKsr-kA2uvfsUlerJWtIylgCXvV8n4edQlgIUlgKQ4Vk74gI1.oJVjb2njburlgCXvV8n4edQlgIUlgKQ4HWsRbWPLVDX.GrXLcAHlcC74nZXKbTVpcHh4b6mMGZvJgLsLcJTkgtGu2PGgy**.
Max-Forwards: 67.
From: +18702935016 ;tag=mp0S9yH11vryH.
To: .
Call-ID: !!:jbkfMgyHjbsDjblfjqAQlVldvgyHKolDlcIHlcknKVIdjcIT.
CSeq: 18182498 INVITE.
Contact: 
.
User-Agent: FreeSWITCH-mod_sofia/1.9.0+git~20180706T160334Z~de3df8dc0e~64bit.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, 
REFER, NOTIFY.
Supported: timer, path, replaces.
Allow-Events: talk, hold, conference, refer.
Content-Type: application/sdp.
Content-Disposition: session.
Content-Length: 224.
Remote-Party-ID: "+18702935016" 
;party=calling;screen=yes;privacy=off.
.
v=0.
o=FreeSWITCH 1585439298 1585439299 IN IP4 ZZZ.ZZZ.ZZZ.ZZZ.
s=FreeSWITCH.
c=IN IP4 ZZZ.ZZZ
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Kamailio breaks RFC's 'Contact Header'

2020-03-30 Thread Edward Romanenco
Description
I'm running Kamailio 5.2.0, whenever I relay an invite via Kamailio, my 
original contact header is changed from the original:
sip:+xx...@yyy.yyy.yyy.:5060;transport=udp;gw=netvision
To
sip:YYY.YYY.YYY.YYY;line=sr-.n274i0TMfsHMcCAlVyAMV5IlgCXvV8n4edQlgIUlgKQ4Vk74gI1LmZ69NM79FZAR3JC.cDNLfHUj3Wnp3MP9nd*.
Even when I set it correctly on my route, using:
remove_hf("Contact");
append_hf("Contact: 
sip:$t...@yyy.yyy.yyy.yyy:5060;transport=udp;gw=netvision\r\n", "Contact");

It still ends up being modified.
What can I do to keep the contact header as it is?

SIP Traffic
U YYY.YYY.YYY.YYY:5060 -> 81.24.193.248:5060
INVITE sip:+442033202609@81.24.193.248:5060 SIP/2.0.
Record-Route: 
.
Record-Route: 
.
Via: SIP/2.0/UDP 
YYY.YYY.YYY.YYY;branch=z9hG4bK53e9.308596b23ed683368534c9d609dce0f6.0.
Via: SIP/2.0/UDP 
YYY.YYY.YYY.YYY;branch=z9hG4bKsr-kA2uvfsUlerJWtIylgCXvV8n4edQlgIUlgKQ4Vk74gI1.oJVjb2njburlgCXvV8n4edQlgIUlgKQ4HWsRbWPLVDX.GrXLcAHlcC74nZXKbTVpcHh4b6mMGZvJgLsLcJTkgtGu2PGgy**.
Max-Forwards: 67.
From: +18702935016 ;tag=mp0S9yH11vryH.
To: .
Call-ID: !!:jbkfMgyHjbsDjblfjqAQlVldvgyHKolDlcIHlcknKVIdjcIT.
CSeq: 18182498 INVITE.
Contact: 
.
User-Agent: FreeSWITCH-mod_sofia/1.9.0+git~20180706T160334Z~de3df8dc0e~64bit.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, 
REFER, NOTIFY.
Supported: timer, path, replaces.
Allow-Events: talk, hold, conference, refer.
Content-Type: application/sdp.
Content-Disposition: session.
Content-Length: 224.
Remote-Party-ID: "+18702935016" 
;party=calling;screen=yes;privacy=off.
.
v=0.
o=FreeSWITCH 1585439298 1585439299 IN IP4 ZZZ.ZZZ.ZZZ.ZZZ.
s=FreeSWITCH.
c=IN IP4 ZZZ.ZZZ
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users