Дорофеев Сергей
2015-Sep-17 10:37 UTC
[asterisk-users] how to get an info from "To:" header?
Hello list! 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?})" Could you kindly help me, please? WBR, Dorofeev Sergey ________________________________ ??? ??????????? ????????? ? ????? ?????????, ??????????? ? ????, ???????? ???????????????? ?????????? ? ????????????? ????????????? ??? ????????????? ???????????? ????????, ?????????? ??? ??????????? ?????, ???????? ??? ??????????. ?????????? ??? ? ???, ??? ???? ??? ????????? ?? ????????????? ???, ?????????????, ???????????, ??????????????? ??????????, ???????????? ? ????????? ?????????, ? ????? ????????????? ????? ???????? ?? ?????? ???? ??????????, ?? ???????????. ???? ?? ???????? ??? ??????????? ????????? ?? ??????, ??????????, ????????? ? ???????????? ? ??????? ??????????? ????????? ? ????? ?????, ???????????? ? ???, ? ?????????? ???????????????. ???????. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20150917/707ceca9/attachment.html>
Administrator TOOTAI
2015-Sep-17 11:33 UTC
[asterisk-users] how to get an info from "To:" header?
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