-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextensions.conf
43 lines (36 loc) · 1.43 KB
/
extensions.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
[default]
[anonymous-in]
exten => _1XXXX.,1,Set(SIPURI=${CUT(CUT(PJSIP_HEADER(read,From),>,1),<,2)})
;"aaaa" <sip:username@domain.com;key=var>
same => n,Set(SIPURI=${CUT(SIPURI,\;,1)})
;same => n,Set(CALLERID(name)=${SIPURI})
;format to sip-xxx=domain.com
same => n,Set(SIPURI=${STRREPLACE(SIPURI,:,-)})
same => n,Set(SIPURI=${STRREPLACE(SIPURI,@,=)})
same => n(docall),GotoIf($["${PJSIP_ENDPOINT(${EXTEN},context)}" = "friend"]?friend,${EXTEN},1)
same => n,Hangup()
[anonymous-out]
;SIP calls. sip-username=sip.linphone.org
;format to sip:username@sip.linphone.org
exten => _sip.,1,Set(SIPURI=${STRREPLACE(EXTEN,=,@)})
same => n,Set(SIPURI=${STRREPLACE(SIPURI,-,\:)})
same => n,Dial(PJSIP/anonymous/${SIPURI})
same => n,Progress()
same => n,Wait(1)
same => n,Playback(no-route-exists-to-dest,noanswer)
same => n,Hangup()
[friend]
exten => _1XX.,1,Dial(PJSIP/${EXTEN})
same => n,Hangup()
;uri dial, e.g. sip-username=domain.com
exten => _sip.,1,Goto(anonymous-out,${EXTEN},1);sip uri call
[anonymous-sms]
exten => s,1,NoOp(anonymous MESSAGE from ${MESSAGE(from)} to ${MESSAGE(to)})
same => n,Hangup();Stop forward.
exten => _1XX.,1,GotoIf($["${PJSIP_ENDPOINT(${EXTEN},message_context)}" == "friend-sms"]?friend-sms,${EXTEN},1)
[friend-sms]
exten => _1XX.,1,GotoIf($[ "${DEVICE_STATE(PJSIP/${EXTEN})}" =~ "INUSE" ]?free)
same => n,NoOp(Offline)
same => n,Hangup()
same => n(free),MessageSend(${CUT(MESSAGE(to),@,1)},${MESSAGE(from)})
same => n,Hangup()