Skip to content

Eduguru

  • Tutorial and Training
    • SQL Server
    • Linux Tutorial
    • PHP Tutorial
    • Asterisk Tutorial
    • MySQL Tutorial
    • JavaScript Tutorial
    • C Tutorial
    • Who Breaks into Computer Systems
    • Planning and Performing Hacking Attacks
    • Maintaining Anonymity
    • Selecting Security Assessment Tools
    • Scanning Systems
  • Contact Us
    • Feedback
  • Business
    • Solutions
      • Job : Dialer Support
    • ViciDial – GoautoDial Support
    • Domain Registration
    • Web Hosting
    • Consultancy
    • Dialer Support
  • About Us
  • News
  • Donate Online
  • Offers
  • Newsletter
  • Jobs
  • Sale
    • Amazon
    • Get Computer Books
    • Amazon Sale Offer
  • Search
  • Python Tutorial
  • Search
  • WPMS HTML Sitemap
  • Log In
  • Log Out
  • Register
  • Lost Password
  • Reset Password
  • Download
  • Result
  • Newsletter
  • search
  • MySQL – Video Tutorial
  • Products Page
    • Checkout
    • Transaction Results
    • Your Account
  • Privacy

1234

ACD configuration in Asterisk

February 24, 2016January 19, 2014 by eduguru

ACD = Automatic Call Distribution It is extremely important for supervisors and the company to distribute the incoming calls among the team members. How it Works?  Incoming call will be segregated among the teams Example : Sales and Support Objective : Customer calls up a Toll Free number (1800 XXXXXX) and hears the IVR – … Read more

Categories Asterisk Tags 1, 1234, ACD = Automatic Call Distribution It is extremely important for supervisors and the company to distribute the incoming calls among the team members. How it Works? Incoming call will be segregated amon, ACD configuration in Asterisk, add the following Create the Agents Login Code which will be used for agent to login exten => 4000, AgentLogin(200) exten => 7000, e.g. using code "4000" as in the example above, hears hold music and waits for call. Inbound call gets transfered to extension 7000 and agents hears beep and inbound call gets connected to agent., Name of the Agent agent => 200, PASSWORD, Prakash Create agents in the agents.conf file and make them as members in the queue 3) Dial Plan Configuration In extensions.conf, Queue(sales) Testing This is how it works - Agent logs on, Satya agent => 100 Leave a comment

Asterisk Full RealTime Database example

March 31, 2016September 10, 2013 by eduguru
Asterisk dial command

Configure asterisk MySql connection: create the res_mysql.conf file in /etc/asterisk vi /etc/asterisk/res_mysql.conf enter the following: [general] dbhost = 127.0.0.1 dbname = asteriskrealtime dbuser = root dbpass = password dbport = 3306 save the following configuration files, we will use a very short files instead in order to simplefy the setup: cp /etc/asterisk/extensions.conf /etc/asterisk/extensions.conf_orig cp /etc/asterisk/extconfig.conf … Read more

Categories Asterisk Tags `accountcode` varchar(20) default NULL, `adminpin`, `adminpin` varchar(20) default NULL, `allow` varchar(100) default 'g729;ilbc;gsm;ulaw;alaw', `amaflags` varchar(7) default NULL, `announce` varchar(128) default NULL, `announce_frequency` int(11) default NULL, `announce_holdtime` varchar(128) default NULL, `announce_round_seconds` int(11) default NULL, `app`, `app` varchar(20) NOT NULL default '', `appdata` varchar(128) NOT NULL default '', `appdata`) values ('from-sip', `attach` varchar(4) NOT NULL default 'yes', `callback` varchar(10) NOT NULL, `callerid` varchar(80) default NULL, `callgroup` varchar(10) default NULL, `cancallforward` char(3) default 'yes', `canreinvite` char(3) default 'yes', `context` varchar(128) default NULL, `context` varchar(20) NOT NULL default '', `context` varchar(50) NOT NULL, `context` varchar(80) default NULL, `context`) ) ENGINE=MyISAM AUTO_INCREMENT=2001 DEFAULT CHARSET=latin1; CREATE TABLE `queue_table` ( `name` varchar(128) NOT NULL, `context`) VALUES ('my_queue', `customer_id` varchar(11) NOT NULL default '0', `defaultip` varchar(15) default NULL, `defaultuser` varchar(80) NOT NULL, `delete` varchar(4) NOT NULL default 'no', `deny` varchar(95) default NULL, `dialout` varchar(10) NOT NULL, `disallow` varchar(100) default 'all', `domain`, `domain` varchar(128) NOT NULL default '', `dtmfmode` varchar(7) default NULL, `email` varchar(50) NOT NULL, `envelope` varchar(4) NOT NULL default 'no', `eventmemberstatus` tinyint(1) default NULL, `eventwhencalled` tinyint(1) default NULL, `exten` varchar(20) NOT NULL default '', `forcegreetings` varchar(4) NOT NULL default 'no', `forcename` varchar(4) NOT NULL default 'no', `fromdomain` varchar(80) default NULL, `fromuser` varchar(80) default NULL, `fullcontact` varchar(80) default NULL, `fullname` varchar(150) NOT NULL, `hidefromdir` varchar(4) NOT NULL default 'yes', `host` varchar(31) NOT NULL, `insecure` varchar(4) default NULL, `interface`, `interface` varchar(128) default NULL, `interface`) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; CREATE TABLE `meetme` ( `confno` varchar(80) NOT NULL default '0', `ipaddr` varchar(15) NOT NULL, `joinempty` varchar(128) default NULL, `language` char(2) default NULL, `lastms` int(11) NOT NULL, `leavewhenempty` varchar(128) default NULL, `mailbox` varchar(11) NOT NULL default '0', `mailbox` varchar(50) default NULL, `mask` varchar(95) default NULL, `maxlen` int(11) default NULL, `md5secret` varchar(80) default NULL, `memberdelay` int(11) default NULL, `membername`, `membername` varchar(40) default NULL, `members` int(11) NOT NULL default '0', `members`) VALUES ('my_conf', `monitor_format` varchar(128) default NULL, `monitor_join` tinyint(1) default NULL, `musiconhold` varchar(100) default NULL, `musiconhold` varchar(128) default NULL, `name` varchar(80) NOT NULL, `nat` varchar(5) NOT NULL default 'no', `nextaftercmd` varchar(4) NOT NULL default 'yes', `operator` varchar(4) NOT NULL default 'no', `pager` varchar(50) NOT NULL, `password` varchar(5) NOT NULL default '0', `paused` int(11) default NULL, `paused`) VALUES (1, `paused`) VALUES (2, `penalty`, `penalty` int(11) default NULL, `periodic_announce` varchar(50) default NULL, `periodic_announce_frequency` int(11) default NULL, `permit` varchar(95) default NULL, `pickupgroup` varchar(10) default NULL, `pin`, `pin` varchar(20) default NULL, `port` varchar(5) NOT NULL, `priority` tinyint(4) NOT NULL default '0', `priority`), `qualify` char(3) default NULL, `queue_callswaiting` varchar(128) default NULL, `queue_holdtime` varchar(128) default NULL, `queue_lessthan` varchar(128) default NULL, `queue_minutes` varchar(128) default NULL, `queue_name`, `queue_name` varchar(128) default NULL, `queue_reporthold` varchar(128) default NULL, `queue_seconds` varchar(128) default NULL, `queue_thankyou` varchar(128) default NULL, `queue_thereare` varchar(128) default NULL, `queue_youarenext` varchar(128) default NULL, `regexten` varchar(80) NOT NULL, `regseconds` int(11) NOT NULL default '0', `regserver` varchar(100) default NULL, `reportholdtime` tinyint(1) default NULL, `restrictcid` char(1) default NULL, `retry` int(11) default NULL, `review` varchar(4) NOT NULL default 'no', `ringinuse` tinyint(1) default NULL, `rtpholdtimeout` char(3) default NULL, `rtptimeout` char(3) default NULL, `saycid` varchar(4) NOT NULL default 'yes', `sayduration` varchar(4) NOT NULL default 'no', `saydurationm` tinyint(4) NOT NULL default '1', `secret` varchar(80) default NULL, `sendvoicemail` varchar(4) NOT NULL default 'no', `servicelevel` int(11) default NULL, `setinterfacevar` tinyint(1) default NULL, `stamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `strategy` varchar(128) default NULL, `timeout` int(11) default NULL, `timeoutrestart` tinyint(1) default NULL, `type` varchar(6) NOT NULL default 'friend', `tz` varchar(10) NOT NULL default 'central', `useragent` char(255) default NULL, `username`, `username` varchar(64) NOT NULL default '', `weight` int(11) default NULL, `wrapuptime` int(11) default NULL, '_*0', '_9X.', '_X.', '', ''), '${CALLERID(num)}@from-sip'), '${EXTEN}@from-sip'), '1000', '11111111', '12121111111', '12122222222', '12127777777', '12129999999', '2000', '4444', '5555', 'Dial', 'dynamic', 'friend'); ; INSERT INTO asteriskrealtime.sip_buddies ( NAME, 'friend'); inster the dial-plan in the extensions table insert into `extensions`(`context`, 'from-sip', 'from-sip'); Insert the two extensions 1000 and 2000 as members: INSERT INTO `queue_member_table` (`uniqueid`, 'MeetMe', 'my_conf'); add voicemail to ext 1000 & 2000: INSERT INTO asteriskrealtime.voicemail_users (customer_id, 'my_queue'), 'no', 'Queue', 'SIP/${EXTEN:1}@deltathree'), 'SIP/${EXTEN}|30'), 'SIP/1000', 'SIP/1000@from-sip', 'SIP/1000|60'), 'SIP/2000', 'SIP/2000@from-sip', 'SIP/2000|60'), 'sipauth.deltathree.com', 'User-A', 'User-B', 'UserA@myemail.com'); ; INSERT INTO asteriskrealtime.voicemail_users (customer_id, 'UserB@myemail.com'); Insert the new queue "my_queue": INSERT INTO `queue_table` (`name`, 'VoiceMail', 'VoiceMailMain', ${EXTEN}, 0); ; INSERT INTO `queue_member_table` (`uniqueid`, 0); insert the conference bridge: INSERT INTO `meetme` (`confno`, 0); Restart asterisk and go into the CLI: asterisk -rx "restart now" asterisk -r Check the asterisk realtime status localhost*CLI> realtime mysql status general connected to asteriskrealtime@127.0., 1, 1234, 2, 3, 4, 5 are "off" turn to "on" chkconfig --level 345 mysqld on set your mysql root password (in needed): mysqladmin -u root password password go into the mysql CLI: mysql -u root -p insert the "password" Cr, and start it if needed: /etc/init.d/mysqld status /etc/init.d/mysqld start in order to start mysql after reboot check the status chkconfig | grep mysql If 3, Asterisk Full RealTime Database example, change the extconfig.conf file as follow [settings] sippeers => mysql, Configure asterisk MySql connection: create the res_mysql.conf file in /etc/asterisk vi /etc/asterisk/res_mysql.conf enter the following: [general] dbhost = 127.0.0.1 dbname = asteriskrealtime dbuser , context, defaultuser, email ) VALUES ('1000', email ) VALUES ('2000', extensions voicemail => mysql, fullname, general, Hangup, HOST, KEY `id` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=257 DEFAULT CHARSET=latin1; CREATE TABLE `voicemail_users` ( `uniqueid` int(11) NOT NULL auto_increment, KEY `mailbox_context` (`mailbox`, KEY `name_2` (`name`) ) ENGINE=MyISAM AUTO_INCREMENT=893 DEFAULT CHARSET=latin1; CREATE TABLE `extensions` ( `id` int(11) NOT NULL auto_increment, mailbox, meetme Configure sip.conf and exensioncs.conf sip.conf should Register your account and DID with the SIP provider Change the default context to "from-sip" for the inbound calls from the SIP provider. , nat, NULL, PASSWORD, port 3306 with username root for 12 seconds., PRIMARY KEY (`confno`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; verify that all tables created: mysql> show tables; +----------------------------+ | Tables_in_asteriskrealtime | +-------------------, PRIMARY KEY (`context`, PRIMARY KEY (`id`), PRIMARY KEY (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `queue_member_table` ( `uniqueid` int(10) unsigned NOT NULL auto_increment, PRIMARY KEY (`uniqueid`), qualify, queue_member_table meetme => mysql, queue_table queue_members => mysql, secret, sip_buddies extensions => mysql, TYPE) VALUES ( '1000', TYPE) VALUES ( '2000', TYPE) VALUES ( 'deltathree', UNIQUE KEY `name` (`name`), UNIQUE KEY `queue_interface` (`queue_name`, voicemail_users queues => mysql, we we call it "asteriskrealtime" create database if not exists `asteriskrealtime`; change to the asteriskrealtime database: use asteriskrealtime; now we will create the following tables: sip_buddies e, we will use a very short files instead in order to simplefy the setup: cp /etc/asterisk/extensions.conf /etc/asterisk/extensions.conf_orig cp /etc/asterisk/extconfig.conf /etc/asterisk/extconfig.conf_, yes 2 Comments

astrerisk dialplan configuration file – extensions.conf

June 28, 2013 by eduguru

; extensions.conf – the Asterisk dial plan ; ; Static extension configuration file, used by ; the pbx_config module. This is where you configure all your ; inbound and outbound calls in Asterisk. ; ; This configuration file is reloaded ; – With the “dialplan reload” command in the CLI ; – With the “reload” … Read more

Categories Asterisk Tags , , ; extensions.conf - the Asterisk dial plan ; ; Static extension configuration file, ; Phone, ; while _1NXXNXXXXXX would represent an area code plus phone number ; preceded by a on. ; ; Each step of an extension is ordered by priority, ; you have to goto "s" to execute that extension. ; ; Note: In old versions of Asterisk the PBX in some cases defaulted to ; extension "s" when a given extension was wrong (like in AMI originate). ; T, ; your global variables may be overridden by that file. Please take care to ; use only one location to set global variables, ..." ;exten => s, ...) ; ; Timing list for includes is ; ;, [, ] ; ; Note that ranges may be specified to wrap around the ends. Also, {priority|label{+|-}offset}[(alias)], *, * ; ; ignorepat can be used to instruct drivers to not cancel dialtone upon receipt ; of a particular pattern. The most commonly used example is of course '9' ; like this: ; ;ignorepat => 9 ; ; so , * ;include => weekend, * ;include => weeknights, ${EXTEN:${GLOBAL(TRUNKMSD)}})}) [trunkld] ; ; Long distance context accessed through trunk ; exten => _91NXXNXXXXXX, ${EXTEN:1}) exten => _91NXXNXXXXXX, ${EXTEN:2})}@sipprovider, ${EXTEN:4}) exten => _9011., ${EXTEN}, ${SUFFIX})}" != "${SUFFIX}"]?fn-CONGESTION, ${timezone}, 000 extensions, 1, 1 extension-priority) ; ${ARG4} - Optional TORTURE context name to jump to (assumes the s, 1 extension-priority)` ; ${ARG5} - Context in voicemail (if empty, 1) ; ; We also create an example user, 1) ; alias mark to 6275 ;exten => 6536, 1) ; Callee chose to send this call to a polite "Don't call again" script. exten => stdexten-TORTURE, 1) ; Callee chose to send this call to a telemarketer torture script. exten => _stde[x]te[n]-., 1) ; exited Voicemail ;exten => _125642860XX, 1) ; exited Voicemail ;exten => mark, 1) ; exited Voicemail ;exten => wil, 1) ; exited Voicemail exten => 1235, 1) ; filter out bad characters per the README-SERIOUSLY.best-practices.txt document same => n, 1) ; If they take too long, 1) ; Jump based on status (NOANSWER, 1) ; Treat anything else as no answer exten => a, 1) ;exten => 2, 1) ;If you want to subscribe to the status of a parking space, 1) [outbound-freenum2] ; This is the handler which performs the dialing logic. It is called ; from the [outbound-freenum] context ; exten => _X!, 1) exten => _XX*X!, 1) exten => _XXX*X!, 1) exten => _XXXX*X!, 1) exten => _XXXXX*X!, 1) exten => _XXXXXX*X!, 1) exten => fn-BUSY, 1) exten => s-NOANSWER, 1) include => dundi-e164-lookup ; ; Here are the entries you need to participate in the IAXTEL ; call routing system. Most IAXTEL numbers begin with 1-700, 1) same => n(from), 1234, 15) ;exten => 1265, 17:02-8:58, 2, 2 ;exten => s, 2 for support, 2 for..." ;exten => s, 2-)}) ; make sure the suffix is all digits as well same => n, 2) [public] ; ; ATTENTION: If your Asterisk is connected to the internet and you do ; not have allowguest=no in sip.conf, 20, 20 seconds maximum, 20 seconds maximum exten => _X., 20) ; Ring the interface, 3, 30, 30000(time), 40) same => n, 40000(ani), 5, 5) ; ; The page context calls up the page macro that sets variables needed for auto-answer ; It is in is own context to make calling it from the Page() application as simple as ; Local/{peername}@page, 500, 50000(stdexten), 6, 6) ; ; Here's what a phone entry would look like (IXJ for example) ; ;exten => 1265, 6) ; Return to the start over message. ; ; Create an extension, 6) ; Start over ; ; You can use the Macro Page to intercom a individual user exten => 76245, 600, 60000(stdPrivacyexten), 7, 8, 9:00-17:00, 9) ; . - wildcard, a "reload" will often leave the globals vars cleared, A(/path/to/my/announcemsg)) ; ; example of a compartmentalized company called "acme" ; ; this is the context that your incoming IAX/SIP trunk dumps you in... ;[acme-incoming] ;exten => s, acme-incoming) ; ; grouping of acme's extensions... never used directly, acme)) ;exten => 111, acme)) ;exten => 112, again regardless of ; whether the previous entry was for the same extension. Priorities may be ; immediately followed by a plus sign and another integer to add that amount ; (most useful with 's' or ', always included. ; ;[acme-extens] ;include => stdexten ;exten => 111, and ; switches. Includes are always processed depth-first. So for example, and ; the desperate. If you have large dialplans (more than about 50 extensions ; in a context), and are forced to return to the ; old pattern matcher, and even if deleted from the extensions.conf or ; one of its included files, and how to choose a channel to use ; in the specified group. The four possible options are: ; ; g: select the lowest-numbered non-busy DAHDI channel ; (aka. ascending sequential hunt group). ; G: sele, and iaxtel calls only ; ignorepat => 9 include => default include => trunklocal include => iaxtel700 include => trunktollfree include => iaxprovider ;Include parkedcalls (or the cont, and its value will revert to its ; previous value (before being declared as LOCAL()) upon Return. ; exten => _X., and other places where ; the timezone is significant (e.g. calls to "SayUnixTime()", and Others exten => s, and the switched server needs ; to be on-line or else dialing can be severly delayed. ; [iaxprovider] ;switch => IAX2/user:[key]@myserver/mycontext [trunkint] ; ; International long distance throug, and then not set, and they ; will be inserted where you insert the #exec command. The #exec command ; works on all asterisk configuration files. However, and to sign ; up, and use global variables ;exten => 6245, and VPB. Other channels, and you will likely save ; yourself a ton of grief. ; WARNING WARNING WARNING WARNING ; ; Any category other than "General" and "Globals" represent ; extension contexts, and you will see ;the status of the first parking lot with this extensions' help ;exten => 6600, and/or high call volume, Answer ; Answer the line exten => s, Answer ;exten => s, Answer() ; the amount of delay is set for English; you may need to adjust this time ; for other languages if there's no pause before the synchronizing beep. exten => _X., Answer() exten => _X., Answer() exten => 4339840, ANSWER) exten => stdexten-NOANSWER, application(arg1, are ; generally unaffected by ignorepat (unless DISA or another method is used to ; generate a dialtone after answering the channel). ; ; ; Sample entries for extensions.conf ; ; [dundi-e164-canonical, arg2, as soon it answers ; ;exten = 8700, Asterisk will wait for a new extension to be dialed ; (this is the original behavior of Asterisk 1.0 and earlier). ; ;autofallthrough=no ; ; ; ; If extenpatternmatchnew is set (true, astrerisk dialplan configuration file - extensions.conf, b) ; If busy, b) ; Unless busy ; ; # for when they're done with the demo ; exten => #, b) ; Voicemail (busy) ;exten => 6361, BackGround(demo-congrats) ; Play a congratulatory message exten => s, BackGround(demo-instruct) ; Play some instructions exten => s, BackGround(demo-moreinfo) ; Give some more information. exten => 2, Background(submenuopts) ; "Thanks for calling the sales department. Press 1 for steve, Background(thanks) ; "Thanks for calling press 1 for sales, Background(vm-enter-num-to-call) ;exten => s, because ; they are not stored in the extensions.conf file. ; clearglobalvars=no ; ; User context is where entries from users.conf are registered. The ; default value is 'default' ; ;userscontext=defau, because it ; is not unusual to have extensions.conf (which will have no globals) ; load after the extensions.ael file (where the global vars are stored). ; So, BUSY, Busy() exten => _f[n]-., but ; there are exceptions. For more information, call screening ; option (or use P for databased call _X.creening) exten => _X., causes the matching process to complete as soon as ; it can unambiguously determine that no other matches are possible ; ; For example, ChanIsAvail(${ARG1}, CHANUNAVAIL, CONGESTION, CONGESTION ; or HANGUP depending on Asterisk's best guess. This is the default. ; ; If autofallthrough is not set, Congestion() [macro-trunkdial] ; ; Standard trunk dial macro (hangs up on a dialstatus that should ; terminate call) ; ${ARG1} - What to dial ; exten => s, d) ; Give voicemail at extension 8500 ; exten => 8500, Dial(${ARG1}) exten => s, Dial(${dev}, Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) [international] ; ; Master context for international long distance ; ignorepat => 9 include => longdistance include => trunkint [longdistan, Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) [trunklocal] ; ; Local seven-digit dialing accessed through trunk interface ; exten => _9NXXXXXX, Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) [trunktollfree] ; ; Long distance context accessed through trunk interface ; exten => _91800NXXXXXX, Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) exten => _91866NXXXXXX, Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) exten => _91877NXXXXXX, Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}}) exten => _91888NXXXXXX, Dial(${GLOBAL(TRUNK)}/${FILTER(0-9, Dial(${HINT}, Dial(${MARK}, Dial(${TRUNK}/${EXTEN}, Dial(Console/dsp) ; Ring forever exten => 1236, Dial(DAHDI/g0/${EXTEN}, Dial(DAHDI/G2/${EXTEN:7}) ; Ditto for 256-325 [dundi-e164-local] ; ; Context to put your dundi IAX2 or SIP user in for ; full access ; include => dundi-e164-canonical include => dundi-e164-custo, Dial(DAHDI/G2/${EXTEN:7}) ; Expose all of 256-428 ;exten => _1256325XXXX, Dial(IAX2/${GLOBAL(IAXINFO)}@iaxtel.com/${EXTEN:1}@iaxtel) ; ; The SWITCH statement permits a server to share the dialplan with ; another server. Use with care: Reciprocal switch statements are not ; , Dial(IAX2/customer2) [dundi-e164-via-pstn] ; ; If you are freely delivering calls to the PSTN, Dial(IAX2/guest@pbx.digium.com/s@default) ; Call the Asterisk demo exten => 500, Dial(IAX2/JaneDoe, Dial(IAX2/otherbox/${EXTEN:7}) [dundi-e164-customers] ; ; If you are an ITSP or Reseller, Dial(JINGLE/asterisk@digium.com/mogorman@astjab.org) ;Dial via jingle using asterisk as the transport and calling mogorman. ;exten => 6394, Dial(JINGLE/caller/callee) ; Dial via jingle using labels ;exten => 6391, Dial(Local/6275/n) ; this will dial ${MARK} ;exten => 6275, Dial(MGCP/aaln/1@192.168.0.14) ;exten => 6390, Dial(Phone/phone0, Dial(SIP/${FILTER(0-9, Dial(SIP/${isnresult}, Dial(SIP/customer1) ;exten => _12564286001, Dial(SIP/Grandstream1, dial+101, DISA(no-password, Echo ; Do the echo test exten => 600, end) ; ; end of acme example ; ; Time context: you can patch this in via the following. ; ; [acme-internal] ; ... ; exten => 777, etc. ; exten => 1234, etc), etc) will ; require modification as well. Note that voicemail.conf already has ; a mechanism for timezones. ; [time] exten => _X., everybody out there may use your ; public context without authentication. In that case you want to ; double check which services you offer to the world. ; include => demo [default] ; ; By default w, exten) ; ;exten => 112, exten) ; optionally, first the AEL file will ; clear and then set all the global vars, for dialing the ; Asterisk demo. ; exten => 500, for evaluating echo latency. ; exten => 600, for example with remote ; IAX switching you transparently get access to the remote ; Asterisk PBX ; ; switch => IAX2/user:password@bigserver/local ; ; An "lswitch" is like a switch but is literal, freenum.org)}) ; perform our lookup with freenum.org same => n, give up exten => i, global variables will be cleared ; and reparsed on a dialplan reload, goodbye) ; ; this is the context our internal SIP hardphones use (see sip.conf) ; ;[acme-internal] ;exten => s, Gosub(${EXTEN}, Gosub(111, Gosub(112, Gosub(6000, Gosub(time) ; exten => 777, Goto(#, Goto(${ARG1}, Goto(${dontcntx}, Goto(${tortcntx}, Goto(6236, Goto(6275, Goto(default, Goto(fn-${DIALSTATUS}, Goto(fn-CONGESTION, Goto(outbound-freenum2, Goto(s, Goto(s-${DIALSTATUS}, Goto(stdexten-${DIALSTATUS}, Goto(stdexten-NOANSWER, Goto(submenu, GotoIf($["${FILTER(0-9, GotoIf($["${GLOBAL(FREENUMDOMAIN)}" = ""]?dial) ; check if we set the FREENUMDOMAIN global variable in [global] same => n, GotoIf($["${isnresult}" != ""]?from) same => n, GoToIf($[${AVAILSTATUS} = "1"]?autoanswer:fail) exten => s, Hangup ; ; Or a conference room (you'll need to edit meetme.conf to enable this room) ; ;exten => 8600, Hangup ; Hang them up. ; ; A timeout and "invalid extension rule" ; exten => t, Hangup ; s+1, Hangup ;include => default ; ;[submenu] ;exten => s, Hangup [demo] include => stdexten ; ; We start with what to do when a call first comes in. ; exten => s, Hangup [iaxtel700] exten => _91700XXXXXXX, Hangup exten => _s-., Hangup exten => s-BUSY, Hangup() ; ; ... ; include => time ; ; Note: if you're geographically spread out, Hangup() ; ;include => acme-extens ; ;exten => i, Hangup() ; ;include => trunkint ;include => trunkld ;include => trunklocal ; ;include => acme-extens ; ; you can test what your system sounds like to outside callers by dialing this ;exten, hint, HNS) exten => _X., Hungup() ; ; ANI context: use in the same way as "time" above ; [ani] exten => _X., i.e. group 2, if you ; would like a switch "A" to match before context "B", if you put your global variables into ; the AEL file, if you try this out, in parentheses after their name which can be used in goto situations. ; ; Contexts contain several lines, in that ; variable substitution is not performed at load time ; but is passed to the switch directly (presumably to ; be substituted in the switch routine itself) ; ; lswitch => Loopback/12${EXTEN}, includes, instead of the extensions.conf file. With clearglobalvars ; set, instruct) exten => 3, it is interpreted as a pattern rather than a ; literal. In patterns, it is the start extension. In most other cases, it will terminate the call with BUSY, just for fun exten => s, just type "core show applications" at your ; friendly Asterisk CLI prompt. ; ; "core show application " will show details of how you ; use that particular application in this file, later, letters, list them here ; ;exten => _1256428XXXX, list your customers here. ; ;exten => _12564286000, Macro(dundi-e164, Macro(page, mark, matches anything remaining (e.g. _9011. matches ; anything starting with 9011 excluding 9011 itself) ; ! - wildcard, Meetme(1234) ; ; Or playing an announcement to the called party, minutes are ; fine-grained only down to the closest even minute. ; ;include => daytime, mon-fri, n, n(autoanswer), n(dial), n(end), n(exten), n(fail), n(goodbye), n(instruct), n(menu), n(restart), Nikotel, no matter the number of extensions. ; ; By default, noop ; ; You can also monitor the status of a queue by providing a hint for a ; particular queue name. ;exten => 8502, NoOp [stdexten] ; ; Standard extension subroutine: ; ${EXTEN} - Extension ; ${ARG1} - Device(s) to ring ; ${ARG2} - Optional context in Voicemail ; ; Note that the current version will drop through to, NoOp() ; Add others here and Post on the Wiki!!!! exten => s, NoOp(ANI: ${EXTEN}) exten => _X., NoOp(Finish stdPrivacyexten BUSY) exten => stdexten-BUSY, NoOp(Finish stdPrivacyexten NOANSWER) exten => stdexten-NOANSWER, NoOp(ISN: ${DIALSTATUS}) same => n, NoOp(Start stdexten) exten => _X., NoOp(Start stdPrivacyexten) exten => _X., NoOp(Time: ${EXTEN} ${timezone}) exten => _X., one for each step of each extension. One may ; include another context in the current one as well, optionally with a date ; and time. Included contexts are included in the order they are listed. ; Switches may also be included within a context. The order of matching within ; a context is always exa, or ; label, or Asterisk reload. ; ; If clearglobalvars is not set, or combinations ; thereof. If an extension name is prefixed by a '_' ; character, or drop the call, or omitted, or send them to a ; general delivery mailbox, or system-wide ; default if one hasn't been set. exten => _X., or... ; ; The use of the LOCAL() function is purely for convenience. Any variable ; initially declared as LOCAL() will disappear when the innermost Gosub context ; in which it was declared returns. No, p) ; Ring the interface, Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n, park:701@parkedcalls ;exten => 6600, pattern match extensions, Performing ISN lookup for ${EXTEN}) same => n, Playback(acme/vm-brief-menu) ;exten => s, Playback(beep) exten => _X., Playback(demo-abouttotry); Let them know what's going on exten => 500, Playback(demo-echodone) ; Let them know it's over exten => 600, Playback(demo-echotest) ; Let them know what's going on exten => 600, Playback(demo-nogo) ; Couldn't connect to the demo site exten => 500, Playback(demo-thanks) ; "Thanks for trying the demo" exten => #, Playback(invalid) ; "That's not valid, Playback(spy-local) exten => _X., Playback(transfer, Playback(vm-from) exten => _X., Playback(vm-goodbye) ;exten => s, Playback(vm-invalid) ;exten => i, please go to www.gnophone.com or www.iaxtel.com ; [phones] exten => _XXXXXXXXXX, please report your reasons in a bug report ; on https://issues.asterisk.org. We have made good progress in providing ; something compatible with the old matcher; help us finish the job! ; ; This value, please see ; http://www.freenum.org. ; ; This is the dialing hook. use: ; include => outbound-freenum [outbound-freenum] ; We'll add more digits as needed. The purpose is to dial things ; like exte, Queue:markq ;exten => 8502, Queue:markq_avail ;exten => 8501, Queue(markq) ; ;To subscribe to the availability of a free member in the 'markq' queue. ;Note: '_avail' is added to the QueueName ;exten => 8501, Queue(markq) ; Some other handy things are an extension for checking voicemail via ; voicemailmain ; ;exten => 8500, r) ; Real extensions would go here. Generally you want real extensions to be ; 4 or 5 digits long (although there is no such requirement) and start with a ; single digit that is fairly large (like 6 o, regardless of whether the previous priority ; was associated with the current extension or not. The priority "same" or "s" ; means the same as the previously specified priority, restart) ; Start with the congratulations exten => 1000, Return [macro-page]; ; ; Paging macro: ; ; Check to see if SIP device is in use and DO NOT PAGE if they are ; ; ${ARG1} - Device to page exten => s, return to start exten => _stde[x]te[n]-., return to start exten => stdexten-BUSY, return to start exten => stdexten-DONTCALL, Return() ; For more information on applications, Return() ; If they press #, Return() [from-pstn] exten => 4339840, Return() [stdPrivacyexten] ; ; Standard extension subroutine: ; ${ARG1} - Extension ; ${ARG2} - Device(s) to ring ; ${ARG3} - Optional DONTCALL context name to jump to (assumes the s, Ringing ; Make them comfortable with 2 seconds of ringback ;exten => s, rm) ; ring without time limit ;exten => 6389, rt) ; permit transfer ;exten => 6245, rtT) ; Use hint as listed ;exten => 6245, s, s) ; s is for ANY call exten => s, s+1, same as n ;exten => 6245, sat-sun, SayDigits(${CALLERID(ani)}) ; playback again in case of missed digit exten => _X., SayDigits(${CALLERID(ani)}) exten => _X., SayPhonetic(z) ; use the timezone associated with the extension (sip only), SayUnixTime(${FUTURETIME}, see above - all pattern matches start with ; an underscore. exten => s, send the user into VoicemailMain exten => a, send to voicemail w/ busy announce exten => stdexten-BUSY, send to voicemail w/ unavail announce exten => stdexten-NOANSWER, Set(__SIPFROMDOMAIN=${GLOBAL(FREENUMDOMAIN)}) ; if we did set it, Set(__SIPFROMUSER=${CALLERID(num)}) same => n, Set(_ALERT_INFO="RA") ; This is for the PolyComs exten => s, Set(DIALSTATUS=CONGESTION) same => n, Set(FUTURETIME=$[${EPOCH} + 12]) exten => _X., Set(isnresult=${ENUMLOOKUP(${EXTEN}, Set(LANGUAGE()=fr) ; Set language to french exten => 3, Set(LOCAL(cntx)=${ARG2}) exten => _X., Set(LOCAL(cntx)=${ARG5}) exten => _X., Set(LOCAL(dev)=${ARG1}) exten => _X., Set(LOCAL(dev)=${ARG2}) exten => _X., Set(LOCAL(dontcntx)=${ARG3}) exten => _X., Set(LOCAL(ext)=${ARG1}) exten => _X., Set(LOCAL(ext)=${EXTEN}) exten => _X., Set(LOCAL(mbx)="${ext}"$["${cntx}" ? "@${cntx}" :: ""]) exten => _X., Set(LOCAL(mbx)=${ext}${IF($[!${ISNULL(${cntx})}]?@${cntx})}) exten => _X., Set(LOCAL(tortcntx)=${ARG4}) exten => _X., Set(SUFFIX=${CUT(EXTEN, Set(TIMEOUT(absolute)=10800) same => n, Set(TIMEOUT(absolute)=60) exten => 7999, Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds exten => s, Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds exten => s, simply put switch "A" in ; an included context "C", sip, SIP/${EXTEN}) ; ; ; System Wide Page at extension 7999 ; exten => 7999, SIP/${EXTEN}) ;[mainmenu] ; ; Example "main menu" context with submenu ; ;exten => s, SIP/Grandstream1) ; or if your peernames are the same as extensions exten => _7XXX, SIP/Grandstream1&SIP/Xlite1(Joe Schmoe) ; Channel hints for presence ;exten => 6245, SIPAddHeader(Call-Info: Answer-After=0) ; This is for the Grandstream, sipgate etc. ; Note that you must have a [sipprovider] section in sip.conf ; ;exten => _41X., skip) ; "Please hold while..." ; (but skip if channel is not up) exten => 1234, Snoms, so you can experiment to your hearts content. ; ;extenpatternmatchnew=no ; ; If clearglobalvars is set, some characters have special meanings: ; ; X - any digit from 0-9 ; Z - any digit from 1-9 ; N - any digit from 2-9 ; [1235-9] - any digit in the brackets (in this example, starting at the next highest channel than last ; time (aka. ascending rotary hunt group). ; R: use a round-robin search, starting at the next lowest channel than last ; time (aka. descending rotary hunt group). ; TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0) ;TRUNK=IAX2/user:pass@provider ;FREENUMDOMAIN=mydomain.com, stdexten(${GLOBAL(CONSOLE)})) exten => 1234, stdexten(${MARK})) ; assuming ${MARK} is something like DAHDI/2 ;exten => 6275, stdexten(${WIL})) ; Ditto for wil ;exten => 6536, stdexten(IAX2/foo)) ;exten => 12564286000, stdexten(SIP/nancy_1, stdexten(SIP/pete_1, steve, such as DAHDI, such as pbx_ael.so, such as SIP and MGCP, the bold, the dial plan. ; "core show functions" will list all dialplan functions ; "core show function " will show you more information about ; one function. Remember that function names are UPPER CASE., the extension _NXXXXXX would match normal 7 digit dialings, the global vars are all cleared, the new algorithm provides a flat response ; time, the old pattern matcher is used. ; ; ****This is a new feature! ********************* ; The new pattern matcher is for the brave, the speedup is ~25x ; with 10, the speedup is 1.32x ; with 88 extensions, the speedup is 10.4x ; With 1000 extensions, the speedup is 2.23x ; with 138 extensions, the speedup is 3.44x ; with 238 extensions, the speedup is 374x ; Basically, the speedup is 5.8x ; with 438 extensions, then, then "default") ; ; See above note in stdexten about priority handling on exit. ; exten => _X., then a new algorithm that uses ; a Trie to find the best matching pattern is used. In dialplans ; with more than about 20-40 extensions in a single context, then global variables will persist ; through reloads, then if an extension runs out of ; things to do, then the pbx_config will rewrite ; this file when extensions are modified. Remember that all comments ; made in the file will be lost when that happens. ; ; XXX Not yet implemented XXX ; static=yes ; , then we'll use it for our outbound dialing domain same => n(dial), this ; new algorithm can provide a noticeable speedup. ; With 50 extensions, this is ;how you do it. Subscribe to extension 6600 in sip, to resolve ; extensions that are not known here, To) ;exten => _XXXXXXXXXX, toll-free, too, transfer to operator ; ;exten => t, try again" ; ; Create an extension, try looking for a local E.164 solution ; then try DUNDi if we don't have one. ; include => dundi-e164-local include => dundi-e164-switch ; ; DUNDi can also be implemented as a Macro instead of u, u) ; If unavailable, u) ; Right to voicemail exten => 1236, u) ; Voicemail (unavailable) ;exten => 6245, use the #include command ; (without the ';'). Note that this is different from the "include" command ; that includes contexts within other contexts. The #include command works ; in all asterisk config, used by ; the pbx_config module. This is where you configure all your ; inbound and outbound calls in Asterisk. ; ; This configuration file is reloaded ; - With the "dialplan reload" command in the CL, Verbose(2, Voicemail(${mbx}, Voicemail(1234, Voicemail(6245, VoicemailMain exten => 8500, VoicemailMain(${mbx}) ; If they press *, Wait, Wait(0.25) exten => _X., Wait(1.25) exten => _X., Wait(1) ; Wait a second, Wait(1) ;exten => s, WaitExten ; Wait for an extension to be dialed. exten => 2, WaitExten ;exten => 1, WaitExten(5) ;exten => s, WaitUntil(${FUTURETIME}) exten => _X., when the extensions.conf ; file is loaded, where "C" is included in your original context ; before "B". ; ;[context] ;exten => someexten, which are collections of extensions. ; ; Extension names may be numbers, which generate their ; own dialtone and converse with the PBX only after a number is complete, which must always start ; with 1 to be considered a valid extension. The priority "next" or "n" means ; the previous priority plus one, who is on the console and has ; voicemail, will remain set to the previous value. ; ; NOTE: A complication sets in, with "reload" in this particular situation, yes, you ; probably don't want to have the demo there. ; include => demo ; ; An extension like the one below can be used for FWD, you can have SIP extensions ; specify their own local timezone in sip.conf as: ; ; [boi] ; type=friend ; context=acme-internal ; callerid="Boise Ofc. " ; ... ; ; use system-wide default timezone of MS, you can save dialplan by ; CLI command "dialplan save" too ; writeprotect=no ; ; If autofallthrough is set, you might consider setting ; this value to "yes" !! ; Please, you will need to ; activate them within asterisk.conf with the "execincludes" option. They ; are otherwise considered a security risk. ;#exec /opt/bin/build-extra-contexts.sh ;#exec /opt/bin/build-ext, Zulu 1 Comment

Recent Posts

  • How to resolve -bash: netstat: command not found centos stream 9
  • python script to STT output in a text file
  • New Install Asterisk 18 from source on CentOS Stream 8
  • How to save audio stream from Asterisk to a file via WebSocket
  • create web socket and save data in a text file
  • How to capture and analyze traffic with tcpdump
  • Installing Asterisk 20 From source On Rocky 9
  • html drop down with search from table php mysql
  • How to Install and Use FFmpeg on CentOS 8
  • How to get duration of MP3 or wav any audio File in PHP
  • How to Change location Of MariaDB Data Directory
  • How to check partition details of MySQL table
  • internal server error when download large file php
  • iostat : How to monitor disk activity and CPU load average
  • Webrtc with Asterisk 16 : complete configuration with SIP
  • What is inode and where this is stored
  • How to create Bootstrap Dropdown button/link
  • How to check supported RAM type in Linux System
  • MySQL update table based on value of another table Join
  • How to check the Public IP: Mera Wala IP
  • How to fix WordPress 404 Errors, requested URL was not found on this server: Home Page works
  • How to create Round Buttons and Square Buttons
  • Basic and Simple Examples of Skills with CSS
  • How to SUM Columns value in MYSQL
  • How to create a data table in bootstrap PHP and MySQL ?
  • How to DELETE Data Into MySQL Database Using PHP ?
  • How to Create MySQL user and Grant permission ?
  • What is XML & HTML ? What is Difference Between XML & HTML?
  • What is MySQL Binary logs ,their usages and how to purge binary logs ?
  • How to Select Data Into MySQL Database Using PHP ?
  • How to Remove spaces from string in MySQL ?
  • What is Different Between CHAR & VARCHAR ?
  • How to Insert Data Into MySQL Database Using PHP
  • What is MySQL SELECT Statement And Example of MySQL SELECT Query
  • What is INSERT Statement And Example of INSERT Query ?
  • What is MySQL Cluster vs Replication ?
  • How to Protect your computer from viruses and malware ?
  • What is the Use of Motherboard in a Computer ?
  • Happy Teacher’s Day 2022 – Quotes and Greetings on Teachers’ Day
  • NDA exam date question paper 2022 download and solution
  • What is Need of Information Security?
  • What is Information Security ?
  • How to Secure Web server ?
  • What is JSP ?
  • What is DDoS Attack ? & How Google Stopped the Largest -ever DDoS Attack ?
  • what is Malware ? And How to Stay Protected from Malware Attacks?
  • Best Practices to secure from DDoS Attack
  • How to protect Your Site Against DDoS Attack
  • How to secure from DDoS Attack
  • What is DDoS Attack. Basic introduction of DDoS

Recent Post

  • How to resolve -bash: netstat: command not found centos stream 9
  • python script to STT output in a text file
  • New Install Asterisk 18 from source on CentOS Stream 8
  • How to save audio stream from Asterisk to a file via WebSocket
  • create web socket and save data in a text file
© 2026 Eduguru • Built with GeneratePress