[asterisk-dev] app_alarmreceiver

Francisco Fernandes ff.vipvoz at gmail.com
Wed Jan 27 11:17:45 CST 2010


The idea....


based on app_mwanalyze and app_alarmreceiver, we could do something like
this:

 exten => 8000,1,AlarmTransmitter(ZAP/
00102312314,101);


then app_AlarmTransmitter.c

function detect_tones(frequency, duration)

function detect_ack()
{
        while (!detect_tones(1400,50)){
             <count time, for timeout-> in case of timeout -> break ,
hangup, try again, count tries>
             if detect -< t1=true, break;
        }
      sleep 50 ms
     while (!detect_tones(2300,50)){
             <count time, for timeout-> in case of timeout -> break ,
hangup, try again, count tries>
             if detect -< t2=true, break;
        }
       if (t1 and t2) return true else false;
}

static int alarmtransmitter_exe(struct ast_channel *chan, void *data)
{
      if (detect_ack())
      {
            transmit message, thru dtmf
      }
     if (detect_kissoff())
     {
         set variable to true
     }
    else
    {
         set variable to false
     }
  }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20100127/5ed76bcf/attachment.htm 


More information about the asterisk-dev mailing list