I’m really new to telephony and asterisk and I’ve been given the task of looking after our Mitel and Asterisk setup.
I’ve been given the task of writing a system whereby you can perform an attended transfer.
The setup is as follows:
Mitel HX controller with SIP extensions
Asterisk 13.21-cert3 connected to the Mitel as a SIP extension
I want to be able to:
- Take a call on the asterisk
- Place that call on hold
- Make an outgoing call to someone else e.g. an engineer
- If the engineer is available, I give the info and transfer the original call to the engineer
Now - It’s possible for me to do this via the AMI:
Action: Originate Channel: SIP/6001 Context: from-internal Exten: 1502 CallerIDName: Andy Priority: 1 Callerid: 1234 Timeout: 30000 ActionID: 1 Action: Redirect Channel: SIP/6001-00000070 Exten: 801234123123 Context: from-internal Priority: 1
however it holds up the channels and my SIP extension on the Mitel will not be usable until the call is cleared. It seems that the AMI is only really concerned with calls within the scope asterisk SIP client as opposed to the Mitel SIP extension that it connects to.
What I need to do is tell the Mitel extension connected to asterisk (not my SIP client on asterisk) to hold the call and then SIP refer to the external engineer on another line so the internal channels are freed up and ready to take calls.
e.g. if I query the calls:
Action: Command Command: core show channels concise Response: Follows Privilege: Command SIP/mitel-0000001c!from-mitel!!1!Up!AppDial!(Outgoing Line)!1506!!!3!38!e2207eb2-e3cb-4e92-9705-728701709404!1541432516.49 SIP/mitel-0000001b!from-internal!800987654321!1!Up!Dial!SIP/80123123123@mitel!1506!!!3!186!e2207eb2-e3cb-4e92-9705-728701709404!1541432367.47
which shows that the channels are taken up in asterisk, I don’t want the asterisk to do this - I want it to be done on the Mitel side. Anyone know how to achieve this?
I’ve done a packet capture of a standalone SIP phone doing a transfer and caught the SIP packet performing the REFER:
REFER sip:firstname.lastname@example.org:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.148.53:5060;branch=z9hG4bK1299050164 From: "1309" <sip:email@example.com:5060>;tag=2502563425 To: <sip:firstname.lastname@example.org:5060>;tag=Mitel-5000_612337215-27353 Call-ID: email@example.com CSeq: 4 REFER Contact: <sip:firstname.lastname@example.org:5060> Authorization: Digest username="big4int", realm="Mitel-5000-ICP", nonce="2e5a0816c63ff73ad2b05e5af93ccd1b", uri="sip:email@example.com:5060", response="fd1a04f37bacdf8f05b801ca2c059ba7", algorithm=MD5, cnonce="0a4f113b", opaque="Mitel-5000-ICP", qop=auth, nc=00000003 Max-Forwards: 70 User-Agent: Yealink SIP-T21P_E2 220.127.116.11 Refer-To: <sip:firstname.lastname@example.org:5060?Replaces=562748312-27353%3Bto-tag%3DMitel-5000_562748375-27353%3Bfrom-tag%3D525589203> Event: refer Referred-By: "1309" <sip:email@example.com:5060> Content-Length: 0
So - in effect I want to simulate this SIP command but within the context of using the AMI in asterisk - is this possible?
Or maybe to put it another way - how do I avoid Asterisk issuing out an INVITE and thus creating a bridge? Is there a way of forcing a REFER ?
I’ve tried to make this clear - apologies if I’ve missed out any important info, I’m totally new to this!