A short code is a custom dial line that usually starts with an asterisk [*] and is followed by one or more digits [0-9]. For example, *099. When this access code is dialed, the system usually performs some action. In the following example we'll add a short code that dials a mobile number over Zaptel or a local extension over SIP/IAX channel.
[general]
static=yes
writeprotect=yes
include => parkedcalls
[pbxware]
exten => _[*0-9].,1,DeadAgi(agi://127.0.0.1)
exten => _[*0-9].,2,Hangup();
exten => asterisk,1,Goto(*123,1)
exten => asterisk,2,Hangup();
[default]
exten => _[*0-9].,1,DeadAgi(agi://127.0.0.1)
exten => _[*0-9].,2,Hangup();
exten => asterisk,1,Goto(*123,1)
exten => asterisk,2,Hangup();
exten => *111,1,Dial(SIP/1001) #Access Code *111, Dials over SIP protocol, Extension 1001
exten => *222,1,Dial(IAX/2001) #Access Code *222, Dials over IAX protocol, Extension 2001
exten => *333,1,Dial(Zap/2/55510205) #Access Code *333, Dials over Zaptel protocol, Channel 2, Mobile/proper number 55510205
[general]
static=yes
writeprotect=yes
include => parkedcalls
[pbxware]
exten => _[*0-9].,1,DeadAgi(agi://127.0.0.1)
exten => _[*0-9].,2,Hangup();
exten => asterisk,1,Goto(*123,1)
exten => asterisk,2,Hangup()
[default]
exten => *111,1,Dial(SIP/1001)
exten => *222,1,Dial(IAX/2001)
exten => *333,1,Dial(Zap/2/55510205)
exten => _[*0-9].,1,DeadAgi(agi://127.0.0.1)
exten => _[*0-9].,2,Hangup();
exten => asterisk,1,Goto(*123,1)
exten => asterisk,2,Hangup();
NOTE:
- The Access Code can contain as many digits as you like
- Access code *333 will dial over Zaptel channel 2. If your trunk is set on different channel, change this number accordingly.