[asterisk-users] how to get an info from "To:" header?
Administrator TOOTAI
admin at tootai.net
Thu Sep 17 06:33:37 CDT 2015
Le 17/09/2015 12:37, Дорофеев Сергей a écrit :
> Hello list!
Hello
>
> Sorry for kinda dumb question, I guess, but I have too little time to
> research it by myself.
>
> I have a SIP packet, which looks like this:
>
> <--- SIP read from UDP:10.186.0.38:5060 --->
>
> INVITE sip:XXXXXXX at 10.186.35.98:5060;user=phone SIP/2.0
>
> Via: SIP/2.0/UDP 10.186.0.38:5060;branch=z9hG4bKh4utm43008vheqk093b0.1
>
> Call-ID: ba9vp4zsbbsfi0vagdafg0vpzpp0z9wh at SoftX3000
>
> From: <sip:495XXXXXXX at 10.186.0.38;user=phone>;tag=zwbzfehp-CC-22
>
> To: <sip:38XXXXXXX at 10.186.35.98:5060;user=phone>
>
> CSeq: 1 INVITE
>
> Contact: <sip:495XXXXXXX at 10.186.0.38:5060;transport=udp>
>
> Min-SE: 90
>
> Session-Expires: 300
>
> Allow:
> INVITE,ACK,OPTIONS,BYE,CANCEL,REGISTER,INFO,PRACK,SUBSCRIBE,NOTIFY,UPDATE,MESSAGE,REFER
>
> User-Agent: Huawei SoftX3000 V300R011
>
> Diversion:
> <sip:38XXXXXXX at 10.248.82.4;user=phone>;reason=unconditional;counter=1
>
> Supported: 100rel,timer
>
> Max-Forwards: 69
>
> Content-Length: 338
>
> Content-Type: application/sdp
>
> Priority: urgent
>
> I need to use info from fields “To:” and “Contact:” later in my
> dialplan. I belive, I have to do something like “exten =>
> _/X.,1,Set(VAR=${WHAT/_SHOULD_I_TYPE_HERE?})”
Sample:
exten => s,1,Set(__DIALEDNUMBER=${SIP_HEADER(TO):5})
exten => s,n,Set(__DIALEDNUMBER=${CUT(DIALEDNUMBER,@,1)})
...
Regards
--
Daniel
More information about the asterisk-users
mailing list