Category: Asterisk (PBX)

Mar 20 2009

Restricting outbound calls in FreePBX (whitelist)

NOTE: The following information comes from http://freepbx.org/news/2009-03-19/restricting-outbound-calls-in-freepbx-whitelist. It’s being copied here in the event the original post becomes unavailable. Please refer to the above web site for current information.
Read more »

Jun 24 2008

Elastix - The reliable PBX appliance software

I just discovered Elastix, It is an ISO image that installs CentOS, Asterisk, FreePBX, and other goodies to create an instant PBX. Compare it to PBX In A Flash and Trixbox.

May 28 2008

Grandstream HandyTone ATA “Busy” after sitting for awhile - No dial tone

The Grandstream HandTones have an issue where Asterisk thinks the device is busy after it sits for awhile. Calling the extension programmed for the device will send your call to voicemail. Picking up the handset will result in no dial tone. However if you hangup and pickup the handset again you will get dial tone. Calling the extension will now ring the phone … for awhile, and then the pattern repeats.

Here is a work around for this.
1. Set the Grandstream to NOT register for any extensions (FXS and/or FXO ports)
2. Set the sip.conf entry for the Grandstream to use a ‘host=ip address’ instead of ‘host=dynamic’. (I.e. host=192.168.0.2)

If you are using FreePBX then do not touch the sip.conf file. Instead bring up the extension associated with the Grandstream device and change the “Host” field from dynamic to the IP address of the Grandstream.

Of course you will want to use DHCP reservations for the Grandstream or assign a static IP address so that the IP address does not change.

I can’t explain why Asterisk and Grandstream don’t play nice together when Asterisk is set to use a dynamic address. All that I know is that everything works perfectly when you assign the IP address. Maybe someone else can shed some light on this phenomenon.

May 10 2008

Soft Phones : iaxLite and sipLite

I was looking for a small, lite weight software based phone for my Windows laptop that would connect back to my Asterisk PBX using the IAX protocol. iaxLite is perfect and works great. I haven’t tried sipLite (same phone but uses theSIP protocol) yet. Well worth a look if you are using Windows.
Soft Phone : iaxTalk.com !, VOIP::Asterisk::Phone::ATA::USB

iaxLite is a IAX2 softphone. sipLite is a SIP softphone

Apr 13 2008

DUNDi Tutorial for Asterisk@Home

TheGoldFish.net Blog » Blog Archive » DUNDi Tutorial for Asterisk@Home

Confused by DUNDi? Yeah, so was I. It took me a few weeks of kicking my Asterisk box, but I finally got it working. Here’s a step by step tutorial on how to get DUNDi working with Asterisk@Home. This tutorial was written using an Asterisk@Home 2.5 system with FreePBX 2.1, but should work from Asterisk@Home 2.0 onward.

Nov 30 2007

HOWTO: Enable ENUM lookups in Asterisk

If you run an Asterisk PBX you can easily perform ENUM lookups to make direct peer-to-peer calls with other ENUM users. The way this works is a user dials a public telephone number (i.e. 1-718-555-1234). Your Asterisk box queries one or more e164 name servers for that number. If the number is listed, the lookup will return the dial string to connect directly over the Internet instead of going through the Public Switched Telephone Network. Can you say free? If the number is not listed, then go and process the call as usual with your telephone carrier.

Put these lines into your enum.conf file:

search => e164.org
search => e164.arpa

Here are the ENUM lines I insert in my extensions.conf just before my standard call to my telephone carrier.
This is for Asterisk version 1.4

[macro-dial_inet]
;
; Send call to selected Internet providers
;   ${ARG1} - What to dial
;
exten => s,1,noop(macro-dial_inet)
;--- ENUM ---
;try enum first since it's free
exten => s,n,NoOp(Doing Enum lookup)
exten => s,n,Set(registrars=e164.arpa-e164.org-e164.info-enum.org-e164.televolution.net) ; place your registrars to search here
exten => s,n(regloop),Set(registrar=${CUT(registrars,,1)})
exten => s,n,Set(registrars=${CUT(registrars,,2-)})
exten => s,n,Set(protocols=SIP-IAX2) ; place your protocols to search here (i.e. SIP-IAX2-IAX-H323)
exten => s,n(protoloop),Set(protocol=${CUT(protocols,,1)})
exten => s,n,Set(protocols=${CUT(protocols,,2-)})
exten => s,n,Set(enumARG1=${ARG1})
exten => s,n,ExecIf($[ ${ARG1:0:3} = "011"],Set,enumARG1=${ARG1:3})
exten => s,n,Set(count=${ENUMLOOKUP(+${enumARG1},${protocol},c,,${registrar})})
exten => s,n,Set(counter=0)
exten => s,n(resultloop),GotoIf($[$["x${counter}"="x"]|$["${counter}" >= "${count}"]]?resultend)
exten => s,n,Set(counter=$[${counter}+1])
exten => s,n,Set(ENUM=${ENUMLOOKUP(+${enumARG1},${protocol},,${counter},${registrar})})
exten => s,n,GotoIf($["${LEN(${ENUM})}" = "0" ]?continue)
exten => s,n,Set(DIALSTR=${protocol}/${ENUM})
exten => s,n,Dial(${DIALSTR}|120)
exten => s,n,GotoIf($[$["${DIALSTATUS}"="CHANUNAVAIL"]|$["${DIALSTATUS}"="CONGESTION"]]?continue:hangup)
exten => s,n(continue),Goto(resultloop)
exten => s,n(resultend),GotoIf($["${protocols}"=""]?regend:protoloop)
exten => s,n(regend),GotoIf($["${registrars}"=""]?fallthrough:regloop)
exten => s,n(hangup),NoOp(Dial failed due to ${DIALSTATUS})
exten => s,n,Hangup
exten => s,n(fallthrough),NoOp(Found No Enum Entry)
;--- CONTINUE WITH TELEPHONE CARRIER ---

That’s all you need to check for and use ENUM records. Now you might want to return the favor by listing your own telephone number(s) in one of the e164 databases. If you are not a telephone carrier then the easiest way is to create an account on www.e164.org. Then add this to your iax.conf file so that anonymous connections can be made to your Asterisk PBX.

[guest]
type=user
context=anonymous

Then in your extensions.conf file, add an [anonymous] context that allows connections to your receptionist. Here is an example:

[anonymous]
exten => _X.,1,Dial(SIP/0)     ;send the call to the receptionist
exten => _X.,n,Hangup
Nov 29 2007

HOWTO: Enable userfield in Asterisk CDR

The default configuration for using MySQL for Asterisk CDR records does not allow storing values in the userfield field. The userfield field
appears in the MySQL table and the dialplan functions for setting userfield values work correctly, however, the CDR is written without the userfield.

To enable writing of userfield values to the CDR table in MySQL add the following line to /etc/asterisk/cdr_mysql.conf file:

userfield=1

Asterisk will need to be restarted for this configuration change to take effect.

[ed] Thanks for the tip Seth

Nov 23 2007

Polycom: Enable persistent volume settings on sip phones

Polycom SIP phones have three volume settings; speaker phone, handset, and headset. Some countries have laws requiring that the handset and headset volume settings be reset after each call. Therefore, Polycom only enables the persistent volume setting on the speaker phone. To change this, open up the sip.cfg file on your configuration server and change these three settings to your liking. 0 disables persistence, and 1 enables it. Afterward, reboot your phone to pickup the new settings.

<volume
        voice.volume.persist.handset="0"
        voice.volume.persist.headset="0"
        voice.volume.persist.handsfree="1"
    />
Oct 31 2007

Accessing Exchange 2007 Unified Messaging

HOWTO Guide located here.
Read more »

Oct 13 2007

FreePBX: Restrict Call Forward settings to current extension

I don’t like the way that a user can set call forward information for other users on the system. A rogue user could redirect someone else’s calls to his/her extension. I also didn’t like having two access codes to enable and disable call forward data. To “fix” this I disabled all call forward feature codes except for *52, *72, and *90 and placed the following in my extensions_custom.conf. These contexts in _custom are caught first in the dialplan before the built-in call forward contexts. Dial the code once and you will be prompted for the extension to forward to. Dial the code again and the forward is deactivated.

Read more »

Jul 17 2007

Polycom: Configure SIP phones to auto answer (aka Voice Call)

I wanted a way to emulate the Voice Call feature of my legacy NEC Dterm phones. Voice Call allows you to dial another extension, enter a code, and have the phone auto answer in speakerphone mode. Here is how I got my Polycom SIP phones to do it:

First, modify the alertinfo and RING_ANSWER sections of sip.cfg file like this:

<alertInfo voIpProt.SIP.alertInfo.2.value="Ring Answer" voIpProt.SIP.alertInfo.2.class="4"/>
<RING_ANSWER se.rt.4.name="Ring Answer" se.rt.4.type="ring-answer" se.rt.4.timeout="1000" se.rt.4.ringer="13" se.rt.4.callWait="6" se.rt.4.mod="1"/>

Reboot your phone so that it picks up the new configuration from your server. Now add something like this to your dialplan:

exten => _*90.,1,SIPAddHeader(Alert-Info: Ring Answer)
exten => _*90.,n,Goto(default,${EXTEN:3},1)           ;Now dial the extension as usual without the *90

Dialing *90 before the extension number will set the SIP Header which the Polycom configuration file will see. When it does, it will change the ringer tone to number 11 (Custom), ring for 1 second, and then answer the phone in speakerphone mode.

Jul 17 2007

Polycom: Reboot SIP phones from within Asterisk

If you need to reboot a SIP phone remotely you can easily do it from the Asterisk CLI prompt like this:

CLI> sip notify polycom-check-cfg xxx

where xxx is the name the SIP phone used to register to Asterisk with. The above line reboots Polycom phones. Unless you configured your Polycom config files differently, this will only reboot the Polycom if the config files on your FTP/TFTP/HTTP server have changed. You can also reboot other types of phones by substituting ‘polycom-check-cfg’ with one of the following:

  • sipura-check-cfg
  • grandstream-check-cfg
  • cisco-check-cfg

If your phones register by extension, you can write a reboot routine into your dialplan. See voip-info.org for more information.

Jun 30 2007

Polycom: Reset Phone

Polycom Phones - voip-info.org

Resetting the Polycom Phone Password if you forget it!!!

You won’t find this information in the manual. I had to contact customer support.

After pressing 4, 6, 8, and * it asks for the ADMIN password. Obviously, if you’ve lost the admin password you’re out of luck. Instead of the admin password, use the MAC address for a full reset!

Jun 29 2007

Asterisk - Calls without answer supervision time out and drop

I have an application where my legacy PBX connects to a weather radio using a #72 access code.

Here is my setup:
PHONE -> SIP-1 -> TDM-1 -> LEGACY PBX -> WEATHER RADIO

My SIP phone connects to an Asterisk box which I’ll call SIP-1. When #72 is dialed, SIP-1 connects to another Asterisk box which I’ll call TDM-1. TDM-1 sends #72 calls into the legacy PBX over E & M trunks. The connection between the legacy PBX and the weather radio is over trunks without answer supervision turned on. After 60 seconds the call drops.

Here is the fix:
If there is no answer supervision Asterisks drops out after 60 seconds. So the simple fix was to answer the call on TDM-1 before dialing the legacy PBX like this:

Exten => #72,1,Answer()
Exten => #72,2,Dial(Zap/g1/${EXTEN})
Jun 29 2007

Asterisk - MP3 Music On Hold

I am developing an Asterisk PBX and wanted to use MP3 versions of my company’s music files. Asterisk would not play the MP3 files until I installed the Addon package.
Asterisk addon asterisk-addons - voip-info.org
Read more »

Jun 29 2007

Asterisk SLA (Shared Line Appearances)

SLAs are a new feature of Asterisk. Documentation on this is slim at the moment. However, here is a document explaining it along with some examples.
[asterisk] Log of /branches/1.4/doc/sla.pdf