Did

Hello,

I want to retrieve the DID number from the SIP header. I get the following from SIP debug:

INVITE sip:xxxxxxxxx@ip_address:5060 SIP/2.0
Max-Forwards: 19
Session-Expires: 3600;Refresher=uac
Supported: timer
To: “SIPLineUser SIPLineUser” sip:xxxxxxxxx@ip_address:5060
From: sip:xxxxxxx@ip_address;tag=3416322225-500215
Contact: sip:xxxxxxx@ip_address:5060
P-Asserted-Identity:sip:xxxxxxx@ip_address
P-Preferred-Identity:sip:xxxxxxx@ip_address
Call-ID: 34772-3416322225-500179@domain
CSeq: 1 INVITE
Via: SIP/2.0/UDP ip_address:5060;branch=z9hG4bK30d9803258ee2c9298a3663b93f63
ede
Content-Type: application/sdp
Content-Length: 644

I have tried cutting it from the TO field but I only get the SIPLineUser line and not the DID number.

Thanks

You are trying to get the number that was dialed ? (Where the call is coming in ? )

Can’t you just use CALLERID if you want to grab the incoming DID?

No. The caller ID shows who is calling not what DID is being used ?

I hope you meant a DID # is the number of the caller. If so, my asterisk-1.4.19 running on my Fonera shows the number of the caller when I used CALLERID to grab the number.

Hi,

i know what you mean.
The Number or Name in the invite Adress is not the same which is on the To Field. In the To Field you will see which Number was dialed.
right?

Timm

[quote=“cpbx”]The Number or Name in the invite Adress is not the same which is on the To Field. In the To Field you will see which Number was dialed.
right?[/quote]
Can’t both the ${EXTEN} and ${MACRO_EXTEN} variables be used to show the content of To: field?