Je vous présentes mes deux fichiers extension.conf et pjsip.conf :
Fichier extension.conf
Code:
exten => ${WEBMASTER_IN},1,NoOp(## Incoming Call from ${CALLERID(all)} ##)
same => n,Verbose(Call start time: ${CDR(start)})
same => n,Set(CDR(calldate)=${CDR(start)})
same => n,Set(CDR(useragent)=${CALLERID(name)})
same => n,Set(POSTE_EXT=${CALLERID(num)})
same => n,Ringing()
same => n,System(echo "--appel_sortant --- callerid : ${CALLERID(num)} ---- ${STRFTIME(${EPOCH},,%Y/%m/%d %H:%M:%S)} ----" >> /var/spool/asterisk/log/debug.txt)
same => n,Set(REC_FILE_NAME=IN_${NOW}_${EXTEN}_${POSTE_EXT}.wav)
same => n,MixMonitor(${REC_FILE_NAME},b V(1))
same => n,ChanIsAvail(PJSIP/100,sa)
same => n,Set(PHONESTATUS=${AVAILSTATUS})
same => n,Set(PHONEAVAIL=${AVAILORIGCHAN})
same => n,NoOp(## Status of device is ${PHONESTATUS} ##)
same => n,GotoIf($["${PHONESTATUS}"="3"]?busy:call)
same => n(busy),Playback(ivr/REPONDEUR_2_OCCUPE_PLATEAU_VENTE_LOOPING)
same => n,VoiceMail(100@default,s)
same => n,Goto(end)
same => n(call),Dial(${PHONEAVAIL},20)
same => n,VoiceMail(100@default,su)
same => n,Goto(end)
same => n(end),Hangup()
Fichier pjsip.conf
Code:
;==================== EXTENXION 100
[100]
type=endpoint
context=from-internal
subscribe_context=phones-blf
dtmf_mode=rfc4733
disallow=all
allow=ulaw,alaw,gsm,g722,g729
transport=transport-udp
auth=100
aors=100
direct_media=no
mailboxes=100@default
trust_id_outbound=yes
callerid=Arnold <100>
device_state_busy_at=2
[100]
type=auth
auth_type=userpass
password=100
username=100
[100]
type=aor
max_contacts=1
remove_existing=yes