Forums Read-only archive

How to extract the Dialed Number From INVITE header

3 posts · Brekeke SIP Server Forum

skb007 Original post
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
Use $request variable in the Matching Patterns
https://docs.brekeke.com/sip/request

For example,
Matching Patterns
$request = ^INVITE
$request = sip:(.+)@
skb007
Thanks for your reply.

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

$request = INVITE sip:(.+)@