Although all my 1100/1200 series phones are connected to asterisk, it shouldn't matter a whole lot.
SIP or UNISTIM connected to a different PBX
Assumptions are you are deploying your phones via TFTP already and are somewhat familiar with the update process of one of these models of phones.
Once the phones have the dialplan, if you off-hook dial, the phone will nearly instantly dial the number when you are done typing it. No "SEND" button required in matching dialplan cases.
As of writing this i haven't worked out fully the trickery for international calls since the numbers are all different lengths, its a work in progress.
SO first, in your 11xxeSIP.cfg or 12xxSIP.cfg file have this entry in there.
[DIALING_PLAN]
DOWNLOAD_MODE AUTO
VERSION 0001
PROTOCOL tftp
FILENAME dialplan.txt
Save that.
Now create a new file in your TFTP directory called "dialplan.txt" (or change to whatever you want, just make sure it matches in the .cfg file FILENAME section.
In dialplan.txt put in the following and save it.
/* ------------------------------------------------------------------- */
/* */
/* Avaya 1100-1200 series IP Deskphone Dial Plan */
/* */
/* ------------------------------------------------------------------- */
/* Domain used in the dialed URL of the SIP INVITE message */
$n="avaya.com"
$t=300
%%
/* DIGITMAP: 10 digits starting with 1 */
(1[2-9]x{9})|(1[2-9]x{9})# && sip:$$@$n;user=phone && t=300
/* DIGITMAP: 10 digits starting with 91 */
(91[2-9]x{9})|(1[2-9]x{9})# && sip:$$@$n;user=phone && t=300
/* DIGITMAP: 4 Digit Extensions starting with 88XX */
(88x{2})|(88x{2})# && sip:$$@$n;user=phone && t=300
/* DIGITMAP: 4 Digit Extensions starting with 5xXX */
(5x{3})|(5x{3})# && sip:$$@$n;user=phone && t=300
/* DIGITMAP: 7 Digit Extensions starting with 7digitdial */
([2-9]x{6})|([2-9]x{6})# && sip:$$@$n;user=phone && t=300
/* DIGITMAP: VOICEMAIL */
(*99)|(*99)# && sip:$$@$n;user=phone && t=300
/* DIGITMAP: 10 digits starting with 555 */
(555[2-9]x{6})|(555[2-9]x{6})# && sip:$$@$n;user=phone && t=300
/* DIGITMAP: 911 Emergency */
(911|911)# && sip:$$@$n;user=phone && t=300
/* DIGITMAP: 9911 Emergency */
(9911|9911)# && sip:$$@$n;user=phone && t=300
/* End of Dial Plan */
Now if you are newly deploying this feature, you'll need to update the 11XXeSIP.cfg file in your system by increment the "VERSION" under [USER_CONFIG].
Now in your phone press the "SERVICE" button, or it might look like a picture of a globe with two arrows pointing left and right.
When you press that, the menu on the phone will change and you should see "CHECK FOR UPDATES". Pressing this will cause your phone to contact the TFTP and check its config for a change. If it see the VERSION number in [USER_CONFIG] has increased, it will reload the entire file...which will include the dialplan.txt file. in MOST cases your phone won't fully reboot, but some phones do for some reason. During my testing and deployment, especially after the phones have a dialplan, they will easily load any future diaplan changes if you increase the "VERSION" under [DIALING_PLAN}
I've included some examples in the above configs that may apply to you with some easy modifications.
Tuesday, June 27, 2017
Thursday, May 11, 2017
Use asterisk Direct Dial from IVR to goto a different PBX system
So lets say you are running a Cisco or other type of SIP capable PBX in your business, but you want to use asterisk IVR (cost, familiarity whatever) and want to add the feature of "direct dial extension" from that IVR. The problem is FreePBX gui is designed to only look at the "Extension" list and use that to match. Which makes perfect sense. But if your asterisk box is only hosting an IVR, you wouldn't have all the extensions on the asterisk server. This is basically a work around for that.
I've used this for DEMO purposes. I wouldn't roll this code into production since its not been tested. There could be all kinds of vulnerabilities! Use at your own risk.
What the code does:
We modify the FreePBX IVR code not look at extensions, but to instead match the outbound dial plan of the Asterisk box that triggers calls to use the trunk to your downstream PBX
So if your PBX has 4000-4999 extension, you probably have a dial patter in an outbound route that looks like 4XXX
With this code, if someone in the IVR dial 4001, that will match this outbound route and send the call down the trunk.
1. Create an IVR with the “Direct Dial” option enabled in the GUI. Note the name of it. In my example its called IVR_Test
2. Save/Apply changes in FreePBX
3. Open up the file /etc/asterisk/ extensions_additional.conf
4. You want to look for the outbound route that you use to push calls to your downstream PBX Trunk under the [outbound-allroutes] heading.
(it’ll look something like this)
[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-16 ; PBX_PROD_01
Explanation of my “outrt-16 PBX_PROD_01” trunk
In my example above, outrt-16 is the outbound route in my gui that I use to trigger calls to send down a trunk.
If the number 4XXX is dialed, outbound route #16 “PBX_PROD_01” will be looked at to send calls down the trunk Called Asterisk_100_11
5. So, copy the outbound route entry that matches your outbound route that’s used to trigger your Cisco trunk. (my example you would copy “include => outrt-16 ; PBX_PROD_01 “
6. Find the IVR in the code…it’ll look something like this:
[ivr-3] ; IVR_Test
include => ivr-3-custom
include => from-did-direct-ivr
exten => s,1,Set(TIMEOUT_LOOPCOUNT=0)
exten => s,n,Set(INVALID_LOOPCOUNT=0)
[[…..snip……]]
exten => h,1,Hangup
exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup
;--== end of [ivr-3] ==--;
7. Now paste the line you copied into the IVR and make it look like this:
[ivr-3] ; IVR_Test
include => ivr-3-custom
include => outrt-16 ; PBX_PROD_01
include => from-did-direct-ivr
8. Copy this IVR section and paste it into (Saving the IVR module in this override file ensures that future FreePBX changes won’t overwrite anything)
/etc/asterisk/ extensions_override_freepbx.conf
(Copy everything from [ivr-3] ; IVR_Test right to ;--== end of [ivr-3] ==--; )
No need to make any changes.
9. Save changes and close file
Don’t bother saving the changes in “/etc/asterisk/ extensions_additional.conf” as these get overwritten anyway by FreePBX.
You can just close this file without saving changes.
10. Now go into the console of asterisk using “ asterisk –cvvvvvvr “
11. Type “RELOAD”
12. Now make a test call to your IVR and dial an extension. See if it works!
I've used this for DEMO purposes. I wouldn't roll this code into production since its not been tested. There could be all kinds of vulnerabilities! Use at your own risk.
What the code does:
We modify the FreePBX IVR code not look at extensions, but to instead match the outbound dial plan of the Asterisk box that triggers calls to use the trunk to your downstream PBX
So if your PBX has 4000-4999 extension, you probably have a dial patter in an outbound route that looks like 4XXX
With this code, if someone in the IVR dial 4001, that will match this outbound route and send the call down the trunk.
1. Create an IVR with the “Direct Dial” option enabled in the GUI. Note the name of it. In my example its called IVR_Test
2. Save/Apply changes in FreePBX
3. Open up the file /etc/asterisk/ extensions_additional.conf
4. You want to look for the outbound route that you use to push calls to your downstream PBX Trunk under the [outbound-allroutes] heading.
(it’ll look something like this)
[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-16 ; PBX_PROD_01
Explanation of my “outrt-16 PBX_PROD_01” trunk
In my example above, outrt-16 is the outbound route in my gui that I use to trigger calls to send down a trunk.
If the number 4XXX is dialed, outbound route #16 “PBX_PROD_01” will be looked at to send calls down the trunk Called Asterisk_100_11
5. So, copy the outbound route entry that matches your outbound route that’s used to trigger your Cisco trunk. (my example you would copy “include => outrt-16 ; PBX_PROD_01 “
6. Find the IVR in the code…it’ll look something like this:
[ivr-3] ; IVR_Test
include => ivr-3-custom
include => from-did-direct-ivr
exten => s,1,Set(TIMEOUT_LOOPCOUNT=0)
exten => s,n,Set(INVALID_LOOPCOUNT=0)
[[…..snip……]]
exten => h,1,Hangup
exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup
;--== end of [ivr-3] ==--;
7. Now paste the line you copied into the IVR and make it look like this:
[ivr-3] ; IVR_Test
include => ivr-3-custom
include => outrt-16 ; PBX_PROD_01
include => from-did-direct-ivr
8. Copy this IVR section and paste it into (Saving the IVR module in this override file ensures that future FreePBX changes won’t overwrite anything)
/etc/asterisk/ extensions_override_freepbx.conf
(Copy everything from [ivr-3] ; IVR_Test right to ;--== end of [ivr-3] ==--; )
No need to make any changes.
9. Save changes and close file
Don’t bother saving the changes in “/etc/asterisk/ extensions_additional.conf” as these get overwritten anyway by FreePBX.
You can just close this file without saving changes.
10. Now go into the console of asterisk using “ asterisk –cvvvvvvr “
11. Type “RELOAD”
12. Now make a test call to your IVR and dial an extension. See if it works!
Tuesday, February 28, 2017
Add HD and auto mount drive in linux (virtual)
Install the new VHD in your VM system.
Boot up the image.
fdisk –l
The circled item shows the new 100g drive that was added. "/dev/sdb"
FORMAT disk:
fdisk /dev/sdb
At the command prompt select " p " and press ENTER
Just double check to make sure the drive you are about to format name and size matches the one you installed
Now select option " N " and press enter
Now select option " P " for extended
The select Parition #1
For "FIRST SECTOR" and "END SECTOR" just press enter to accept defaults
Once thats done, select OPTION T
Select Partition 1 and then use option "L" to list your option codes to see them.
Select the option 83 (Linux) press ENTER
Now selection "W" to write your changes to the table
Now type the following:
mkfs –t ext2 /dev/sdb
That my take a couple of minutes for that command to complete. When its done type in:
Type fsck /dev/sdb –f –y
The system should do some system checks, all of which should pass:
Reboot the system.
shutdown -r now
Once rebooted, we'll make a mounting point for this drive.
mkdir /mnt/recordings
mount –t ext2 /dev/sdb /mnt/recordings
Now if you type "DF" you should see it in the list
type in the following:
cat /proc/mounts
look at the bottom, should see sdb reference
/dev/sdb /mnt/recordings ext2 rw 0 0
Might look something like this. COPY that line then type
vi /etc/fstab/
paste the line above into the fstab and save it. If yourdata has 'relatime' option. change that to 'noatime'
save your changes..reboot
Monday, February 27, 2017
How to configure Static routing in Linux CENTOS
Static routes will be added usually through “route add” or “ip route” command.
example:
route add -net DESTINATIONip netmask NETMASKip gw GATEWAYip dev ethX
route add -net DESTINATIONip netmask NETMASKip gw GATEWAYip dev ethX
So to add a specific route of 113.121.192.219 out gateway 10.128.216.129 via interface ETH1:
route add -net 113.121.192.219 netmask 255.255.255.255 gw 10.128.216.129 dev eth1
To make it persistent, add it to /etc/sysconfig/network-scripts/route-ethX
Adding Persistent static route:
MAKE SURE YOU HAVE THE SYNTAX EXACTLY RIGHT, ELSE IT WILL FAIL
CAPITALS!
CAPITALS!
You can have multiple ones of course, you just increment the value. There is no space, follow the example below. This one shows adding 3 different static routes.
GATEWAY0=10.1.100.1
NETMASK0=255.255.0.0
ADDRESS0=10.1.0.0
GATEWAY1=10.1.100.1
NETMASK1=255.255.0.0
ADDRESS1=10.2.0.0
GATEWAY2=10.1.100.1
NETMASK2=255.255.0.0
ADDRESS2=10.3.0.0
GATEWAY3=10.1.100.1
NETMASK3=255.255.0.0
ADDRESS3=10.4.0.0
Save and close the file and restart networking. Reboot to prove!
Wednesday, February 15, 2017
Asterisk. Ask questions, record answers.
What this code does.
The system will ask questions, after each it will record the caller for a maximum of 15 seconds (you can change this of course) or until the users presses # key, whichever comes first.
This code allows for two questions and answers to be given.
This code allows for two questions and answers to be given.
In this example, after the 2nd answer is given, the system will play back both recordings together so you can hear it.
If caller press # the call will stop recording and continue to next questions
If caller either doesn't say anything for 3 seconds, the system continues to next question (changeable of course)
Once the questions are done, the caller is hungup on.
The system generates a .call file which will contact an extension of your choice, one that goes directly to voicemail.
The file that is recorded is saved to thevoicemail box, then the call hangsup.
Your asterisk system will send the email to the recipient using your voicemail parameters.
Your asterisk system will send the email to the recipient using your voicemail parameters.
I've tested this in the FreePBX Distro using 13.0.190.11 worked ok as a beta test. It may need alteration for your own environments, however I am using commands that have been around a long time so should be compatible with most versions.
Code from strangers should never be tested in a production environment.
INSTALLATION
To make the code simpler, for those not versed in asterisk dialplan, any line starting with a ; semicolon is a remark line and can be safely removed for ease of viewing. Lines with ; are there to either leave a comment, or to have the system not execute that line of code.
STEP 1
ADMIN->CONFIG EDIT
open up "extensions_custom.conf"
Copy the code below between the ------ lines into the bottom of extensions_custom.conf and then save the file.
Replace code from previous BETA 1 & 2 releases
START OF DIALPLAN CODE
---------------------------------------------------------------------------
[macro-questionanswer]
exten => s,1,answer()
exten => s,n,playback(/var/lib/asterisk/sounds/en/custom/question1)
exten => s,n,Record(${UNIQUEID}.ulaw,3,15,a)
exten => s,1,answer()
exten => s,n,playback(/var/lib/asterisk/sounds/en/custom/question1)
exten => s,n,Record(${UNIQUEID}.ulaw,3,15,a)
exten => s,n,playback(/var/lib/asterisk/sounds/en/custom/question2)
exten => s,n,Record(${UNIQUEID}.ulaw,3,15,a)
exten => s,n,Record(${UNIQUEID}.ulaw,3,15,a)
;Generate .call file that asterisk will use to send the call to a voicemail box
;Change XXXXX to be an extension in your system that you want called and have the message left on
exten => s,n,system(echo "Channel: LOCAL/XXXXX" > /var/lib/asterisk/sounds/recording.call)
exten => s,n,system(echo "Context: macro-questionanswer1" >> /var/lib/asterisk/sounds/recording.call)
exten => s,n,system(echo "Extension: s" >> /var/lib/asterisk/sounds/recording.call)
exten => s,n,system(echo "Setvar: playfile=${UNIQUEID}" >> /var/lib/asterisk/sounds/recording.call)
exten => s,n,system(echo CallerID: "${CALLERID(name)}" ${CALLERID(number)} >> /var/lib/asterisk/sounds/recording.call)
exten => s,n,system(mv /var/lib/asterisk/sounds/recording.call /var/spool/asterisk/outgoing)
exten => s,n,hangup()
exten => s,n,hangup()
[macro-questionanswer1]
exten => s,1,wait(1)
exten => s,n,senddtmf(#)
exten => s,n,playback(/var/lib/asterisk/sounds/${playfile})
exten => s,1,wait(1)
exten => s,n,senddtmf(#)
exten => s,n,playback(/var/lib/asterisk/sounds/${playfile})
;delete sound file.
exten => s,n,system(rm /var/lib/asterisk/sounds/${playfile}.ulaw)
exten => s,n,hangup()
exten => s,n,system(rm /var/lib/asterisk/sounds/${playfile}.ulaw)
exten => s,n,hangup()
-----------------------------------------------------------------------------
END OF DIALPLAN CODE
Click on "SAVE"
If you are updating this code from previous versions, you can stop here and test it out.
SCROLL DOWN TO THE BOTTOM TO THE "TESTING IT OUT" section
SCROLL DOWN TO THE BOTTOM TO THE "TESTING IT OUT" section
STEP 2
ADMIN->CUSTOM DESTINATIONS
Create a new custom destination "questionanswer"
Set the target as
macro-questionanswer,s,1
Save those changes
ADMIN->CUSTOM DESTINATIONS
Create a new custom destination "questionanswer"
Set the target as
macro-questionanswer,s,1
Save those changes
STEP 3
Create a way to trigger the application to run from dialplan.
For example, create a IVR, and set one of the numeric values a caller can enter to Custom Destination -> "questionanswer""
Create a way to trigger the application to run from dialplan.
For example, create a IVR, and set one of the numeric values a caller can enter to Custom Destination -> "questionanswer""
STEP 4
Save your changes AND apply the configuration.
Save your changes AND apply the configuration.
STEP 5
Create your question files.
Create your question files.
Use system recordings, and either record them over your phone, or through a 3rd party sound recording application. If recording with another app, they must be saved as 8000khz MONO 16bit WAV PCM.
The recordings you make, set their name to "recording1" "recording2" "recording3"
STEP 6
in /tmp/ create a file called "email.txt"
In that file put in something like
SUBJECT: NEW RECORDING
Here is a new recording to review.
in /tmp/ create a file called "email.txt"
In that file put in something like
SUBJECT: NEW RECORDING
Here is a new recording to review.
Save changes.
TESTING IT OUT
Call and leave your recordings. System should leave the message and you should get an email alert with the message attached.
HOW IT WORKS
1> As previous, your recorded questions are played, and the answers are recorded into a single file.
2> After the last question is answered, the system will hangup.
3> Then the system internally places a call to the extension that you want the system to send the voicemail through.
4> When that system picks up, assuming voicemail, the system sends a "#" tone to the extension to bypass any greetings and additional instructions that voicemail systems have.
5> The system in the background plays the message that your caller left, and sends it as a voicemail.
6> Your recipient should get the message alert in their email.
1> As previous, your recorded questions are played, and the answers are recorded into a single file.
2> After the last question is answered, the system will hangup.
3> Then the system internally places a call to the extension that you want the system to send the voicemail through.
4> When that system picks up, assuming voicemail, the system sends a "#" tone to the extension to bypass any greetings and additional instructions that voicemail systems have.
5> The system in the background plays the message that your caller left, and sends it as a voicemail.
6> Your recipient should get the message alert in their email.
Give it a test!
If you create .txt file with the proper calling parameter information, you can drop that file in the outgoing folder in asterisk and that will make your phone call happen.
Essentially these 4 lines generate the 4 line file.
Essentially these 4 lines generate the 4 line file.
The number you want to call, this example is extension 1234
exten => s,n,system(echo "Channel: LOCAL/1234" > /var/lib/asterisk/sounds/recording.call)
exten => s,n,system(echo "Channel: LOCAL/1234" > /var/lib/asterisk/sounds/recording.call)
The context you want executed when the destination 1234 answers
exten => s,n,system(echo "Context: macro-questionanswer1" >> /var/lib/asterisk/sounds/recording.call)
exten => s,n,system(echo "Context: macro-questionanswer1" >> /var/lib/asterisk/sounds/recording.call)
The line you want executed in the context
exten => s,n,system(echo "Extension: s" >> /var/lib/asterisk/sounds/recording.call)
exten => s,n,system(echo "Extension: s" >> /var/lib/asterisk/sounds/recording.call)
Variables you want passed to the system when 1234 answers
exten => s,n,system(echo "Setvar: playfile=${UNIQUEID}" >> /var/lib/asterisk/sounds/recording.call)
exten => s,n,system(echo "Setvar: playfile=${UNIQUEID}" >> /var/lib/asterisk/sounds/recording.call)
The variable is the most complicated piece. UniqueID is the unique number given for each call. When you are recording the calls, we use that number as the file number. However, when we call the new number to leave the voicemail, that generates a new unique ID. So in this code we set a temporary variable of "playfile" to store the unique number that is the file name. This temporary file is, in itself unique to this call, so it wont affect things if you have multiple question answers recording simultaneously..
Monday, January 23, 2017
Asterisk Trouble Shooting
Recently saw this appearing in my ASTERISK Live LOG over and over
netsock2.c: getnameinfo(): ai_family not supported
There are a few entries on the internet pointing to IAX trunks. Mine was related to IAX. I had created an IAX trunk on the server in questions, but not finished it properly. In my case I only created one end of it, the other PBX was not done, so just started popping this message over and over. Deleted the trunk, all was resolved.
netsock2.c: getnameinfo(): ai_family not supported
There are a few entries on the internet pointing to IAX trunks. Mine was related to IAX. I had created an IAX trunk on the server in questions, but not finished it properly. In my case I only created one end of it, the other PBX was not done, so just started popping this message over and over. Deleted the trunk, all was resolved.
STEP by STEP Installing Collabnet with Subversion on UBUNTU 14.04.1
STEP by STEP Installing Collabnet 4.0.12-3944.141 with Subversion version 1.8.11-3944.141 on UBUNTU 14.04.1 LTS
Basically I just did the exact steps below to get the SVN repo up and running to a point where i can log into it. I handed it off to other people to actually use, so thats as far as I took it.
- Installed a "next-next-next" implementation of Ubuntu 14.04 server. I didn't install any special packages. Just the default install. You could probably customize.
- Logged in as root on the console, then ran the following command to install SSH:
sudo apt-get install openssh-server - Create a non-root user. In this example I am using svnadministrator . (couple of prompts for this procedure, password/user, detail, etc.)
sudo adduser svnadministrator - Edit permissions
sudo visudo - Look for--->
root ALL=(ALL:ALL) ALLand then below that put in the entry below:svnadministrator ALL=(ALL:ALL) ALL - Save your changes.
- LOGGED OUT OF ROOT and then log in as the non-root user you created (svnadministrator in this example).!!!The notes for subversion says to try and do it as a non-root user, so I did.!!!
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update - (You can change the "6" to "7" or "8" in the next command, depending on the Java version you want. SVN seemed to want 6)
sudo apt-get install oracle-java6-installer - (Agree to terms.)
sudo apt-get install oracle-java6-set-default - Set the home variable.
export JAVA_HOME=/usr/lib/jvm/java-6-oracle/ - Get the installer from http://www.collab.net/svnedge. You'll need to login in and/or create an account.(I downloaded it to my Windows box then SCP'd it over to my Linux box)
tar -zxf CollabNetSubversionEdge-1.1.0_linux-x86.tar.gz - The tar.gz file is unpacked to the csvn directory.
cd csvn bin/csvn start - (Wait a minute or so...)
14. Once I authenticate to the default logon for it, (i can't rember what it is) I "START' the SVN service in the GUI Main page and people start using it.http://192.168.x.x:3343/csvn/login/auth
==================
MOVING SVN repository.
We ran out of HD space and had to move the repo to a new HD in the same server (we couldn't expand successfully due to a LVM format volume that just wouldn't work for us.
So we added a second HD
I put it in the Machine (virutal) then booted gpart and formated it as a EXT4 format
then I booted into ubuntu and did mounted the drive.
Then logged into the repo
stop the repo
changed the file location of the repos under ADMINISTRATION-> SERVER SETTINGS -> Repository Directory
Changed that location and then saved it.
Go to repositories -> repository list, they'll probably not be there. Move the folders from the old location to the new location...then use the "DISCOVER" button and they'll show back up.
thats its.
Subscribe to:
Posts (Atom)








