-
Notifications
You must be signed in to change notification settings - Fork 7
/
extensions.conf
79 lines (58 loc) · 4.2 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include extensions-range.conf ;System dialplan
[globals](+)
GW1=voipms-LosAngeles ;Primary sip account used for handeling calls to the PSTN, change the name to match sip.conf
GW2=voipms-Seattle ;Secondary sip account for handelig calls to the PSTN, change the name to match sip.conf
emergency=112 ;Change this number to what your PSTN provider use for emergency number
DialIMSITimeoutVM=30 ;how long to ring before going to voicemail
DialIMSITimeout=180 ;how long to ring before indicating no answer
DialPSTNTimeout=3600 ;how long to ring before indicating no answer (must be high as the timer is also used dureing early media)
AnswerDelay=4000 ;how long to wait in order to allow the channel to be establish (give the MS time to establish the voice channel)
[emergency](+) ;Here you define the number that must be treatet as an emertency call http://en.wikipedia.org/wiki/emergency_telephone_number
exten => _[sS][oO][sS], 1,Set(CDR(B-Number)=${emergency}) ;Defined by the GSM standard
exten => _112!, 1,Set(CDR(B-Number)=${emergency}) ;EU
exten => _911!, 1,Set(CDR(B-Number)=${emergency}) ;US
;exten => _999!, 1,Set(CDR(B-Number)=${emergency}) ;UK
[to-e164](HangupCause) ;Here you can change how dialing patterns is handled for when you recice a call from openBTS
exten => _011!, 1,Return(+${EXTEN:3}) ;US international dialing prefix
exten => _00!, 1,Return(+${EXTEN:2}) ;EU international dialing prefix
exten => _1NXXNXXXXXX, 1,Return(+${EXTEN}) ;US NANP8
exten => _NXXNXXXXXX, 1,Return(+1${EXTEN}) ;US NANP7
exten => _X!, 1,Return(${EXTEN}) ;Unknown local call
exten => _+!, 1,Return(${EXTEN}) ;E.164
exten => _[*#a-zA-Z]!, 1,Return(${EXTEN}) ;Unknown
[to-pstn](+) ;Here you can change how dialing patterns is handled for when you send a call to the PSTN http://www.voip-info.org/wiki/view/Asterisk+Dialplan+Patterns
exten => _011!, 1,Set(CDR(B-Number)=+${EXTEN:3}) ;US international dialing prefix
exten => _00!, 1,Set(CDR(B-Number)=+${EXTEN:2}) ;EU international dialing prefix
exten => _1NXXNXXXXXX, 1,Set(CDR(B-Number)=+${EXTEN}) ;US NANP8
exten => _NXXNXXXXXX, 1,Set(CDR(B-Number)=+1${EXTEN}) ;US NANP7
[from-pstn](+) ;Here you can change how dialing patterns is handled for when you recice a call from the PSTN
exten => _011!, 1,Set(CDR(B-Number)=+${EXTEN:3}) ;US international dialing prefix
exten => _00!, 1,Set(CDR(B-Number)=+${EXTEN:2}) ;EU international dialing prefix
exten => _1NXXNXXXXXX, 1,Set(CDR(B-Number)=+${EXTEN}) ;US NANP8
exten => _NXXNXXXXXX, 1,Set(CDR(B-Number)=+1${EXTEN}) ;US NANP7
[default](+) ;Here you can add any dialplan the phones must be able to call internaly
exten => 111, 1,Goto(VoicemailMain,${CDR(A-Number)},1) ;extension used for accessing the voicemail
#include extensions-range-test.conf ;Test numbers, should be removed in a production system
[sip-external]
exten => 100,1,Dial(SIP/0000FFFF0001) ; Replace 0000FFFF0001 with your device name
exten => 101,1,Dial(SIP/0000FFFF0002) ; Replace 0000FFFF0002 with your device name
exten => 200,1,Answer()
same => n,Playback(hello-world)
same => n,Hangup()
exten => 201,1,Goto(TestMenu,start,1) ; add this to the end of the
; [LocalSets] context
exten => 10100001101,1,Dial(SIP/[email protected]:5062) ; Replace 0000FFFF0002 with your device name
exten => 10100001100,1,Dial(SIP/[email protected]:5062) ; Replace 0000FFFF0002 with your device name
[gsmsubscriber]
exten=> 10100001101,1,Answer()
exten=> 10100001101,2,Set(CallTime=${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)})
exten=> 10100001101,3,Set(CALLFILENAME=${EXTEN}_${CallTime}_${CALLERID(num)})
exten=> 10100001101,4,MixMonitor(/tmp/GSM/${CALLFILENAME}.wav,b)
exten=> 10100001101,5,Dial(SIP/GSM/${EXTEN})
exten=> 10100001101,n,Hangup
exten=> 10100001100,1,Answer()
exten=> 10100001100,2,Set(CallTime=${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)})
exten=> 10100001100,3,Set(CALLFILENAME=${EXTEN}_${CallTime}_${CALLERID(num)})
exten=> 10100001100,4,MixMonitor(/tmp/GSM/${CALLFILENAME}.wav,b)
exten=> 10100001100,5,Dial(SIP/GSM/${EXTEN})
exten=> 10100001100,n,Hangup