asterisk - 实现内部分机互打 (实现DND功能和截答)

设置DND :74
取消DND:074
截答:04+分机号

pjsip.conf

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[endpoint_internal](!)
type=endpoint
context=from-internal
disallow=all
allow=ulaw
trust_id_outbound=yes

[auth_userpass](!)
type=auth
auth_type=userpass

[aor_dynamic](!)
type=aor
max_contacts=1

[1001](endpoint_internal)
auth=1001
aors=1001
outbound_auth=1001
[1001](auth_userpass)
password=1001 ; put a strong, unique password here instead
username=1001
[1001](aor_dynamic)

[1002](endpoint_internal)
auth=1002
aors=1002
[1002](auth_userpass)
password=1002 ; put a strong, unique password here instead
username=1002
[1002](aor_dynamic)

extensions.conf

[make-pickup]
exten => _*04X.,1,Pickup(${EXTEN:3})
[make-dnd]
exten => *74,1,Set(PRESENCE_STATE(CustomPresence:${CALLERID(num)})=dnd,,Go Out to lunch)
        same => n,Hangup()
[nomake-dnd]
exten => *074,1,Set(PRESENCE_STATE(CustomPresence:${CALLERID(num)})=not_set,,I am come back)
        same => n,Hangup()
[from-internal]
include => make-pickup
include => make-dnd
include => nomake-dnd

exten => _100[1-2],hint,,CustomPresence:${EXTEN}
exten => _100[1-2],1,Verbose(The local number is ${CALLERID(num)})
        same => n,GotoIF($[${PRESENCE_STATE(CustomPresence:${EXTEN},value)} = dnd]?${EXTEN})
        same => n,Dial(PJSIP/${EXTEN},20)
        same => n,(${EXTEN}),Hangup()

你可能感兴趣的:(asterisk,asterisk)