rewite contact

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

rewite contact

Slava Bendersky-2
Hello Everyone,
In which case mid_registrar will not rewrite contact ?
I see when present param ;transport=tls contact is not rewritten.
config

#### REGISTRAR module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2)
modparam("mid_registrar", "received_avp", "$avp(RECEIVED)")
modparam("mid_registrar", "max_contacts", 10)
modparam("mid_registrar", "tcp_persistent_flag", "TCP_PERSIST_REGISTRATIONS")
modparam("mid_registrar", "outgoing_expires", 7200)

code

if($proto=="TCP|tcp|TLS|tls") {
setflag(TCP_PERSIST_REGISTRATIONS);
}
mid_registrar_save("location","p1");
# Work arround for github issue #1109
append_hf("Path: <sip:$fU@lan_ip:5060;transport=udp>\r\n");
xlog("L_INFO", "Forwarding REGISTER to main registrar ~> [$ct]\n");
}


Freeswitch contact

Contact: "" <sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp>
Agent: Grandstream GXP1760W 1.0.1.74
Status: Registered(TLS)(unknown) EXP(2018-09-30 19:37:59) EXPSECS(429254)
Ping-Status: Reachable
Ping-Time: 0.00
Host: pbx04.domain.lan
IP: 10.30.100.41
Port: 5060
Auth-User: 101
Auth-Realm: domain.com
MWI-Account: [hidden email]
volga629



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rewite contact

Bogdan-Andrei Iancu-2
Hi Slava,

By definition mid_registrar *will* change the contact, mainly the user and domain part of the URI contact. The URI parameters are preserved. The transport too, unless you change the outbound socket (to a different protocol).

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/
On 09/26/2018 05:19 AM, Slava Bendersky wrote:
Hello Everyone,
In which case mid_registrar will not rewrite contact ?
I see when present param ;transport=tls contact is not rewritten.
config

#### REGISTRAR module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2)
modparam("mid_registrar", "received_avp", "$avp(RECEIVED)")
modparam("mid_registrar", "max_contacts", 10)
modparam("mid_registrar", "tcp_persistent_flag", "TCP_PERSIST_REGISTRATIONS")
modparam("mid_registrar", "outgoing_expires", 7200)

code

if($proto=="TCP|tcp|TLS|tls") {
setflag(TCP_PERSIST_REGISTRATIONS);
}
mid_registrar_save("location","p1");
# Work arround for github issue #1109
append_hf("Path: <a class="moz-txt-link-rfc2396E" href="sip:$fU@lan_ip:5060;transport=udp"><sip:$fU@lan_ip:5060;transport=udp>\r\n");
xlog("L_INFO", "Forwarding REGISTER to main registrar ~> [$ct]\n");
}


Freeswitch contact

Contact: "" <a class="moz-txt-link-rfc2396E" href="sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp"><sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp>
Agent: Grandstream GXP1760W 1.0.1.74
Status: Registered(TLS)(unknown) EXP(2018-09-30 19:37:59) EXPSECS(429254)
Ping-Status: Reachable
Ping-Time: 0.00
Host: pbx04.domain.lan
IP: 10.30.100.41
Port: 5060
Auth-User: 101
Auth-Realm: domain.com
MWI-Account: [hidden email]
volga629




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rewite contact

Slava Bendersky-2
Hello Bogdan,
Yes, the issue that outbound socket is UDP I expected that contact will not contain ;transport=tls.

volga629



From: "volga629" <[hidden email]>
To: "Bogdan-Andrei Iancu" <[hidden email]>
Cc: "OpenSIPS users mailling list" <[hidden email]>
Sent: Wednesday, September 26, 2018 9:22:09 AM
Subject: Re: [OpenSIPS-Users] rewite contact

Hello Bogdan,
Yes, the issue that outbound socket is UDP I expected that contact will not contain ;transport=tls.

volga629


From: "Bogdan-Andrei Iancu" <[hidden email]>
To: "OpenSIPS users mailling list" <[hidden email]>, "Slava Bendersky" <[hidden email]>
Sent: Wednesday, September 26, 2018 6:45:09 AM
Subject: Re: [OpenSIPS-Users] rewite contact

Hi Slava,

By definition mid_registrar *will* change the contact, mainly the user and domain part of the URI contact. The URI parameters are preserved. The transport too, unless you change the outbound socket (to a different protocol).

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/
On 09/26/2018 05:19 AM, Slava Bendersky wrote:
Hello Everyone,
In which case mid_registrar will not rewrite contact ?
I see when present param ;transport=tls contact is not rewritten.
config

#### REGISTRAR module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2)
modparam("mid_registrar", "received_avp", "$avp(RECEIVED)")
modparam("mid_registrar", "max_contacts", 10)
modparam("mid_registrar", "tcp_persistent_flag", "TCP_PERSIST_REGISTRATIONS")
modparam("mid_registrar", "outgoing_expires", 7200)

code

if($proto=="TCP|tcp|TLS|tls") {
setflag(TCP_PERSIST_REGISTRATIONS);
}
mid_registrar_save("location","p1");
# Work arround for github issue #1109
append_hf("Path: <a class="moz-txt-link-rfc2396E" href="sip:$fU@lan_ip:5060;transport=udp" target="_blank"><sip:$fU@lan_ip:5060;transport=udp>\r\n");
xlog("L_INFO", "Forwarding REGISTER to main registrar ~> [$ct]\n");
}


Freeswitch contact

Contact: "" <a class="moz-txt-link-rfc2396E" href="sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp" target="_blank"><sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp>
Agent: Grandstream GXP1760W 1.0.1.74
Status: Registered(TLS)(unknown) EXP(2018-09-30 19:37:59) EXPSECS(429254)
Ping-Status: Reachable
Ping-Time: 0.00
Host: pbx04.domain.lan
IP: 10.30.100.41
Port: 5060
Auth-User: 101
Auth-Realm: domain.com
MWI-Account: [hidden email]
volga629




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rewite contact

Slava Bendersky-2
Hello Bogdan,
How mid_registrar will handle * on Contact header

2018/09/26 16:23:21.555947 10.30.100.41:5060 -> 10.30.100.48:5160
REGISTER sip:domain.com:5160 SIP/2.0
Via: SIP/2.0/UDP 10.30.100.41:5060;branch=z9hG4bKabc6.46892d12.0;i=00250de2
Via: SIP/2.0/TLS 192.168.1.65:5060;received=190.240.46.242;branch=z9hG4bK834060502;rport=61454;alias
From: <sip:[hidden email]:5160>;tag=1400521034
To: <sip:[hidden email]:5160>
CSeq: 2000 REGISTER
Contact: *
X-Grandstream-PBX: true
Max-Forwards: 69
User-Agent: Grandstream GXP1760W 1.0.1.74
Expires: 0
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
Path: <sip:101@10.30.100.41:5060;transport=udp>

On Sep 26 2018, at 9:23 am, Slava Bendersky <[hidden email]> wrote:

Hello Bogdan,
Yes, the issue that outbound socket is UDP I expected that contact will not contain ;transport=tls.

volga629


From: "volga629" <[hidden email]>
To: "Bogdan-Andrei Iancu" <[hidden email]>
Cc: "OpenSIPS users mailling list" <[hidden email]>
Sent: Wednesday, September 26, 2018 9:22:09 AM
Subject: Re: [OpenSIPS-Users] rewite contact

Hello Bogdan,
Yes, the issue that outbound socket is UDP I expected that contact will not contain ;transport=tls.

volga629

From: "Bogdan-Andrei Iancu" <[hidden email]>
To: "OpenSIPS users mailling list" <[hidden email]>, "Slava Bendersky" <[hidden email]>
Sent: Wednesday, September 26, 2018 6:45:09 AM
Subject: Re: [OpenSIPS-Users] rewite contact

Hi Slava,

By definition mid_registrar *will* change the contact, mainly the user and domain part of the URI contact. The URI parameters are preserved. The transport too, unless you change the outbound socket (to a different protocol).

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
OpenSIPS Bootcamp 2018
On 09/26/2018 05:19 AM, Slava Bendersky wrote:
Hello Everyone,
In which case mid_registrar will not rewrite contact ?
I see when present param ;transport=tls contact is not rewritten.
config

#### REGISTRAR module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2)
modparam("mid_registrar", "received_avp", "$avp(RECEIVED)")
modparam("mid_registrar", "max_contacts", 10)
modparam("mid_registrar", "tcp_persistent_flag", "TCP_PERSIST_REGISTRATIONS")
modparam("mid_registrar", "outgoing_expires", 7200)

code

if($proto=="TCP|tcp|TLS|tls") {
setflag(TCP_PERSIST_REGISTRATIONS);
}
mid_registrar_save("location","p1");
# Work arround for github issue #1109
append_hf("Path: <a href="sip:$fU@lan_ip:5060;transport=udp" title="sip:$fU@lan_ip:5060;transport=udp"><sip:$fU@lan_ip:5060;transport=udp>\r\n");
xlog("L_INFO", "Forwarding REGISTER to main registrar ~> [$ct]\n");
}


Freeswitch contact

Contact: "" <a href="sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp" title="sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp"><sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp>
Agent: Grandstream GXP1760W 1.0.1.74
Status: Registered(TLS)(unknown) EXP(2018-09-30 19:37:59) EXPSECS(429254)
Ping-Status: Reachable
Ping-Time: 0.00
Host: pbx04.domain.lan
IP: 10.30.100.41
Port: 5060
Auth-User: 101
Auth-Realm: domain.com
MWI-Account: [hidden email]
volga629




_______________________________________________
Users mailing list

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rewite contact

Bogdan-Andrei Iancu-2
In reply to this post by Bogdan-Andrei Iancu-2
Hi Slava,

Could you provide a small pcap showing the incoming and outgoing REGISTER requests (with the network info too) ?

Re-iterating on how the CT parameters are working with mid_registrar - all incoming CT URI parameters are removed (as locally stored), so by default there is no parameter in the outbound REGISTER, unless you use "extra_contact_params_avp" module parameter.

Thanks,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/
On 09/26/2018 03:22 PM, Slava Bendersky wrote:
Hello Bogdan,
Yes, the issue that outbound socket is UDP I expected that contact will not contain ;transport=tls.

volga629


From: "Bogdan-Andrei Iancu" [hidden email]
To: "OpenSIPS users mailling list" [hidden email], "Slava Bendersky" [hidden email]
Sent: Wednesday, September 26, 2018 6:45:09 AM
Subject: Re: [OpenSIPS-Users] rewite contact

Hi Slava,

By definition mid_registrar *will* change the contact, mainly the user and domain part of the URI contact. The URI parameters are preserved. The transport too, unless you change the outbound socket (to a different protocol).

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/
On 09/26/2018 05:19 AM, Slava Bendersky wrote:
Hello Everyone,
In which case mid_registrar will not rewrite contact ?
I see when present param ;transport=tls contact is not rewritten.
config

#### REGISTRAR module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2)
modparam("mid_registrar", "received_avp", "$avp(RECEIVED)")
modparam("mid_registrar", "max_contacts", 10)
modparam("mid_registrar", "tcp_persistent_flag", "TCP_PERSIST_REGISTRATIONS")
modparam("mid_registrar", "outgoing_expires", 7200)

code

if($proto=="TCP|tcp|TLS|tls") {
setflag(TCP_PERSIST_REGISTRATIONS);
}
mid_registrar_save("location","p1");
# Work arround for github issue #1109
append_hf("Path: <a class="moz-txt-link-rfc2396E" href="sip:$fU@lan_ip:5060;transport=udp" target="_blank" moz-do-not-send="true"><sip:$fU@lan_ip:5060;transport=udp>\r\n");
xlog("L_INFO", "Forwarding REGISTER to main registrar ~> [$ct]\n");
}


Freeswitch contact

Contact: "" <a class="moz-txt-link-rfc2396E" href="sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp" target="_blank" moz-do-not-send="true"><sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp>
Agent: Grandstream GXP1760W 1.0.1.74
Status: Registered(TLS)(unknown) EXP(2018-09-30 19:37:59) EXPSECS(429254)
Ping-Status: Reachable
Ping-Time: 0.00
Host: pbx04.domain.lan
IP: 10.30.100.41
Port: 5060
Auth-User: 101
Auth-Realm: domain.com
MWI-Account: [hidden email]
volga629




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rewite contact

Bogdan-Andrei Iancu-2
In reply to this post by Slava Bendersky-2
Hi Salva,

The CT "*" will be forwarded to the main-registrar and all the local contacts (on mid-registrar) discarded.

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/
On 09/27/2018 01:19 AM, Slava Bendersky wrote:
Hello Bogdan,
How mid_registrar will handle * on Contact header

2018/09/26 16:23:21.555947 10.30.100.41:5060 -> 10.30.100.48:5160
REGISTER <a class="moz-txt-link-freetext" href="sip:domain.com:5160">sip:domain.com:5160 SIP/2.0
Via: SIP/2.0/UDP 10.30.100.41:5060;branch=z9hG4bKabc6.46892d12.0;i=00250de2
Via: SIP/2.0/TLS 192.168.1.65:5060;received=190.240.46.242;branch=z9hG4bK834060502;rport=61454;alias
From: <a class="moz-txt-link-rfc2396E" href="sip:101@domain.com:5160"><sip:101@...:5160>;tag=1400521034
To: <a class="moz-txt-link-rfc2396E" href="sip:101@domain.com:5160"><sip:101@...:5160>
CSeq: 2000 REGISTER
Contact: *
X-Grandstream-PBX: true
Max-Forwards: 69
User-Agent: Grandstream GXP1760W 1.0.1.74
Expires: 0
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0
Path: <a class="moz-txt-link-rfc2396E" href="sip:101@10.30.100.41:5060;transport=udp"><sip:101@10.30.100.41:5060;transport=udp>

On Sep 26 2018, at 9:23 am, Slava Bendersky [hidden email] wrote:

Hello Bogdan,
Yes, the issue that outbound socket is UDP I expected that contact will not contain ;transport=tls.

volga629


From: "volga629" [hidden email]
To: "Bogdan-Andrei Iancu" [hidden email]
Cc: "OpenSIPS users mailling list" [hidden email]
Sent: Wednesday, September 26, 2018 9:22:09 AM
Subject: Re: [OpenSIPS-Users] rewite contact

Hello Bogdan,
Yes, the issue that outbound socket is UDP I expected that contact will not contain ;transport=tls.

volga629

From: "Bogdan-Andrei Iancu" [hidden email]
To: "OpenSIPS users mailling list" [hidden email], "Slava Bendersky" [hidden email]
Sent: Wednesday, September 26, 2018 6:45:09 AM
Subject: Re: [OpenSIPS-Users] rewite contact

Hi Slava,

By definition mid_registrar *will* change the contact, mainly the user and domain part of the URI contact. The URI parameters are preserved. The transport too, unless you change the outbound socket (to a different protocol).

Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
OpenSIPS Bootcamp 2018
On 09/26/2018 05:19 AM, Slava Bendersky wrote:
Hello Everyone,
In which case mid_registrar will not rewrite contact ?
I see when present param ;transport=tls contact is not rewritten.
config

#### REGISTRAR module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2)
modparam("mid_registrar", "received_avp", "$avp(RECEIVED)")
modparam("mid_registrar", "max_contacts", 10)
modparam("mid_registrar", "tcp_persistent_flag", "TCP_PERSIST_REGISTRATIONS")
modparam("mid_registrar", "outgoing_expires", 7200)

code

if($proto=="TCP|tcp|TLS|tls") {
setflag(TCP_PERSIST_REGISTRATIONS);
}
mid_registrar_save("location","p1");
# Work arround for github issue #1109
append_hf("Path: <a href="sip:$fU@lan_ip:5060;transport=udp" title="sip:$fU@lan_ip:5060;transport=udp" moz-do-not-send="true"><sip:$fU@lan_ip:5060;transport=udp>\r\n");
xlog("L_INFO", "Forwarding REGISTER to main registrar ~> [$ct]\n");
}


Freeswitch contact

Contact: "" <a href="sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp" title="sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp" moz-do-not-send="true"><sip:101@192.168.1.65:5060;transport=tls;fs_path=sip%3A101%4010.30.100.41%3A5060%3Btransport%3Dudp>
Agent: Grandstream GXP1760W 1.0.1.74
Status: Registered(TLS)(unknown) EXP(2018-09-30 19:37:59) EXPSECS(429254)
Ping-Status: Reachable
Ping-Time: 0.00
Host: pbx04.domain.lan
IP: 10.30.100.41
Port: 5060
Auth-User: 101
Auth-Realm: domain.com
MWI-Account: [hidden email]
volga629




_______________________________________________
Users mailing list


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users