Search code examples
asteriskvoipasteriskami

Asterisk AMI PlayDTMF to instantiate disconnect key combination in features.conf


I'm currently having a play about with AMI. I seem to of hit a snag where utilising the 'PlayDTMF' action will go out on the channel rather than be seen as incoming DTMF.

This is a bit of an issue, I've provided my features.conf file config below:

Builtin Feature           Default Current
---------------           ------- -------
Pickup                    *8      *8
Blind Transfer            #       #
Attended Transfer                 *2
One Touch Monitor
Disconnect Call           *       *99
Park Call                         #72
One Touch MixMonitor

I'm wanting to execute the *99 key combination over AMI to allow the call to disconnect. My AMI Action looks like this (developed in nodejs):

ami.action({
    'action': 'playdtmf',
    'channel': e.channel, //this is the callers channel
    'digit': '*99'
}, function (err, res) {
    console.log(err);
    console.log(res);
});

I receive a JSON response which tells me everything has been queued successfully.

{ response: 'Success',
  actionid: 'xxx',
  message: 'PlayDTMF successfully queued' }

There is an answer here which leaves me trying to fill in the blanks. It has reference to interposing a Local channel on the first leg. How would I go about interposing a local channel while I have an ongoing call?


Solution

  • You dooing something very weird.

    If you need disconnect, just use transfer to hangup extension. No need send dtmf events.

    However if you have inband dtmf, you can create enother channel via originate, do chanSpy to any leg of any call and send dtmf.