[asterisk-users] Ringing detection ?

Nicolas Ross rossnick-lists at cybercat.ca
Thu Apr 12 15:08:01 CDT 2012


Hi !

I have an application where I originate a call with a call file and play 
some pre-recorded message when the person answers. And it's working 
correctly.

Now, I've been asked to add the support for extenstion numbers.

I've been able to actualy send the extension numbver via the SendDTMF 
command. It works perfectly. But after the dtmf have been sent, the 
dialplan shoud wait for someone to answer.

The problem is that during that time, the phone is rining. So withing 
north-america, it's typicly ring 2 secs, silence 4 seconds.

So, I could use AMD() WaitForSilence(4100) for exemple. But that would 
require the person at the other end to be silent for 4 seconds. That's 
unrealistic.

So, I'm searching for a way for my dialplan to detect ringing and only 
lauch Amd/WaitforSilence after the person answers...

My curent ael dialplan for my originated call is :

   500 => {
     Answer();
     Wait (1);
     if (${LEN(${noPoste})})
     {
       SendDTMF(${noPoste});
     }
     Background(silence/1);
     AMD();
     WaitForSilence(500);
     for (x=0; ${x} < 3; x=${x} + 1) {
       Background(outcall/outcall-${idJob});
       Background(outcall-confirm);
       WaitExten(5);
     };
     goto diffuseurappel|3|1;
   };

Any ideas ?



More information about the asterisk-users mailing list