How to extract the Dialed Number From INVITE header

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
skb007
Posts: 152
Joined: Mon Oct 05, 2015 10:22 pm
Location: USA

How to extract the Dialed Number From INVITE header

Post by skb007 »

1. Brekeke Product Name and Version:3

2. Java version:1.8

3. OS type and the version:RHEL7

4. UA (phone), gateway or other hardware/software involved:NA

5. Your problem:

I am receiving different digits in INVITE and TO header. I would like to extract the phone number from the INVITE field instead of the To header.

INVITE sip:8005551212@10.10.10.10:5060;user=phone SIP/2.0

How do I extract 8005551212 into "%1" variable?
Tata
Posts: 223
Joined: Sun Jan 27, 2008 1:03 pm

Post by Tata »

Use $request variable in the Matching Patterns
https://docs.brekeke.com/sip/request

For example,
Matching Patterns
$request = ^INVITE
$request = sip:(.+)@
skb007
Posts: 152
Joined: Mon Oct 05, 2015 10:22 pm
Location: USA

Post by skb007 »

Thanks for your reply.

I was doing trial and error and it got it working with

$request = INVITE sip:(.+)@
Post Reply