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

[default]
include => GVMA
include => toSvcCenter

[globals]

[sip]
include => GVMA
include => toSvcCenter

exten => _Asterisk.,1,NoOp(${EXTEN})

[toSvcCenter]
exten => o,1,BackGround(one-moment-please)
exten => o,n,Transfer(SIP/ToSvcCenter)
exten => o,n,Hangup

[GVMA]
exten => _X.,1,Wait(1)
exten => _X.,n,SET(SIP_CODEC=ulaw)
exten => _X.,n,GotoIf($["${CALLERID(num)}" = "${EXTEN}"]?internal:next1)
exten => _X.,n(internal),Set(Source_IP=${CUT(CHANNEL(rtpdest),:,1)})
exten => _X.,n,SET(DB("SIP/Registry"/${EXTEN})=${Source_IP}:5060:3600:${EXTEN}:sip:${EXTEN}@${Source_IP})
;exten => _X.,n,SET(ODBC_SOURCE_IP(${EXTEN})=${Source_IP})
exten => _X.,n,TrySystem(/usr/sbin/asterisk -rx reload)
exten => _X.,n,VoicemailMain(${EXTEN}@GVMA_DN)
exten => _X.,n,Hangup
exten => _X.,n(next1),GotoIf($["${EXTEN}" = "8887389109"]?external:next2)
exten => _X.,n(external),VoicemailMain(@GVMA_DN)
exten => _X.,n,Hangup
exten => _X.,n(next2),Voicemail(${EXTEN}@GVMA_DN,u)
exten => _X.,n,Hangup
