Re: [OpenSIPS-Users] port number in record-route

2017-03-30 Thread Satish Patel
is there a way i can re-write record-route port number?

On Wed, Mar 29, 2017 at 6:29 PM, Alex Balashov
 wrote:
> Record-Route headers contain URIs, and like any SIP URI, they can contain a 
> port component. If that port component is omitted, 5060 is presumed.
>
> On March 29, 2017 6:27:30 PM EDT, Satish Patel  wrote:
>>what is the use of port number in record-route?
>>
>>I am having major issue with that look like we are running sip server
>>on different port to protect ourself from sip scanner we are using
>>non-standard port like 6060/7070 multiple port on single server so it
>>will failover to other port if firewall block them.
>>
>>I am seeing record-route adding first port in listen: directive for
>>example
>>
>>listen=udp:x.x.x.x:7070 udp:x.x.x.x:7070 udp:x.x.x.x:5062
>>
>>In this case my record-route always using 7070 in header default
>>recordless request coming on 5062.
>>
>>I found one more issue here someone posted while ago
>>
>>https://lists.cs.columbia.edu/pipermail/sip-implementors/2001-March/000601.html
>>
>>___
>>Users mailing list
>>Users@lists.opensips.org
>>http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> -- Alex
>
> --
> Principal, Evariste Systems LLC (www.evaristesys.com)
>
> Sent from my Google Nexus.
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Possible mid-registrar bug

2017-03-30 Thread Liviu Chircu
I have pushed a fix on "master" and "2.3". Please let me know if run 
into any more issues.


Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

OpenSIPS Summit May 2017 Amsterdam
  http://www.opensips.org/events/Summit-2017Amsterdam.html

On 30.03.2017 13:32, Liviu Chircu wrote:


Hi, Kirill!

Thank you for the excellent report! A fix will be available asap!

Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

OpenSIPS Summit May 2017 Amsterdam
   http://www.opensips.org/events/Summit-2017Amsterdam.html
On 30.03.2017 10:20, Kirill Galinurov wrote:

Hi all. We try test new mid-registar feature in opensips 2.3

loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 1) /* 0 = mirror / 1 = ct / 2 = AoR */
modparam("mid_registrar", "outgoing_expires", 3600)
modparam("mid_registrar", "insertion_mode", 0) /* 0 = contact; 1 = 
path */

modparam("mid_registrar", "max_contacts", 1)
modparam("mid_registrar", "retry_after", 30)
modparam("mid_registrar", "contact_match_param", "rid")

if (is_method("REGISTER")) {
mid_registrar_save("location");
switch ($retcode) {
case 1:
 xlog("L_INFO", "forwarding REGISTER to main 
registrar...\n");
$ru = "sip:192.168.77.49:5060 
";

if (!t_relay()) {
send_reply("500", "Server Internal Error 1");
}

break;
case 2:
 xlog("L_INFO", "REGISTER has been absorbed!\n");
break;
default:
xlog("L_ERR", "mid-registrar error!\n");
send_reply("500", "Server Internal Error 2");
}

  exit;
}

if (is_method("INVITE") and $si == "192.168.77.49" and $sp == 5060) {
if (!mid_registrar_lookup("location")) {
t_reply("404", "Not Found");
exit;
}

if (!t_relay())
send_reply("500", "Server Internal Error 3");

exit;
}
When we use rid parameter we have a error in Asterisk.

Initial Register from Client to Opensips

/REGISTER sip:192.168.10.200;transport=UDP SIP/2.0/
/Via: SIP/2.0/UDP 
192.168.76.224:33593;branch=z9hG4bK-524287-1---52af00d0e9d590fd/

/Max-Forwards: 70/
/Contact: 
/
/To: ;transport=UDP>/
/From: ;transport=UDP>;tag=66282f00/

/Call-ID: zHst9ROVeEmKYQVPUwDz8w../
/CSeq: 6 REGISTER/
/Expires: 3600/
/User-Agent: Z 3.15.40006 rv2.8.20/
/Authorization: Digest 
username="2101",realm="asterisk",nonce="1490856865/be28c84459a2237855ebfa2521ba0bb8",uri="sip:192.168.10.200;transport=UDP",response="753e7a589c04180fa63aecc08bb4b40a",cnonce="91b8e43b5c5c0bc2e45ec37f8ddf53d9",nc=0003,qop=auth,algorithm=md5,opaque="488632b65bf44460"/

/Allow-Events: presence, kpml, talk/
/Content-Length: 0/

From Opensips to Asterisk

/REGISTER sip:192.168.77.49:5060  SIP/2.0/
/Via: SIP/2.0/UDP 192.168.10.200:5060;branch=z9hG4bK8fa9.40aab787.0/
/Via: SIP/2.0/UDP 
192.168.76.224:33593;branch=z9hG4bK-524287-1---52af00d0e9d590fd/

/Max-Forwards: 69/
/Contact: 
/
/To: ;transport=UDP>/
/From: ;transport=UDP>;tag=66282f00/

/Call-ID: zHst9ROVeEmKYQVPUwDz8w../
/CSeq: 6 REGISTER/
/Expires: 3600/
/User-Agent: Z 3.15.40006 rv2.8.20/
/Authorization: Digest 
username="2101",realm="asterisk",nonce="1490856865/be28c84459a2237855ebfa2521ba0bb8",uri="sip:192.168.10.200;transport=UDP",response="753e7a589c04180fa63aecc08bb4b40a",cnonce="91b8e43b5c5c0bc2e45ec37f8ddf53d9",nc=0003,qop=auth,algorithm=md5,opaque="488632b65bf44460"/

/Allow-Events: presence, kpml, talk/
/Content-Length: 0/

Asterisk console log:

/[2017-03-30 10:01:31] ERROR[20693]: pjproject:0 :   
sip_transport. Error processing 658 bytes packet from UDP 
192.168.10.200:5060  : PJSIP syntax error 
exception when parsing '' header on line 5 col 180:/

/REGISTER sip:192.168.77.49:5060  SIP/2.0/
/Via: SIP/2.0/UDP 192.168.10.200:5060;branch=z9hG4bK4e1d.2e61df17.0/
/Via: SIP/2.0/UDP 
192.168.76.224:33593;branch=z9hG4bK-524287-1---51b24eac9ec64d78/

/Max-Forwards: 69/
/Contact: 
/
/To: ;transport=UDP>/
/From: 

Re: [OpenSIPS-Users] Possible mid-registrar bug

2017-03-30 Thread Liviu Chircu

Hi, Kirill!

Thank you for the excellent report! A fix will be available asap!

Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

OpenSIPS Summit May 2017 Amsterdam
  http://www.opensips.org/events/Summit-2017Amsterdam.html

On 30.03.2017 10:20, Kirill Galinurov wrote:

Hi all. We try test new mid-registar feature in opensips 2.3

loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 1) /* 0 = mirror / 1 = ct / 2 = AoR */
modparam("mid_registrar", "outgoing_expires", 3600)
modparam("mid_registrar", "insertion_mode", 0) /* 0 = contact; 1 = path */
modparam("mid_registrar", "max_contacts", 1)
modparam("mid_registrar", "retry_after", 30)
modparam("mid_registrar", "contact_match_param", "rid")

if (is_method("REGISTER")) {
mid_registrar_save("location");
switch ($retcode) {
case 1:
 xlog("L_INFO", "forwarding REGISTER to main 
registrar...\n");
$ru = "sip:192.168.77.49:5060 
";

if (!t_relay()) {
send_reply("500", "Server Internal Error 1");
}

break;
case 2:
 xlog("L_INFO", "REGISTER has been absorbed!\n");
break;
default:
xlog("L_ERR", "mid-registrar error!\n");
send_reply("500", "Server Internal Error 2");
}

  exit;
}

if (is_method("INVITE") and $si == "192.168.77.49" and $sp == 5060) {
if (!mid_registrar_lookup("location")) {
t_reply("404", "Not Found");
exit;
}

if (!t_relay())
send_reply("500", "Server Internal Error 3");

exit;
}
When we use rid parameter we have a error in Asterisk.

Initial Register from Client to Opensips

/REGISTER sip:192.168.10.200;transport=UDP SIP/2.0/
/Via: SIP/2.0/UDP 
192.168.76.224:33593;branch=z9hG4bK-524287-1---52af00d0e9d590fd/

/Max-Forwards: 70/
/Contact: 
/
/To: ;transport=UDP>/
/From: ;transport=UDP>;tag=66282f00/

/Call-ID: zHst9ROVeEmKYQVPUwDz8w../
/CSeq: 6 REGISTER/
/Expires: 3600/
/User-Agent: Z 3.15.40006 rv2.8.20/
/Authorization: Digest 
username="2101",realm="asterisk",nonce="1490856865/be28c84459a2237855ebfa2521ba0bb8",uri="sip:192.168.10.200;transport=UDP",response="753e7a589c04180fa63aecc08bb4b40a",cnonce="91b8e43b5c5c0bc2e45ec37f8ddf53d9",nc=0003,qop=auth,algorithm=md5,opaque="488632b65bf44460"/

/Allow-Events: presence, kpml, talk/
/Content-Length: 0/

From Opensips to Asterisk

/REGISTER sip:192.168.77.49:5060  SIP/2.0/
/Via: SIP/2.0/UDP 192.168.10.200:5060;branch=z9hG4bK8fa9.40aab787.0/
/Via: SIP/2.0/UDP 
192.168.76.224:33593;branch=z9hG4bK-524287-1---52af00d0e9d590fd/

/Max-Forwards: 69/
/Contact: 
/
/To: ;transport=UDP>/
/From: ;transport=UDP>;tag=66282f00/

/Call-ID: zHst9ROVeEmKYQVPUwDz8w../
/CSeq: 6 REGISTER/
/Expires: 3600/
/User-Agent: Z 3.15.40006 rv2.8.20/
/Authorization: Digest 
username="2101",realm="asterisk",nonce="1490856865/be28c84459a2237855ebfa2521ba0bb8",uri="sip:192.168.10.200;transport=UDP",response="753e7a589c04180fa63aecc08bb4b40a",cnonce="91b8e43b5c5c0bc2e45ec37f8ddf53d9",nc=0003,qop=auth,algorithm=md5,opaque="488632b65bf44460"/

/Allow-Events: presence, kpml, talk/
/Content-Length: 0/

Asterisk console log:

/[2017-03-30 10:01:31] ERROR[20693]: pjproject:0 :   sip_transport. 
Error processing 658 bytes packet from UDP 192.168.10.200:5060 
 : PJSIP syntax error exception when 
parsing '' header on line 5 col 180:/

/REGISTER sip:192.168.77.49:5060  SIP/2.0/
/Via: SIP/2.0/UDP 192.168.10.200:5060;branch=z9hG4bK4e1d.2e61df17.0/
/Via: SIP/2.0/UDP 
192.168.76.224:33593;branch=z9hG4bK-524287-1---51b24eac9ec64d78/

/Max-Forwards: 69/
/Contact: 
/
/To: ;transport=UDP>/
/From: ;transport=UDP>;tag=66282f00/

/Call-ID: zHst9ROVeEmKYQVPUwDz8w../
/CSeq: 15 REGISTER/
/Expires: 3600/
/User-Agent: Z 3.15.40006 rv2.8.20/
/Allow-Events: presence, kpml, talk/
/Content-Length: 0/

So the problem in rid parameter Contact field 
 

[OpenSIPS-Users] Possible mid-registrar bug

2017-03-30 Thread Kirill Galinurov
Hi all. We try test new mid-registar feature in opensips 2.3

loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 1) /* 0 = mirror / 1 = ct / 2 = AoR */
modparam("mid_registrar", "outgoing_expires", 3600)
modparam("mid_registrar", "insertion_mode", 0) /* 0 = contact; 1 = path */
modparam("mid_registrar", "max_contacts", 1)
modparam("mid_registrar", "retry_after", 30)
modparam("mid_registrar", "contact_match_param", "rid")

if (is_method("REGISTER")) {
mid_registrar_save("location");
switch ($retcode) {
case 1:
 xlog("L_INFO", "forwarding REGISTER to main
registrar...\n");
$ru = "sip:192.168.77.49:5060";
if (!t_relay()) {
send_reply("500", "Server Internal Error 1");
}

break;
case 2:
 xlog("L_INFO", "REGISTER has been absorbed!\n");
break;
default:
xlog("L_ERR", "mid-registrar error!\n");
send_reply("500", "Server Internal Error 2");
}

  exit;
}

if (is_method("INVITE") and $si == "192.168.77.49" and $sp == 5060) {
if (!mid_registrar_lookup("location")) {
t_reply("404", "Not Found");
exit;
}

if (!t_relay())
send_reply("500", "Server Internal Error 3");

exit;
}
When we use rid parameter we have a error in Asterisk.

Initial Register from Client to Opensips

*REGISTER sip:192.168.10.200;transport=UDP SIP/2.0*
*Via: SIP/2.0/UDP
192.168.76.224:33593;branch=z9hG4bK-524287-1---52af00d0e9d590fd*
*Max-Forwards: 70*
*Contact:
*
*To: ;transport=UDP>*
*From: ;transport=UDP>;tag=66282f00*
*Call-ID: zHst9ROVeEmKYQVPUwDz8w..*
*CSeq: 6 REGISTER*
*Expires: 3600*
*User-Agent: Z 3.15.40006 rv2.8.20*
*Authorization: Digest
username="2101",realm="asterisk",nonce="1490856865/be28c84459a2237855ebfa2521ba0bb8",uri="sip:192.168.10.200;transport=UDP",response="753e7a589c04180fa63aecc08bb4b40a",cnonce="91b8e43b5c5c0bc2e45ec37f8ddf53d9",nc=0003,qop=auth,algorithm=md5,opaque="488632b65bf44460"*
*Allow-Events: presence, kpml, talk*
*Content-Length: 0*

>From Opensips to Asterisk

*REGISTER sip:192.168.77.49:5060  SIP/2.0*
*Via: SIP/2.0/UDP 192.168.10.200:5060;branch=z9hG4bK8fa9.40aab787.0*
*Via: SIP/2.0/UDP
192.168.76.224:33593;branch=z9hG4bK-524287-1---52af00d0e9d590fd*
*Max-Forwards: 69*
*Contact:
*
*To: ;transport=UDP>*
*From: ;transport=UDP>;tag=66282f00*
*Call-ID: zHst9ROVeEmKYQVPUwDz8w..*
*CSeq: 6 REGISTER*
*Expires: 3600*
*User-Agent: Z 3.15.40006 rv2.8.20*
*Authorization: Digest
username="2101",realm="asterisk",nonce="1490856865/be28c84459a2237855ebfa2521ba0bb8",uri="sip:192.168.10.200;transport=UDP",response="753e7a589c04180fa63aecc08bb4b40a",cnonce="91b8e43b5c5c0bc2e45ec37f8ddf53d9",nc=0003,qop=auth,algorithm=md5,opaque="488632b65bf44460"*
*Allow-Events: presence, kpml, talk*
*Content-Length: 0*

Asterisk console log:

*[2017-03-30 10:01:31] ERROR[20693]: pjproject:0 :   sip_transport.
Error processing 658 bytes packet from UDP 192.168.10.200:5060
 : PJSIP syntax error exception when parsing ''
header on line 5 col 180:*
*REGISTER sip:192.168.77.49:5060  SIP/2.0*
*Via: SIP/2.0/UDP 192.168.10.200:5060;branch=z9hG4bK4e1d.2e61df17.0*
*Via: SIP/2.0/UDP
192.168.76.224:33593;branch=z9hG4bK-524287-1---51b24eac9ec64d78*
*Max-Forwards: 69*
*Contact:
*
*To: ;transport=UDP>*
*From: ;transport=UDP>;tag=66282f00*
*Call-ID: zHst9ROVeEmKYQVPUwDz8w..*
*CSeq: 15 REGISTER*
*Expires: 3600*
*User-Agent: Z 3.15.40006 rv2.8.20*
*Allow-Events: presence, kpml, talk*
*Content-Length: 0*

So the problem in rid parameter Contact field
 
rid=c2lwOjIxMDFAMTkyLjE2OC43Ni4yMjQ6MzM1OTM7cmluc3RhbmNlPWE2YmIxODU3ZjdlNDFmMzA7dHJhbnNwb3J0PVVEUA==>
in ==> symbols.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users