[general]
static=yes
writeprotect=no
clearglobalvars=no

[globals]
CONSOLE=Console/dsp				; Console interface for demo
IAXINFO=guest					; IAXtel username/password
TRUNK=DAHDI/G2					; Trunk interface
TRUNKMSD=1					; MSD digits to strip (usually 1 or 0)

[DID_trunk_1]
;-- Beep Production --;
exten => _9123*!, 1, Goto(BEEP_IN_ONNET,${EXTEN:5},1) ;-- Remove 9123* --;
exten => _9125*!, 1, Goto(BEEP_IN_INTL,${EXTEN:5},1)  ;-- Remove 9125* --;

[BEEP_IN_ONNET]
exten => _X!,1, hangup(16)

[BEEP_IN_INTL]
exten => _X!,1, hangup(16)

[BEEP_LOOP]
;-- Beep OutDialer --;
;-- trunk variable is passed frm AMI --;
exten => _XXXXXXXXXX,1,Set(CDR(userfield)=${commonID}) ; Add unique Call ID of incoming call for correlation
 same => n, Dial(PJSIP/${EXTEN}@${trunk})
 same => n, hangup(${HANGUPCAUSE})                     ; Transfer hangup cause from trunk to this context
 
exten => h,1,Verbose(${commonID},${callType},${isSuccess},${HANGUPCAUSE},${CDR(disposition)})

[BEEP_DUMMY]
;-- Drop call if call is answered --;
  exten => 1,1,hangup(16)