[asterisk-dev] app_alarmreceiver

Kaloyan Kovachev kkovachev at varna.net
Thu Jan 28 03:55:05 CST 2010


On Wed, 27 Jan 2010 19:24:20 +0000, Francisco Fernandes wrote 
> The idea.... 
> 
> based on app_mwanalyze and app_alarmreceiver, we could do something like this: 
> 

i don't know about app_mwanalyze, but basically yes, something like this
should work.
 I would prefer separating the tone detection in standalone app and sending
the dtmf (other processing) from the dialplan. This way you will be able to
transmit more than one message per call and to read the message form a
location (file/database) of choice

> 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 
> } 
> } 
> 
> 2010/1/27 Kaloyan Kovachev <kkovachev at varna.net> 
> Hi, 
> 
> On Wed, 27 Jan 2010 01:17:34 +0000, Francisco Fernandes wrote 
> 
> > Hi, 
> > Has anyone tried to do the reverse? meaning, send an ademco contact_id from 
> asterisk to an ademco central (receiver) ? how could one do this? does one 
> have to compile a new module or would it be possible to do it, using agi, or 
> something...? 
> > 
> > Thanks 
> 
> I have not tried, but it should be possible. The simpliest way is to just 
> send the DTMFs of the message few seconds after answer and to hope it is 
> corectly received. 
> 
> In order to be sure it is correctly received you will need to make 
> application which will detect the ACK and kissoff signals (no DSP routines in 
> asterisk for this) returning a variable, which one have been received. Then in 
> the dialplan wait for ACK tone (1400Hz 100ms folowed by 2300Hz 100ms) before 
> you start sending DTMF, then wait for kissoff (1400Hz 900ms) to confirm 
> correctness or another ACK to repeat it. 
>  
> -- 
> _____________________________________________________________________ 
> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- 
> 
> asterisk-dev mailing list 
> To UNSUBSCRIBE or update options visit: 
> http://lists.digium.com/mailman/listinfo/asterisk-dev 
>




More information about the asterisk-dev mailing list