[Home]

Summary:ASTERISK-19634: Sending DTMF tones using the AMI through the agent proxy channel doesnt work as expected
Reporter:Dan Jenkins (danjenkins)Labels:
Date Opened:2012-04-04 05:57:50Date Closed:2012-08-29 08:57:59
Priority:MajorRegression?
Status:Closed/CompleteComponents:Core/ManagerInterface
Versions:1.8.9.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:AMI,CentOS,XorcomAttachments:( 0) ASTERISK_19634_log
Description:I'm trying to send DTMF tones using the AMI to a call generated and connected to the agent proxy channel. However It doesn't work as expected. I get back an AMI DTMF successfully queued event after sending the request, but I never receive a "played" event and can't hear the tone on the other end of the phone call.

Below are some examples, please excuse the format, my NodeJS module returns the information in json format, I can get the raw output from the AMI if absolutely necessary, it's just not as easy to do than the current format.

I have 3 examples, the first is the DTMF tone events coming from a SIP phone whilst logging into the Agent Channel. Ignore the "identifier" block of the json, however everything else is as it comes back from the AMI, just in JSON format.

{noformat}
Tue, 03 Apr 2012 16:00:36 GMT Uncaught event: OriginateResponse - {"event":"OriginateResponse","privilege":"call,all","actionid":"79769627843052140","response":"Success","channel":"SIP/3467-00001406","context":"agentlogin","exten":"*88883467","reason":"4","uniqueid":"1333468832.72586","calleridnum":"<unknown>","calleridname":"Agent Login","identifier":"ami"}  
Tue, 03 Apr 2012 16:00:40 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/3467-00001406","uniqueid":"1333468832.72586","digit":"3","direction":"Received","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:00:40 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/3467-00001406","uniqueid":"1333468832.72586","digit":"3","direction":"Received","begin":"No","end":"Yes","identifier":"ami"}  
Tue, 03 Apr 2012 16:00:41 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/3467-00001406","uniqueid":"1333468832.72586","digit":"4","direction":"Received","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:00:41 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/3467-00001406","uniqueid":"1333468832.72586","digit":"4","direction":"Received","begin":"No","end":"Yes","identifier":"ami"}  
Tue, 03 Apr 2012 16:00:41 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/3467-00001406","uniqueid":"1333468832.72586","digit":"6","direction":"Received","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:00:41 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/3467-00001406","uniqueid":"1333468832.72586","digit":"6","direction":"Received","begin":"No","end":"Yes","identifier":"ami"}  
Tue, 03 Apr 2012 16:00:42 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/3467-00001406","uniqueid":"1333468832.72586","digit":"7","direction":"Received","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:00:42 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/3467-00001406","uniqueid":"1333468832.72586","digit":"7","direction":"Received","begin":"No","end":"Yes","identifier":"ami"}  
Tue, 03 Apr 2012 16:00:43 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/3467-00001406","uniqueid":"1333468832.72586","digit":"#","direction":"Received","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:00:43 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/3467-00001406","uniqueid":"1333468832.72586","digit":"#","direction":"Received","begin":"No","end":"Yes","identifier":"ami"}
{noformat}

As you can see, the call is requested and you can see the DTMF tone being played, these events come through.

This example is a call being generated through the AMI, a response to that, a debug message to state that the call is being bridged between the caller and agent 3467. After this, a load of DTMF events being sent from the customer's end over a SIP trunk. As you can see, Asterisk receives these events and plays them back, the agent can hear these.

{noformat}
//dtmf from connected phone - customer
Tue, 03 Apr 2012 16:02:49 GMT Uncaught event: OriginateResponse - {"event":"OriginateResponse","privilege":"call,all","actionid":"26441132626496256","response":"Success","channel":"Agent/3467","context":"from-internal","exten":"07872992670","reason":"4","uniqueid":"1333468969.72587","calleridnum":"<unknown>","calleridname":"Dan Jenkins","identifier":"ami"}  
Tue, 03 Apr 2012 16:02:57 GMT sending call event to AGENT 3467  
Tue, 03 Apr 2012 16:03:07 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/voipcheap-00001407","uniqueid":"1333468969.72588","digit":"2","direction":"Received","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:07 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"Agent/3467","uniqueid":"1333468969.72587","digit":"2","direction":"Sent","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:07 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/voipcheap-00001407","uniqueid":"1333468969.72588","digit":"2","direction":"Received","begin":"No","end":"Yes","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:07 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"Agent/3467","uniqueid":"1333468969.72587","digit":"2","direction":"Sent","begin":"No","end":"Yes","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:10 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/voipcheap-00001407","uniqueid":"1333468969.72588","digit":"5","direction":"Received","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:10 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"Agent/3467","uniqueid":"1333468969.72587","digit":"5","direction":"Sent","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:10 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/voipcheap-00001407","uniqueid":"1333468969.72588","digit":"5","direction":"Received","begin":"No","end":"Yes","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:10 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"Agent/3467","uniqueid":"1333468969.72587","digit":"5","direction":"Sent","begin":"No","end":"Yes","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:11 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/voipcheap-00001407","uniqueid":"1333468969.72588","digit":"8","direction":"Received","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:11 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"Agent/3467","uniqueid":"1333468969.72587","digit":"8","direction":"Sent","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:11 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/voipcheap-00001407","uniqueid":"1333468969.72588","digit":"8","direction":"Received","begin":"No","end":"Yes","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:11 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"Agent/3467","uniqueid":"1333468969.72587","digit":"8","direction":"Sent","begin":"No","end":"Yes","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:12 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/voipcheap-00001407","uniqueid":"1333468969.72588","digit":"0","direction":"Received","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:12 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"Agent/3467","uniqueid":"1333468969.72587","digit":"0","direction":"Sent","begin":"Yes","end":"No","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:13 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"SIP/voipcheap-00001407","uniqueid":"1333468969.72588","digit":"0","direction":"Received","begin":"No","end":"Yes","identifier":"ami"}  
Tue, 03 Apr 2012 16:03:13 GMT Uncaught event: DTMF - {"event":"DTMF","privilege":"dtmf,all","channel":"Agent/3467","uniqueid":"1333468969.72587","digit":"0","direction":"Sent","begin":"No","end":"Yes","identifier":"ami"}
{noformat}

Thirdly, the agent tries to send DTMF tones using the AMI command and the Agent Proxy Channel. This has also been tried attaching the playback to the SIP channel the agent is logged in with, but this has the same outcome. In the example, you can see the information that was sent ("PlayDTMF") and the response saying that the DTMF tones had been successfully queued. However, you never receive the corresponding "DTMF" event, and the person on the other end of the call never receives the tone.

{noformat}
{ action: 'PlayDTMF',
 channel: 'Agent/3467',
 digit: '8',
 ActionID: 91302454913966350 }
Tue, 03 Apr 2012 16:03:55 GMT Uncaught event: no event - {"response":"Success","actionid":"91302454913966350","message":"DTMF successfully queued","identifier":"ami_send_recieve"}  
{ action: 'PlayDTMF',
 channel: 'Agent/3467',
 digit: '2',
 ActionID: 81097833276726300 }
Tue, 03 Apr 2012 16:04:08 GMT Uncaught event: no event - {"response":"Success","actionid":"81097833276726300","message":"DTMF successfully queued","identifier":"ami_send_recieve"}  
{noformat}

Either the AMI should be telling me that the DTMF hasn't been queued due to the Agent Channel not supporting this functionality or the tone should be played. If this isn't the correct way of doing this, how do I go about playing DTMF tones on a call for an agent so that it gets actioned the other end of the call? Whether that be Agent Proxy to Another Agent Proxy / Agent Proxy to normal extension / Agent Proxy to an AGI script / Agent Proxy to external caller through DAHDI/SIP/IAX.

Please let me know if you need any more information.

Dan Jenkins
Comments:By: Matt Jordan (mjordan) 2012-04-06 11:45:46.332-0500

We require a complete debug log to help triage the issue. This document will provide instructions on how to collect debugging logs from an Asterisk machine for the purpose of helping bug marshals troubleshoot an issue: https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information



By: Dan Jenkins (danjenkins) 2012-04-06 14:42:19.511-0500

I'm unavailable to get this until next Tuesday due to bank holidays in the UK, but I will update once I have this information. For information this was an issue on 1.8.7 and 1.8.8RC2, I hadn't tried this before these versions.

By: Matt Jordan (mjordan) 2012-05-02 08:27:00.374-0500

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.  Further information can be found at http://www.asterisk.org/developers/bug-guidelines



By: Dan Jenkins (danjenkins) 2012-05-02 08:51:04.290-0500

Hi Matt,

Sorry I haven't been able to get this as I'm in the middle of migrating our phone system over to Asterisk and just haven't had the time to get this debug, I now have a debugging box so will hopefully get the required logs within the next week.

I will get it reopened once I have these. Thank you,

Dan

By: Matt Jordan (mjordan) 2012-05-02 09:25:15.436-0500

Dan:

Not a problem.  If you're still active, I'll reopen this and put it back into Waiting for Feedback.

Thanks,

Matt

By: David Woolley (davidw) 2012-05-02 12:13:27.685-0500

An AMI initiated DTMF sent to the SIP channel of the agent, would go to the agent, not the caller.  I would expect the same to be true of one sent to the Agent channel....Checked, yes, the digit would go towards the operator.

One directed to the SIP channel should bypass the agent logic.

You won't get the traces that you are looking for, because the operation is performed using a special API on the channel driver, rather than by using ast_write with a digit control frame, but the trace for the outbound digit is generated by ast_write.

To do what I think you want to do, you need to locate the caller's channel and send the DTMF to that, or interpose a Local channel between the agent SIP channel and the Agent channel, and inject the DTMF on the ;2 side of that (AgentLogin agents - probably not possible for AgentCallbackLogin, but that is deprecated).



By: Dan Jenkins (danjenkins) 2012-05-02 12:43:40.209-0500

David, this is exactly what I think Asterisk should be able to handle. I've tried sending the DTMF to the caller's channel and that doesn't work either, if it did I would be happy with that solution. I will double check this when I'm getting a trace (if this is required to get this moving further). I shouldn't have to interpose a local channel between the agent's sip channel and the agent proxy channel to get this to work, surely Asterisk should be able to deal with it?

Currently in the AMI these are the parameters in PlayDTMF
[Syntax]
Action: PlayDTMF
[ActionID:] <value>
Channel: <value>
Digit: <value>

Couldn't asterisk handle this and another param added of "direction" (like what's in the MuteAudio action), to say in which direction the tone should be played, towards the agent or the caller. Of course this would only work for AgentLogin and not AgentCallbackLogin as that is deprecated.

What do you think?

I will get a trace this/early next week and try and get as much information as possible and attach it to this Jira.

My view is that Asterisk should deal with this much better than it does currently (I'd also like a solution for right now without having to make extra channels etc - not sure how I would go about doing what you suggested, how would I go about doing that?)

Thanks,

Dan

By: Dan Jenkins (danjenkins) 2012-05-09 04:09:13.189-0500

Generated 3 calls via SIP -> Agent Proxy <- Local DID attached to sip trunk

First call, played DTMF on agent channel
Second call, played DTMF on agent's sip channel

Both times the agent could hear the tone

Third call, played the DTMF on the connected channel of the customer and the customer could hear the tone.

Looks as though this has been fixed in some way since I tried to reproduce last time.I'm testing this on 1.8.11 as we're just about to update to Certified.

However, I still think this should act the same was as Mute does within the AMI.

For example, if an agent rings an internal extension, it goes through to voicemail, there is no channel to connect to, to send the DTMF tone... as you are connecting to Voicemail..there is no SIP channel. If the change isn't made, how am I meant to deal with the above situation? Make some fake local channels? I just don't see this as a nice solution at all.

I will feedback once I have double made sure that this works as expected over DAHDI etc, my test rig isn't currently connected via DAHDI. I will let you know the results of this.

By: Rusty Newton (rnewton) 2012-07-19 17:30:55.677-0500

bq. I will feedback once I have double made sure that this works as expected over DAHDI etc, my test rig isn't currently connected via DAHDI. I will let you know the results of this.

Dan, do you have any additional test results, or should we close this one out as not reproducible?

By: Dan Jenkins (danjenkins) 2012-08-29 09:04:10.127-0500

Hey,

Sorry, I meant to close this a while back. I tried to recreate this but I couldn't. So obviously something either got fixed inbetween versions or I was doing something wrong...

Thanks for all your help in this,

Dan