Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
Strip square brackets in Via/received for ipv6 REG response
Author Message
gary_d
Brekeke Newbie


Joined: 16 Nov 2023
Posts: 3

PostPosted: Fri Nov 17, 2023 1:42 am    Post subject: Strip square brackets in Via/received for ipv6 REG response Reply with quote

1. Brekeke Product Name and Version:
3.14.3.5/560
2. Java version:
OpenJDK 64-Bit Server VM 11.0.20
3. OS type and the version:
Ubuntu Linux
OS verion 5.4.0-163-generic
OS architecture amd64
4. UA (phone), gateway or other hardware/software involved:
TG2492 cable modem
5. Your problem:
During registration CM SIP Parser gets SIP/2.0 200 OK response from BSS with the following Via header
Code:
Session Initiation Protocol (200)
    Status-Line: SIP/2.0 200 OK
...
    Message Header
   Via: SIP/2.0/UDP [3005:3003:100::d10f]:5060;branch=z9hG4bK-a3a0d-27f2c43a-4ad98d86;received=[2001:580:2f1b:317::20]

and fails to parse square brackets in
Code:
received=[2001:580:2f1b:317::20]

Can I strip square brackets in received=[ipv6] param via Dial Plan rules or other? Could you provide a match/deploy pattern example?
Back to top
View user's profile
Tata
Brekeke Master Guru


Joined: 27 Jan 2008
Posts: 223

PostPosted: Fri Nov 17, 2023 6:01 pm    Post subject: Reply with quote

Try DialPlan rule like this.

Matching Patterns
$request = ^REGISTER
$addrtype = 6
$param(Via,"received") = \[(.+)\]
$removeparam(Via,"received") = (.+)
Deploy Patterns
Via = %2;received=%1
$continue = true
Back to top
View user's profile
gary_d
Brekeke Newbie


Joined: 16 Nov 2023
Posts: 3

PostPosted: Sun Nov 19, 2023 8:56 pm    Post subject: Reply with quote

It just works. Thanks a lot.
Back to top
View user's profile
gary_d
Brekeke Newbie


Joined: 16 Nov 2023
Posts: 3

PostPosted: Thu Nov 23, 2023 6:07 am    Post subject: Reply with quote

Tata wrote:
Try DialPlan rule like this.

Matching Patterns
$request = ^REGISTER
$addrtype = 6
$param(Via,"received") = \[(.+)\]
$removeparam(Via,"received") = (.+)
Deploy Patterns
Via = %2;received=%1
$continue = true

Hello. A bit more on topic. Brackets in "received" param also live in status messages like 100 Trying/180 Ringing. Is there a way to strip them there too?
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Page 1 of 1