HOWTO How To Add Custom Short Code

From Bicom Systems Wiki

Description:

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.

Video Instructions: http://bicomsystems.com/img/anim/custom.access.codes.swf

Text Instructions:

  • Login to system administration
  • Navigate to 'Settings->Conf Files'
  • Click on 'Extensions' under the 'Conf files' navigation located on the righthand side
  • Copy the default context, paste it above, and rename the context 'pbxware' so it looks like this:
 [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();
  • Under default context we'll now add the following lines:
 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

  • The options should now look like this:
 [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();
  • Click on 'Save' to save the options
  • Click on 'Reload' to reload the configuration files
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.