[asterisk-dev] Using Diversion: for follow-me w/ taqua switches?
Mark Michelson
mmichelson at digium.com
Thu Aug 13 17:55:04 CDT 2009
Philip A. Prindeville wrote:
> Has anyone had any luck using Diversion: with Taqua switches?
>
> I've been trying to test it out by hand... incoming calls to my
> extension also ring on my cell phone, but unfortunately only give the
> caller-id of our company's trunk #, not the original inbound call.
>
> Jared helped me cobble up the following:
>
> TRUNK=SIP/sip_proxy-out
> ...
> CELL=Local/208xxxxxxxx at follow-me
> PHILIP=SIP/bedroom_1&SIP/office_2&SIP/remote_2&SIP/kitchen_1&${CELL}
> ...
>
> [redfish-extens]
> exten => 111,1,Noop(Exten: ${EXTEN})
> exten => 111,n,Macro(stdexten,111,${PHILIP},redfish)
> exten => 111,n,Goto(s,exten)
> ...
>
> ; we assume that the extension is a 10-digit NANP number, and that we reach it via ${TRUNK}/${EXTEN}
> ; this is a fairly simply minded assumption, but it works for now in our trivial environment.
>
> [follow-me]
> exten => _NXXXXXXXXX,1,Log(NOTICE,Follow-me: ${EXTEN})
> exten => _NXXXXXXXXX,n,Set(PEER=${CUT(GLOBAL(TRUNK)|/|2)})
> exten => _NXXXXXXXXX,n,Set(IP=${SIPPEER(${PEER})})
> exten => _NXXXXXXXXX,n,Set(URI=<sip:${CALLERID(num)}@${IP}>)
> exten => _NXXXXXXXXX,n,SIPAddHeader(Diversion: ${QUOTE(${CALLERID(name)})} ${URI}\;reason=follow-me\;privacy=off)
> ; let the desk phones ring a bit before trying external lines...
> exten => _NXXXXXXXXX,n,Wait(10)
> exten => _NXXXXXXXXX,n,Dial(${GLOBAL(TRUNK)}/${EXTEN})
>
>
>
> Alas, the switch barfs:
>
> INVITE sip:208mmmmmmmm at y.y.y.y SIP/2.0
> Via: SIP/2.0/UDP x.x.x.x:5060;branch=z9hG4bK0d631355;rport
> From: "Bob Barker" <sip:208nnnnnnn at x.x.x.x>;tag=as370ea433
> To: <sip:208mmmmmmmm at y.y.y.y>
> Contact: <sip:208nnnnnnn at x.x.x.x>
> Call-ID: 368667cf4094cb4f53d30de5509dbad5 at x.x.x.x
> CSeq: 102 INVITE
> User-Agent: Asterisk PBX
> Max-Forwards: 70
> Date: Wed, 12 Aug 2009 05:58:14 GMT
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
> Supported: replaces
> Diversion: "Bob Barker" <sip:206oooooo at y.y.y.y>;reason=follow-me;privacy=off
> Content-Type: application/sdp
> Content-Length: 265
>
> v=0
> o=root 26495 26495 IN IP4 x.x.x.x
> s=session
> c=IN IP4 x.x.x.x
> t=0 0
> m=audio 17718 RTP/AVP 0 3 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:3 GSM/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=silenceSupp:off - - - -
> a=ptime:20
> a=sendrecv
>
> ...
> pbx*CLI>
> <--- SIP read from y.y.y.y:5060 --->
> SIP/2.0 500 Server Internal Error
> Via: SIP/2.0/UDP x.x.x.x:5060;branch=z9hG4bK0d631355;rport
> From: "Bob Barker" <sip:208nnnnnnnn at x.x.x.x>;tag=as370ea433
> To: <sip:208mmmmmmmm at y.y.y.y>
> Call-ID: 368667cf4094cb4f53d30de5509dbad5 at x.x.x.x
> CSeq: 102 INVITE
> Content-Length: 0
>
>
> Doh!!!!
>
> Anyone else had any luck with this? Is there anything bogus looking in my Diversion header?
>
That Diversion header looks fine by me. "follow-me" is a documented reason
parameter, and "off" is a documented privacy parameter in the Diversion header
draft. The fact that the server is responding with a 5XX response is indicative
that the problem is on their end and not in your request.
Mark Michelson
More information about the asterisk-dev
mailing list