I've set up an outbound .call system for customer callbacks and the like. Calls are going out over analog lines and I'm trying to use the WaitForSilence routine to make sure the phone has stopped ringing before starting message playback. The problem is that if I set the first argument of WaitForSilence to anything other than 1, WaitForSilence never exits. Some general info on my setup: more /proc/version: **** Linux version 2.6.16.60-0.34-smp (geeko at buildhost) (gcc version 4.1.2 20070115 (SUSE Linux)) #1 SMP Fri Jan 16 14:59:01 UTC 2009 **** Asterisk Version: **** Connected to Asterisk 1.6.1.0 currently running on ivueivrtest (pid 1639) **** dahdi version: 2.2.0-rc4 /etc/dahdi/system.conf **** # Autogenerated by /usr/sbin/dahdi_genconf on Thu May 21 11:50:14 2009 # If you edit this file and execute /usr/sbin/dahdi_genconf again, # your manual changes will be LOST. # Dahdi Configuration File # # This file is parsed by the Dahdi Configurator, dahdi_cfg # # Span 1: WCTDM/0 "Wildcard TDM2400P Board 1" (MASTER) fxsks=1 echocanceller=mg2,1 fxsks=2 echocanceller=mg2,2 fxsks=3 echocanceller=mg2,3 fxsks=4 echocanceller=mg2,4 # Global data loadzone = us defaultzone = us **** /etc/asterisk/dahdi-channels.conf **** ; Autogenerated by /usr/sbin/dahdi_genconf on Thu May 21 11:50:15 2009 ; If you edit this file and execute /usr/sbin/dahdi_genconf again, ; your manual changes will be LOST. ; Dahdi Channels Configurations (chan_dahdi.conf) ; ; This is not intended to be a complete chan_dahdi.conf. Rather, it is intended ; to be #include-d by /etc/chan_dahdi.conf that will include the global settings ; ; Span 1: WCTDM/0 "Wildcard TDM2400P Board 1" (MASTER) ;;; line="1 WCTDM/0/0" threewaycalling=yes callwaiting=yes transfer=yes callprogress=no signalling=fxs_ks callerid=asreceived group=0 context=from-pstn channel => 1 calleridgroupcontext=default ;;; line="2 WCTDM/0/1" signalling=fxs_ks callerid=asreceived group=0 context=from-pstn channel => 2 calleridgroupcontext=default ;;; line="3 WCTDM/0/2" signalling=fxs_ks callerid=asreceived group=0 context=from-pstn channel => 3 calleridgroupcontext=default ;;; line="4 WCTDM/0/3" signalling=fxs_ks callerid=asreceived group=0 context=from-pstn channel => 4 calleridgroupcontext=default **** /etc/asterisk/extensions.conf **** [general] static=yes writeprotect=no clearglobalvars=no [globals] CONSOLE=Console/dsp ; Console interface for demo IAXINFO=guest ; IAXtel username/password TRUNK=DAHDI/G0 ; Trunk interface TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0) [outdial] exten => s,1,Set(TIMEOUT(response)=3) exten => s,n,WaitForSilence(4000,1,16) exten => s,n,Agi(agi://localhost/Outdial.agi) exten => s,n,Hangup() exten => failed,1,Verbose(Outdial failed) exten => failed,n,Verbose(Reason= ${REASON}) exten => failed,n,Hangup() **** Thanks in advance for any help you can provide, Deric Page deric.page at nisc.coop -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090630/60dc70c9/attachment.htm
David Backeberg
2009-Jul-02 00:07 UTC
[asterisk-users] Asterisk 1.6 WaitForSilence Problem
On Tue, Jun 30, 2009 at 9:21 AM, Deric Page<Deric.Page at nisc.coop> wrote:> I've set up an outbound .call system for customer callbacks and the like. > Calls are going out over analog lines and I'm trying to use the > WaitForSilence routine to make sure the phone has stopped ringing before > starting message playback. The problem is that if I set the first argument > of WaitForSilence to anything other than 1, WaitForSilence never exits.I would suggest that WaitForSilence isn't a very good tool to 'make sure the phone has stopped ringing', especially since it seems like what you really want is a smart way to detect whether you have a human on the phone. You may prefer Answering Machine Detection, known in dialplans as AMD(). If you honestly just want a wait, put in a wait. If somebody starts talking by saying hello, WaitForSilence() may not be what you want. Have you recorded some tests and listened back to them?