[asterisk-users] [SOLVED] PlayDTMF and Asterisk Manager

Steve Murphy murf at digium.com
Thu Jul 12 13:51:38 CDT 2007


On Thu, 2007-07-12 at 12:54 +0000, lemmel lemmel wrote:
> So I'm back on this matter (I thus give enough time for a good samartan to 
> help), and now, I think that PlayDTMF is not designed for what I want to do 
> :


I've done this, and yes, you are correct, PlayDTMF is the wrong thing,
it goes in the wrong direction.

There is no app to do this; but you can do it in the code:


   struct channel *chan;
   int j;
   struct ast_frame f = { AST_FRAME_DTMF, };
   char *str = "#2";
   /* Send the feature code to the PBX as DTMF, as if the handset had
sent it */
   f.len = 100;
   for (j=0; j < strlen(str); j++) {
        f.subclass = str[j];
        ast_queue_frame(chan, &f);
        ast_verbose("* DTMF-relay event faked: %c\n", f.subclass);
   }


Where chan is the channel to inject the dtmf.

Maybe a small App to do this might be handy... it would give users just
enough rope to... (*cough*)

murf

 
-- 
Steve Murphy
Software Developer
Digium
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3227 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20070712/80b93ae2/attachment.bin 


More information about the asterisk-users mailing list