[asterisk-users] question on SIP trunk and AMI to place call
Matthew Jordan
mjordan at digium.com
Thu Jan 24 12:46:46 CST 2013
On 01/24/2013 10:46 AM, Jerry Geis wrote:
> When I am monitoring the AMI I see the following event
> for a call I just made over a SIP trunk.
>
> Event: Newchannel
> Privilege: call,all
> Channel: SIP/testmachine-0000000d
> ChannelState: 0
> ChannelStateDesc: Down
> CallerIDNum:
> CallerIDName:
> AccountCode:
> Exten:
> Context: testmachine
> Uniqueid: 1359035395.20
>
> In this event or any event following I do not see
> the phone number that I dialled. How do I "correlate"
> the "SIP/testmachine-0000000d" to the number I just dialed????
> (purpose is to hangup the call later if I need to interrupt it)
>
> Now if I am using a machine with actual hardware cards, the phone
> number is included as part of the Channel so I can look that up.
> but for a SIP trunk the phone number dialled does not come over the AMI.
>
> How do I match up the call I just started (using AMI over SIP trunk) to
> the number I called?
>
You probably want the Dial event. It is raised both at the beginning of
the Dial, as well as when the Dial completes.
https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+ManagerEvent_Dial
Note that the Channel: field will contain the name initiating the Dial,
the Destination: field will contain the channel name being dialled, and
the Dialstring: field will contain the non-technology specific portion
of the thing being dialled.
For example:
exten => 500,1,Dial(SIP/digium02)
Results in:
Event: Dial
Privilege: call,all
SubEvent: Begin
Channel: SIP/10.x.x.x-00000002
Destination: SIP/digium02-00000003
CallerIDNum: 657-5309
CallerIDName: digium01
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
UniqueID: Asterisk-01-1359052866.2
DestUniqueID: Asterisk-01-1359052866.3
Dialstring: digium02
--
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
More information about the asterisk-users
mailing list