Wednesday, November 2, 2011

Sip internal calling (ext to ext) with recording (Including 'in' 'out' & mix) Asterisk

SIP.CONF

[130005]
disallow=all
allow=g729
allow=alaw
allow=ulaw
type=friend
username=130005
secret=130005
host=dynamic
dtmfmode=rfc2833
dtmf=rfc2833
qualify = yes
context = local
canreinvite=yes
nat=yes
accountcode=clientname
restrictcid=yes
ignoreregexpire = yes

 

 

EXTENSIONS.CONF

exten => 130005,n,Set(FILENAME=/var/www/html/mde/PS7016/IN/${DIRNAME}/${UNIQUEID}--${STRFTIME(${EPOCH},,%H:%M:%S)}-${CALLERID(num)})
exten => 130005,n,Set(FILE=${FILENAME}.gsm)
exten => 130005,n,System(/bin/mkdir -p /var/www/html/mde/PS7016/IN/${DIRNAME})
exten => 130005,n,AGI(read.php,${FILE},${UNIQUEID},${TIME})
exten => 130005,n,Monitor(gsm,${FILENAME},mb)
exten => 130005,n,Dial(SIP/130005,40,tT)
exten => 130005,n,Hangup()
exten => h,1,System(/usr/bin/soxmix ${FILENAME}-in.gsm ${FILENAME}-out.gsm ${FILENAME}.gsm)
;exten => h,2,System(rm ${FILENAME}-in.gsm ${FILENAME}-out.gsm)

For authentication the context either be added in the local or we can directly put any code in context local.

0 comments:

Post a Comment