On Tue, 23 Sep 2008 12:29:22 +0200, Vincent <[EMAIL PROTECTED]> wrote: >Isn't there a way to check the status an FXO card is in?
Apparently, it's OK to call Answer() even if the channel is already open: http://www.voip-info.org/wiki/view/Asterisk+cmd+Answer So I guess I can simplify things this way: [my-ivr] HELLO=false exten => s,1,GotoIf($[${LEN(${CALLERID(num)})} = 0]?nocid,1:cid,1) exten => nocid,1,Set(HELLO=true); exten => nocid,n,Answer() exten => nocid,n,Playback(my_sound_files/hello) exten => nocid,n,Read(CALLERID(num),my_sound_files/no_cid,10) exten => nocid,n,GotoIf($[${LEN(${CALLERID(num)})} < 10]?cid,1) exten => nocid,n,Hangup() ;If number in DB, rewrite CID name on the fly exten => cid,1,AGI(check_cid.phpcli|${CALLERID(num)}|${CALLERID(name)}) exten => cid,n,Goto(main_menu,s,1) [main_menu] ;OK to call Answer() even if line already off-hook exten => s,1,Answer() exten => s,n,ExecIf($[${HELLO} = true],Playback,my_sound_files/hello) exten => s,n,Background(my_sound_files/main_menu) exten => s,n,WaitExten(5) exten => s,n,Hangup() Thank you. _______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2008 - September 22 - 25 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
