; hangup_on_star.conf:
; Application to turn on or off the hangup-on-star features of asterisk
; dialing. 
;
; During calling-card calls, it can save money to use one pay-phone call
; to place several outgoing calls.  To do this, the "H" option needs to
; be passed to the asterisk Dial application.  However, you may want to
; use a "*" during a call for a menu system for example.  This context
; allows you to turn "hangup on *" on and off.

[macro-hangup_on_star-on]
; ARG1 <- caller id number
exten = *467,1,DBput(HOS/${ARG1}=YES)
exten = *467,2,Playback(beep)
exten = *467,3,Macro(return_to_top)

[macro-hangup_on_star-off]
; ARG1 <- caller id number
exten = #467,1,DBput(HOS/${ARG1}=NO)
exten = #467,2,Playback(beep)
exten = #467,3,Macro(return_to_top)

[macro-get-hos_string]
; Set ${hos_string} to hangup on star string 
;
; ARG1 <- caller id number
;
exten = s,1,DBget(hos=HOS/${ARG1})
exten = s,2,GotoIf($["${hos}" = "YES"]?3:5)
exten = s,3,SetVar(hos_string=H)
exten = s,4,Goto(103)
exten = s,5,SetVar(hos_string=)
exten = s,6,Goto(103)
exten = s,102,SetVar(hos_string=H)
exten = s,103,NoOp()

