Strip square brackets in Via/received for ipv6 REG response

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
gary_d
Posts: 3
Joined: Thu Nov 16, 2023 10:58 pm

Strip square brackets in Via/received for ipv6 REG response

Post by gary_d »

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: Select all

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: Select all

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?
Tata
Posts: 223
Joined: Sun Jan 27, 2008 1:03 pm

Post by Tata »

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
gary_d
Posts: 3
Joined: Thu Nov 16, 2023 10:58 pm

Post by gary_d »

It just works. Thanks a lot.
gary_d
Posts: 3
Joined: Thu Nov 16, 2023 10:58 pm

Post by gary_d »

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?
Post Reply