Author Topic: How to Generate a series of DTMF tones  (Read 7842 times)

jamie

  • Newbie
  • *
  • Posts: 38
    • View Profile
How to Generate a series of DTMF tones
« on: March 06, 2016, 08:51:11 PM »
Hi,

Please could I ask for some help ?

I would like to generate a series of DTMF tones ?

I can generate a single tone with the following PHP:

Code: [Select]

        $m = new Yate("chan.dtmf");
        $m->params["targetid"] = $this->channel_id;
        $m->params["text"] = '1234';
        $m->Dispatch();



However if I try a string, for example '1234', it appears to play them, but very quickly, almost on top of each-other.

I've been trying to insert a pause using the usual suspects like 'p', ',' etc, but no luck, it doesn't work.

Is the method I've described above possible or should I be looking at another solution ?

Thank you!
Jamie


( Installation is Windows  )
« Last Edit: March 06, 2016, 08:52:51 PM by jamie »

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: How to Generate a series of DTMF tones
« Reply #1 on: March 07, 2016, 02:17:54 AM »
Usually the modules sending the DTMFs use a loop to push an array of tones.
If the destination device can't process them you may use a loop in the php code to send single tones.
This will insert some time between tones.
You may also sleep some time between tones in the php code.

jamie

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: How to Generate a series of DTMF tones
« Reply #2 on: March 07, 2016, 09:04:32 AM »

Hi Marian,

Thanks for the reply, much appreciated.

I thought that might be the case!

Is there any mileage using the tone generator ?

I was reading this

dtmfstr/XXXXX - an entire sequence of DTMF tones

from this page:

http://docs.yate.ro/wiki/Tonegen


marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: How to Generate a series of DTMF tones
« Reply #3 on: March 07, 2016, 09:22:08 AM »
Tonegen module generates inband tones.
The destination must have a tone detector in order to be able to detect the audio tones.

Using chan.dtmf you can send out of band tones (e.g. on sip you can send them using RFC 2833 - as RTP events - or SIP INFO signalling).

jamie

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: How to Generate a series of DTMF tones
« Reply #4 on: March 07, 2016, 09:36:04 AM »

Thanks Marian,

I'll stick with 'chan.dtmf ', it seems the better solution all round !

Thanks again for your help !

Regards
Jamie