Bonjour.
voilà mon SIP.conf:
[general]
context = default
allowoverlap = no
udpbindaddr = 0.0.0.0
tcpenable = no
tcpbindaddr = 0.0.0.0
transport = udp
srvlookup = yes
subscribecontext = default
language = fr
allowexternaldomains = yes
allowguest = yes
allowsubscribe = yes
allowtransfer = yes
alwaysauthreject = no
autodomain = no
callevents = no
checkmwi = 10
compactheaders = no
defaultexpiry = 1800
dumphistory = no
externrefresh = 10
g726nonstandard = no
jbenable = no
jbforce = no
jblog = no
maxcallbitrate = 384
maxexpiry = 3600
minexpiry = 60
mohinterpret = default
notifyringing = yes
pedantic = no
progressinband = never
promiscredir = no
realm = asterisk
recordhistory = yes
registerattempts = 0
registertimeout = 20
relaxdtmf = no
sendrpid = no
sipdebug = yes
t1min = 100
t38pt_udptl = no
tos_audio = none
tos_sip = none
tos_video = none
trustrpid = no
useragent = Asterisk PBX
usereqphone = no
videosupport = yes
register = 09XXXXXXXX:MdPfreephonie@freephonie.net
disallow = all
allow = alaw,ulaw
callerid = Maison
[basic-options](!); a template
dtmfmode = rfc2833
context = from-office
type = friend
[natted-phone](!,basic-options); another template inheriting basic-options
directmedia = no
host = dynamic
[public-phone](!,basic-options); another template inheriting basic-options
directmedia = yes
[my-codecs](!); a template for my preferred codecs
disallow = all
allow = ilbc
allow = g729
allow = gsm
allow = g723
allow = ulaw
[ulaw-phone](!); and another one for ulaw-only
disallow = all
allow = ulaw
mon users.conf
[general]
fullname = New User
userbase = 6000
hasvoicemail = yes
vmsecret = 1234
hassip = yes
hasiax = yes
hasmanager = no
callwaiting = yes
threewaycalling = yes
callwaitingcallerid = yes
transfer = yes
canpark = yes
cancallforward = yes
callreturn = yes
callgroup = 1
pickupgroup = 1
register = 09XXXXXXXX:MdPfreephonie@freephonie.net
vmexten = 0000
[trunk_1]
type = peer
host = freephonie.net
fromuser = 09XXXXXXXX
username = 09XXXXXXXX
secret = MdPfreephonie
trunkname = freetrunk ; GUI metadata ; GUI metadata
context = DID_trunk_1
fromdomain = freephonie.net
hasexten = no
hasiax = no
hassip = yes
registeriax = no
registersip = yes
trunkstyle = voip
nat = yes
insecure = port,invite
authuser = 09XXXXXXXX
disallow = all
allow = alaw,ulaw,gsm,h263
[6000]
fullname = paco1
registersip = no
host = dynamic
callgroup = 1
mailbox = 6000
call-limit = 100
type = peer
username = 6000
transfer = yes
callcounter = yes
context = DLPN_DialPlan1
cid_number = 6000
hasvoicemail = no
vmsecret =
email =
threewaycalling = no
hasdirectory = yes
callwaiting = no
hasmanager = no
hasagent = no
hassip = yes
hasiax = no
secret = YYYY
nat = yes
canreinvite = yes
dtmfmode = rfc2833
insecure = no
pickupgroup = 1
macaddress = 6000
autoprov = yes
label = 6000
linenumber = 1
LINEKEYS = 1
disallow = all
allow = ulaw,gsm
[6001]
fullname = paco2
registersip = no
host = dynamic
callgroup = 1
mailbox = 6001
call-limit = 100
type = peer
username = 6001
transfer = yes
callcounter = yes
context = DLPN_DialPlan1
cid_number = 6001
hasvoicemail = no
vmsecret =
email =
threewaycalling = no
hasdirectory = yes
callwaiting = no
hasmanager = no
hasagent = no
hassip = yes
hasiax = no
secret = YYYY
nat = yes
canreinvite = yes
dtmfmode = rfc2833
insecure = no
pickupgroup = 1
disallow = all
allow = ulaw,gsm
macaddress = 6001
autoprov = yes
label = 6001
linenumber = 1
LINEKEYS = 1
[6002]
fullname = paco_tab
registersip = no
host = dynamic
callgroup = 1
mailbox = 6002
call-limit = 100
type = peer
username = 6002
transfer = yes
callcounter = yes
context = DLPN_DialPlan1
cid_number = 6002
hasvoicemail = no
vmsecret =
email =
threewaycalling = no
hasdirectory = yes
callwaiting = no
hasmanager = no
hasagent = no
hassip = yes
hasiax = no
secret = YYYY
nat = yes
canreinvite = yes
dtmfmode = rfc2833
insecure = no
pickupgroup = 1
macaddress = 6002
autoprov = yes
label = 6002
linenumber = 1
LINEKEYS = 1
disallow = all
allow = ulaw,gsm
[6003]
fullname = iphone_test
registersip = no
host = dynamic
callgroup = 1
mailbox = 6003
call-limit = 100
type = peer
username = 6003
transfer = yes
callcounter = yes
context = DLPN_DialPlan1
cid_number = 6003
hasvoicemail = no
vmsecret =
email =
threewaycalling = no
hasdirectory = yes
callwaiting = no
hasmanager = no
hasagent = no
hassip = yes
hasiax = no
secret = YYYY
nat = yes
canreinvite = yes
dtmfmode = rfc2833
insecure = no
pickupgroup = 1
disallow = all
allow = alaw,ulaw,gsm
macaddress = 6003
autoprov = yes
label = 6003
linenumber = 1
LINEKEYS = 1
[6100]
fullname = maison
registersip = no
host = dynamic
callgroup = 1
mailbox = 6100
call-limit = 100
type = peer
username = 6100
transfer = yes
callcounter = yes
context = DLPN_DialPlan1
cid_number = 6100
hasvoicemail = yes
vmsecret = WWWW
email = adresse@mail.fr
threewaycalling = no
hasdirectory = yes
callwaiting = no
hasmanager = no
hasagent = yes
hassip = yes
hasiax = no
secret = YYYY
nat = yes
canreinvite = yes
dtmfmode = rfc2833
insecure = port,invite
pickupgroup = 1
macaddress = 6100
autoprov = yes
label = 6100
linenumber = 1
LINEKEYS = 1
disallow = all
allow = alaw,ulaw,gsm,h263
[6004]
fullname = paco-droid
registersip = no
host = dynamic
callgroup = 1
mailbox = 6004
call-limit = 100
type = peer
username = 6004
transfer = yes
callcounter = yes
context = DLPN_DialPlan1
cid_number = 6004
hasvoicemail = no
vmsecret =
email =
threewaycalling = no
hasdirectory = no
callwaiting = no
hasmanager = no
hasagent = no
hassip = yes
hasiax = no
secret = YYYY
nat = yes
canreinvite = yes
dtmfmode = rfc2833
insecure = no
pickupgroup = 1
macaddress = 6004
autoprov = yes
label = 6004
linenumber = 1
LINEKEYS = 1
disallow = all
allow = ulaw,gsm
et mon fichier extensions.conf:
[general]
static = yes
writeprotect = no
clearglobalvars = no
language = fr
userscontext = default
[globals]
TRUNKMSD = 1 ; MSD digits to strip (usually 1 or 0)
FEATURES =
DIALOPTIONS =
RINGTIME = 20
FOLLOWMEOPTIONS =
PAGING_HEADER = Intercom
trunk_1 = SIP/trunk_1
CID_6000 = toto
CID_6001 = toto
CID_6002 = toto
CID_6003 = toto
timeinterval_boulot = 09:00-17:30,mon-fri,*,*
CID_6100 = toto
FOLLOWME_6000 = 1
CID_6004 = toto
CID_trunk_1 = toto
[default]
exten = _#6XXX,1,Set(MBOX=${EXTEN:1}@default)
exten = _#6XXX,n,VoiceMail(${MBOX})
exten = a,1,VoicemailMain(${MBOX})
exten = 0000,1,VoiceMailMain(${CALLERID(num)}@default)
[conferences]
exten = 6300,1,MeetMe(${EXTEN},M)
[ringgroups]
exten = 6400,1,Goto(ringroups-custom-1,s,1)
[queues]
[voicemenus]
exten = 7000,1,Goto(voicemenu-custom-1,s,1)
exten = 7001,1,Goto(voicemenu-custom-2,s,1)
exten = 7001,1,Goto(voicemenu-custom-2,s,1)
exten = 7002,1,Goto(voicemenu-custom-3,s,1)
exten = 7003,1,Goto(voicemenu-custom-4,s,1)
exten = 7000,1,Goto(voicemenu-custom-1,s,1)
[voicemailgroups]
exten = 6600,1,NoOp(maison)
exten = 6600,2,VoiceMail(6100@default)
[directory]
[pagegroups]
[asterisk_guitools]
exten = executecommand,1,System(${command})
exten = executecommand,n,Hangup()
exten = record_vmenu,1,Answer
exten = record_vmenu,n,Playback(vm-intro)
exten = record_vmenu,n,Record(${var1},0,500,k)
exten = record_vmenu,n,Playback(vm-saved)
exten = record_vmenu,n,Playback(vm-goodbye)
exten = record_vmenu,n,Hangup
exten = play_file,1,Answer
exten = play_file,n,Playback(${var1})
exten = play_file,n,Hangup
[DID_trunk_1]
include = DID_trunk_1_default
[DID_trunk_1_default]
exten = s/_074831425,1,Goto(voicemenu-custom-2,s,1)
exten = s/_00390291596070,1,Goto(voicemenu-custom-2,s,1)
exten = s/_0223752201,1,Goto(voicemenu-custom-2,s,1)
exten = s/_046271316,1,Goto(voicemenu-custom-2,s,1)
exten = s/_06YYYYYYYY,1,Goto(voicemenu-custom-1,s,1)
exten = s/_0169XXXXXX,1,Goto(ringroups-custom-1,s,1)
exten = s/_06XXXXXXXX,1,Goto(ringroups-custom-1,s,1)
exten = s/_0[12345]XXXXXXXX,1,Goto(ringroups-custom-1,s,1)
exten = s,1,Goto(ringroups-custom-1,s,1)
exten = s,2,Voicemail(6100,u)
[page_an_extension]
[queue-member-manager]
exten = handle_member,1,Verbose(2, Looping through queues to log in or out queue members)
exten = handle_member,n,Set(thisActiveMember=${CHANNEL(channeltype)}/${CHANNEL(peername)})
exten = handle_member,n,Set(queue_field=2)
exten = handle_member,n,Set(thisQueueXtn=${CUT(QUEUES,,,${queue_field})})
exten = handle_member,n,While($[${EXISTS(${thisQueueXtn})}])
exten = handle_member,n,Macro(member-loginlogout)
exten = handle_member,n,Set(queue_field=$[${queue_field} + 1])
exten = handle_member,n,Set(thisQueueXtn=${CUT(QUEUES,,,${queue_field})})
exten = handle_member,n,EndWhile()
[macro-member-loginlogout]
exten = s,1,Verbose(2, Logging queue member in or out of the request queue)
exten = s,n,Set(thisQueue=${thisQueueXtn})
exten = s,n,Set(queueMembers=${QUEUE_MEMBER_LIST(${thisQueue})})
exten = s,n,Set(field=1)
exten = s,n,Set(logged_in=0)
exten = s,n,Set(thisQueueMember=${CUT(queueMembers,,,${field})})
exten = s,n,While($[${EXISTS(${thisQueueMember})}])
exten = s,n,GotoIf($["${thisQueueMember}" != "${thisActiveMember}"]?check_next)
exten = s,n,Set(logged_in=1)
exten = s,n,ExitWhile()
exten = s,n(check_next),Set(field=$[${field} + 1])
exten = s,n,Set(thisQueueMember=${CUT(queueMembers,,,${field})})
exten = s,n,EndWhile()
exten = s,n,MacroIf($[${logged_in} = 0]?q_login:q_logout)
[macro-q_login]
exten = s,1,Verbose(2, Logging ${thisActiveMember} into the ${thisQueue} queue)
exten = s,n,AddQueueMember(${thisQueue},${thisActiveMember})
exten = s,n,Playback(silence/1)
exten = s,n,ExecIf($["${AQMSTATUS}" = "ADDED"]?Playback(agent-loginok):Playback(an-error-has-occurred))
[macro-q_logout]
exten = s,1,Verbose(2, Logged ${thisActiveMember} out of ${thisQueue} queue)
exten = s,n,RemoveQueueMember(${thisQueue},${thisActiveMember})
exten = s,n,Playback(silence/1)
exten = s,n,ExecIf($["${RQMSTATUS}" = "REMOVED"]?Playback(agent-loggedoff):Playback(an-error-has-occurred))
[CallingRule_test]
exten = _0[12345]XXXXXXXX,1,Macro(trunkdial-failover-0.3,${trunk_1}/${EXTEN:0},,trunk_1,)
[CallingRule_portables]
exten = _06XXXXXXXX,1,Macro(trunkdial-failover-0.3,${trunk_1}/${EXTEN:0},,trunk_1,)
[voicemenu-custom-2]
exten = s,1,NoOp(filtrage)
exten = s,2,Answer()
exten = s,3,Ringing()
exten = s,4,Wait(30)
exten = s,5,Congestion(6)
exten = s,6,Hangup()
[voicemenu-custom-3]
exten = s,1,NoOp(MCM)
exten = s,2,Answer()
exten = s,3,Background(beep)
exten = s,4,Background(hello-world)
exten = s,5,WaitExten(2)
exten = 0,1,SayNumber(0)
exten = 0,2,Goto(default,6000,1)
exten = 1,1,SayNumber(1)
exten = 1,2,Goto(default,6001,1)
exten = 2,1,SayNumber(2)
exten = 2,2,Goto(default,6002,1)
exten = 3,1,SayNumber(3)
exten = 3,2,Goto(default,6003,1)
exten = #,1,Voicemail(6100,u)
exten = t,1,Hangup
[voicemenu-custom-4]
exten = s,1,NoOp(horloge)
exten = s,2,Answer()
exten = s,3,SayUnixTime(,CET,AdBYkMS)
exten = s,4,wait(5)
exten = s,5,Hangup()
[macro-stdexten]
exten = s,1,Set(__DYNAMIC_FEATURES=${FEATURES})
exten = s,2,Set(ORIG_ARG1=${ARG1})
exten = s,3,GotoIf($["${FOLLOWME_${ARG1}}" = "1"]?6:4)
exten = s,4,Dial(${ARG2},${RINGTIME},${DIALOPTIONS})
exten = s,5,Goto(s-${DIALSTATUS},1)
exten = s,6,Macro(stdexten-followme,${ARG1},${ARG2})
exten = s-NOANSWER,1,Voicemail(${ORIG_ARG1},u)
exten = s-NOANSWER,2,Goto(default,s,1)
exten = s-BUSY,1,Voicemail(${ORIG_ARG1},
exten = s-BUSY,2,Goto(default,s,1)
exten = _s-.,1,Goto(s-NOANSWER,1)
exten = a,1,VoicemailMain(${ORIG_ARG1})
[macro-stdexten-followme]
exten = s,1,Answer
exten = s,2,Set(ORIG_ARG1=${ARG1})
exten = s,3,Dial(${ARG2},${RINGTIME},${DIALOPTIONS})
exten = s,4,Set(__FMCIDNUM=${CALLERID(num)})
exten = s,5,Set(__FMCIDNAME=${CALLERID(name)})
exten = s,6,Followme(${ORIG_ARG1},${FOLLOWMEOPTIONS})
exten = s,7,Voicemail(${ORIG_ARG1},u)
exten = s-NOANSWER,1,Voicemail(${ORIG_ARG1},u)
exten = s-BUSY,1,Voicemail(${ORIG_ARG1},
exten = s-BUSY,2,Goto(default,s,1)
exten = _s-.,1,Goto(s-NOANSWER,1)
exten = a,1,VoicemailMain(${ORIG_ARG1})
[macro-pagingintercom]
exten = s,1,SIPAddHeader(Alert-Info: ${PAGING_HEADER})
exten = s,2,Page(${ARG1},${ARG2})
exten = s,3,Hangup
[macro-local-callingrule-cid-0.1]
exten = s,1,Set(CALLERID(all)=${IF($[${LEN(${ARG4})} > 2]?${ARG4}})
exten = s,n,Goto(${ARG1},${ARG2},${ARG3})
[macro-trunkdial-failover-0.3]
exten = s,1,GotoIf($[${LEN(${FMCIDNUM})} > 6]?1-fmsetcid,1)
exten = s,n,GotoIf($[${LEN(${GLOBAL_OUTBOUNDCIDNAME})} > 1]?1-setgbobname,1)
exten = s,n,Set(CALLERID(num)=${IF($[${LEN(${CID_${CALLERID(num)}})} > 2]?${CID_${CALLERID(num)}}})
exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${ARG5})} > 2]?${ARG5}})
exten = s,n,GotoIf($[${LEN(${CALLERID(num)})} > 6]?1-dial,1)
exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${CID_${ARG3}})} > 6]?${CID_${ARG3}}:${GLOBAL_OUTBOUNDCID})})
exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${ARG5})} > 2]?${ARG5}})
exten = s,n,Goto(1-dial,1)
exten = 1-setgbobname,1,Set(CALLERID(name)=${GLOBAL_OUTBOUNDCIDNAME})
exten = 1-setgbobname,n,Goto(s,3)
exten = 1-fmsetcid,1,Set(CALLERID(num)=${FMCIDNUM})
exten = 1-fmsetcid,n,Set(CALLERID(name)=${FMCIDNAME})
exten = 1-fmsetcid,n,Goto(s,4)
exten = 1-dial,1,Dial(${ARG1})
exten = 1-dial,n,Gotoif(${LEN(${ARG2})} > 0 ?1-${DIALSTATUS},1:1-out,1)
exten = 1-CHANUNAVAIL,1,Dial(${ARG2})
exten = 1-CHANUNAVAIL,n,Hangup()
exten = 1-CONGESTION,1,Dial(${ARG2})
exten = 1-CONGESTION,n,Hangup()
exten = 1-out,1,Hangup()
[CallingRule_free]
exten = XXXX,1,Macro(trunkdial-failover-0.3,${trunk_1}/${EXTEN:0},,trunk_1,)
[voicemenu-custom-1]
exten = s,1,NoOp(Menu1)
exten = s,2,Answer()
exten = s,3,Wait(1)
exten = s,4,SayAlpha(OK)
exten = s,5,SayNumber(13)
exten = s,6,Busy(10)
[ringroups-custom-1]
exten = s,1,NoOp(maison)
exten = s,n,Dial(SIP/6000&SIP/6001&SIP/6002&SIP/6003&SIP/6100,15,${DIALOPTIONS}i)
exten = s,n,Voicemail(6100,u)
[DLPN_DialPlan1]
include = CallingRule_test
include = CallingRule_portables
include = CallingRule_free
include = default
include = parkedcalls
include = conferences
include = ringgroups
include = voicemenus
include = queues
include = voicemailgroups
include = directory
include = pagegroups
include = page_an_extension