Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
How to extract the Dialed Number From INVITE header
Author Message
skb007
Brekeke Guru


Joined: 05 Oct 2015
Posts: 152
Location: USA

PostPosted: Thu Apr 30, 2020 10:32 am    Post subject: How to extract the Dialed Number From INVITE header Reply with quote

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?
Back to top
View user's profile
Tata
Brekeke Master Guru


Joined: 27 Jan 2008
Posts: 223

PostPosted: Thu Apr 30, 2020 3:09 pm    Post subject: Reply with quote

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

For example,
Matching Patterns
$request = ^INVITE
$request = sip:(.+)@
Back to top
View user's profile
skb007
Brekeke Guru


Joined: 05 Oct 2015
Posts: 152
Location: USA

PostPosted: Thu Apr 30, 2020 3:20 pm    Post subject: Reply with quote

Thanks for your reply.

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

$request = INVITE sip:(.+)@
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