[globals]

[incoming]
exten => _X.,1,Goto(internaldialplan,${EXTEN},1)

[macro-call-sipphone]
exten => s,1,Set(CALLERID(name)=${SHELL(/etc/asterisk/dtmfdecode.php ${CALLERID(num)})})
exten => s,2,Macro(addprefix,00)
exten => s,3,Dial(SIP/${ARG1},${SQLDB},tT)

#include hamnet_outgoing.conf

[dialplan]
include => internaldialplan
#include hamnet_destination.conf
exten => t,1,Playback(vm-nobodyavail)
exten => t,n,Hangup

[internaldialplan]
#include hamnet_dialplan.conf

exten => 32234263,1,Answer
exten => 32234263,n,Echo
exten => 32234263,n,Hangup

exten => 81436132,1,Answer
exten => 81436132,n,DateTime()
exten => 81436132,n,Hangup

[extensions]
exten => *101,1,Answer
exten => *101,n,Milliwatt()
exten => *101,n,Hangup

exten => *102,1,Answer
exten => *102,n,DateTime()
exten => *102,n,Hangup

[macro-addprefix]
exten => s,1,GotoIf($[${EXISTS(${CALLERORIG})}]?2:4)
exten => s,2,Set(CALLERID(all)=${ARG1}${CALLERORIG})
exten => s,3,Goto(10)
exten => s,4,NoOp(CALLERORIG NOT FOUND)
exten => s,5,Set(CALLERORIG=${CALLERID(num)})
exten => s,6,Set(CALLERID(num)=${ARG1}${CALLERORIG})
exten => s,10,NoOp()
