How to configure Asterisk for VoicePulse Connect
Disclaimer: First off I, Jonathan, have no vested interest in VoicePulse or affiliation with them. I'm writing this documentation as a way to contribute back to the Asterisk community. My only hope is that this document will make the setup of Asterisk with VoicePulse even easier and encourage more people to start working with Asterisk.
Who is VoicePulse?
VoicePulse is a broadband phone company that offers connectivity via SIP and IAX to the PSTN. The most appealing thing about VoicePulse is how easy it is to connect your Asterisk server to VoicePulse. It allows you to truly start playing with Asterisk without any special hardware in your computer. They offer phone numbers in several hundred cities in several dozen US states.
Purchasing an account
The first step is to purchase an account with VoicePulse's connect service. Go to their website at http://connect.voicepulse.com and click the signup link located on the toolbar. This service costs 2.40 cents a minute for outbound calls to the US48 and $11/month for an inbound phone number. So I recommend that you purchase a $10 account. That will provide you enough money to purchase a phone number and do some outbound calling. It's the smallest amount of their service that you can purchase. It will allow you to play around with the service and see if you like it. If you like the service, then charge up your account with more money.
Logging back in to your VoicePulse account
This section is to save you from the stupid mistake that so many of us have made. There are TWO seperate login pages for VoicePulse. The one on the main menu of http://www.voicepulse.com is NOT for the connect service. You must return to http://connect.voicepulse.com to log back in and manage your account.
Configuring outbound dialing
After signing up with the service you'll receive an email with some instructions. The email will contain a couple of important pieces of information that you'll want to place in your Asterisk configuration.
Example (data is fake, don't try to actually use it!):
Host: gw5.voicepulse.com
Login: Abc1dEF2GH
Password: zYX9VUt8sr
Context: VPWS
First thing to do is edit the /etc/asterisk/extensions.conf and place the line from the email that below the [default] line:
exten => _1NXXNXXXXXX,1,Dial,IAX2/Abc1dEF2GH@voicepulse/${EXTEN}
This line instructs Asterisk to route outbound calls to VoicePulse. The next thing to do is to edit the /etc/asterisk/iax.conf and add the information about how to connect to VoicePulse. At the bottom of the file paste the information from the email. It should look something like this:
[voicepulse]
context = foo
secret=zYX9VUt8sr
auth=md5
type=friend
host=gw5.voicepulse.com
At this point you should be able to start Asterisk up, connect with your SIP or IAX phone, and place an outbound call to your favorite land line friend. DIAX is a good IAX based phone and X-Lite is a good SIP based phone.
To provide your own CallerID number on outbound calls, add the following prior to the Dial line. (Renumber the priority as appropriate)
exten => _1NXXNXXXXXX,1,SetCallerID("Me" <2165551212>)
The name portion ("Me") will not apply when contacting PSTN lines, but the phone number will be matched to the number database for the local telephone company. Remember that providing a 313-xxx-xxxx identification to a phone in the 216 area code will likely just result in "Michigan Call" instead of a person's name. Providing a number that is local to the destination will result in a proper name lookup.
Configuring inbound dialing (optional)
If you're interested in receiving inbound calls from VoicePulse on your Asterisk box, then complete the following section. The first thing you will need to do is purchase a phone number. Log in to the VoicePulse connect interface at http://connect.voicepulse.com. Click on the phone numbers tab. Select the area code and prefix that you would like your phone number. Pick your area code so that your friends can call you locally. Or you could purchase a phone number in another city where your friends and family live, etc. Remember that there is a charge of like $7.95/month for this phone number. So you'll have to have at least that much credit on your account.
Important: The inbound lines are billed the first of every month, and VoicePulse does not do prorated billing for inbound numbers. If you sign up for a number on the 30th of the month, you will get billed $7.95 and then another $7.95 a day or two later.
After you've purchased the phone number through the web interface, you will receive an email with the information on how to register your Asterisk to VoicePulse so that it receives the inbound calls. The email will contain a line that says something like:
register => Abc1dEF2GH:zYX9VUt8sr@gw5.voicepulse.com
Remember to replace the example login and password with the one that you received in your introductory email. You will want to place this register statement under the general section of the /etc/asterisk/iax.conf. I typically place it just under the port statement. This will cause Asterisk to register with VoicePulse when it is started up.
Don't go placing that inbound call just yet! You'll need to define an extension for your inbound number. Let's say the phone number that you're assigned is 212-555-1212 just for the sake of this example. Then you will want to edit the /etc/asterisk/extensions.conf file and add a section like this:
[voicepulse]
exten => 2125551212,1,Goto(mycompany,s,1)
This line instructs Asterisk to route the call to the start of the mycompany context. You'll want to edit mycompany to be whatever the context name is for your Asterisk install. At this point you should be able to place an inbound call, enter your extension number from the menu, and talk away.
Note that if you do not have a dedicated context set up to handle the inbound Voicepulse number, as shown above, but instead allow the inbound calls to go to a default context, such as:
incoming
exten => s,1,answer...
for some reason the "s" extension will not work with Voicepulse. To use a default handler like this you must use "_.", such as:
incoming
exten => _.,1,answer...
Choosing the codec to use with VoicePulse
If you would like a higher quality call from VoicePulse than GSM provides, then choose the codec you want with the following lines in the /etc/asterisk/iax.conf:
disallow=all
allow=ulaw
allow=alaw
This example removed everything but G.711 ulaw and G.711 alaw. VoicePulse supports the following codecs:
- GSM
- G.711ulaw
- G.711alaw
- ADPCM
- ILBC
- SPEEX
For a list of the abbreviations used in the iax.conf file for the codecs click on Asterisk config iax.conf.
Conclusion
If you follow this documents instructions on how to configure Asterisk and VoicePulse and think something was left out, then please signup for an account on this WIKI and edit the document. Your notes and tips are very important.The example config did not work for me
I think partly because VoicePulse has changed their hardware configuration.
This is an example of the configuration I am using that is working as of 8/2/2004.
****************** iax.conf
general
;
; At this point I have tried so many different
; fixes that I am no longer sure if the
; static binding and "externip" entries
; are required to get VoicePulse to work.
; But these setting WORK for me
;
bindaddr=192.168.199.10
externip=asterisk-pbx.dyndns.org
language=en
bandwidth=medium
disallow=all
allow=ulaw
allow=alaw
allow=ilbc
allow=gsm
jitterbuffer=no
:
; register with voicepulse
;
; this format is critical
;
register=>in-username:password@gw5.voicepulse.com
;
; this context directs inbound
; VoicePulse calls to a handler
; in the inbound calls section of
; extensions.conf
;
voicepulse
context=voicepulse-in
username=username
secret=password
auth=md5
type=friend
disallow=all
allow=gsm
allow=ulaw
allow=alaw
allow=ilbc
host=gw5.voicepulse.com
nat=yes
qualify=yes
;
; this is the first of two servers
; at VoicePulse that ONLY handle
; out bound calls
;
vpconnect-t01
type=peer
context=VPWS
username=username
secret=password
host=gwiaxt01.voicepulse.com
auth=md5
qualify=yes
disallow=all
allow=gsm
allow=ulaw
allow=alaw
allow=ilbc
nat=yes
externip=asterisk-pbx.dyndns.org
;
; this is the second of two servers
; at VoicePulse that ONLY handle
; out bound calls
vpconnect-t02
type=peer
context=VPWS
username=username
secret=password
host=gwiaxt02.voicepulse.com
auth=md5
qualify=yes
disallow=all
allow=gsm
allow=ulaw
allow=alaw
allow=ilbc
nat=yes
externip=asterisk-pbx.dyndns.org
;
****************** extensions.conf
globals
;
; IMPORTANT - I have seen a number of suggested
; dial plans for VoicePulse that have either
; the username or the password in the dial
; command. This may work for some folks, but
; it DID NOT WORK for me. I found that to
; dial out from VoicePulse, I had to use
; both the in the "username:password" format.
;
; IMPORTANT - Notice that I setup a dial format
; for each of the two VoicePulse "peer"
; contexts that were entered in sip.conf
;
IAXTRUNK1=IAX2/username:password@vpconnect-t01
IAXTRUNK2=IAX2/username:password@vpconnect-t02
;
voicepulse-in
;
; Voicepulse rings in with the extension set the
; DID number they assigned you. You MUST have
; a handler that parses the DID number and
; then hands off to another context to get it
; get it * to handle the inbound call.
;
exten => _8005551212,1,SetMusicOnHold(default)
exten => _8005551212,2,Dial(${RINGGROUP03},10,tr)
exten => _8005551212,3,Wait(2)
exten => _8005551212,4,Answer
exten => _8005551212,5,Wait(1)
exten => _8005551212,6,Goto(mainmenu,s,1)
;
;
outbound
;
; Master context for outbound dialing
;
; In my dial plan I dial
; 9 to dial out using analog
; 8 to dial out using VoicePulse
; 7 to dial out using BroadVoice
;
; How you modify your dial plan is up to you
; but I can tell you this WORKS for me.
;
; handle outbound local calls - force VoicePulse
;
; In our area (Wash DC Metro), local calls require
; 10 digit dialing. Notice that I insert a
; "1" in front of the EXTEN on a 10 digit
; local dial call. VoicePulse NEEDS this.
; Suspect this is not important in areas
; where local calls are still 7 digits, but
; it WORKS for me.
;
; Notice that I try one of the VoicePulse peers
; then the other. VoicePulse seems to be
; getting popular in spite of their poor
; support. They have implemented redundant
; outbound servers to handle the load. If one
; is seriously lagged, this dial plan tries the
; other one.
;
; GOTTA have that @VPWS on the end of the dial
; string! Won't authenticate without it!!
;
exten => _8NXXNXXXXXX,1,ChanIsAvail(${IAXTRUNK1})
exten => _8NXXNXXXXXX,2,Dial(${IAXTRUNK1}/1${EXTEN:1}@VPWS)
exten => _8NXXNXXXXXX,3,Hangup
exten => _8NXXNXXXXXX,102,ChanIsAvail(${IAXTRUNK2})
exten => _8NXXNXXXXXX,103,Dial(${IAXTRUNK2}/1${EXTEN:1}@VPWS)
exten => _8NXXNXXXXXX,104,Hangup
exten => _8NXXNXXXXXX,203,Congestion
;
; handle outbound long distance calls - force VoicePulse
;
exten => _81NXXNXXXXXX,1,ChanIsAvail(${IAXTRUNK1})
exten => _81NXXNXXXXXX,2,Dial(${IAXTRUNK1}/${EXTEN:1}@VPWS)
exten => _81NXXNXXXXXX,3,Hangup
exten => _81NXXNXXXXXX,102,ChanIsAvail(${IAXTRUNK2})
exten => _81NXXNXXXXXX,103,Dial(${IAXTRUNK2}/${EXTEN:1}@VPWS)
exten => _81NXXNXXXXXX,104,Hangup
exten => _81NXXNXXXXXX,203,Congestion
;
; handle outbound internationl calls - force VoicePulse
;
exten => _8011.,1,ChanIsAvail(${IAXTRUNK1})
exten => _8011.,2,Dial(${IAXTRUNK1}/${EXTEN:1}@VPWS)
exten => _8011.,3,Hangup
exten => _8011.,102,ChanIsAvail(${IAXTRUNK2})
exten => _8011.,103,Dial(${IAXTRUNK2}/${EXTEN:1}@VPWS)
exten => _8011.,104,Hangup
exten => _8011.,203,Congestion
;
;
Voicepulse Connect Flexrate for Local and Longdistance
Modified version of Voicepulse Flexrate to accommodate 7 and 10 digit dialing.
globals
VOICEPULSE_API_KEY=your voicepulse api key
VOICEPULSE_API_PREFIX=VOICEPULSE_
VOICEPULSE_GATEWAY_OUT_A=voicepulse02 ; your iax/sip.conf entries
VOICEPULSE_GATEWAY_OUT_B=voicepulse01
outbound context
; Local 7 Digit Numbers
exten => _NXXXXXX,1,Set(CALLERID(all)="Callerid Name" <calleridnumber>)
exten => _NXXXXXX,2,Set(OTHER_PROVIDERS_FLAT_RATE=0.02);
exten => _NXXXXXX,3,Macro(voicepulseflexrate,${VOICEPULSE_API_KEY},1NXX${EXTEN}) ;put your areacode before ${EXTEN}
exten => _NXXXXXX,4,Verbose(The rate is ${VOICEPULSE_FLEXRATE})
exten => _NXXXXXX,5,GotoIf($${VOICEPULSE_FLEXRATE} > ${OTHER_PROVIDERS_FLAT_RATE}?outbound|${EXTEN}|700
exten => _NXXXXXX,6,Dial(IAX2/${VOICEPULSE_GATEWAY_OUT_A}/1NXX${EXTEN});desired area code prefix
exten => _NXXXXXX,7,GotoIf($${DIALSTATUS}=CHANUNAVAIL?${EXTEN}|500)
exten => _NXXXXXX,500,Dial(IAX2/${VOICEPULSE_GATEWAY_OUT_B}/1NXX${EXTEN})
exten => _NXXXXXX,700,Dial(IAX2/username@voip-providerA/1NXX${EXTEN}) ; if they're cheaper
exten => _NXXXXXX,701,Dial(IAX2/${VOICEPULSE_GATEWAY_OUT_A}/1NXX${EXTEN}); failover voicepulse 1
exten => _NXXXXXX,702,Dial(IAX2/${VOICEPULSE_GATEWAY_OUT_B}/1NXX${EXTEN}); failover voicepulse 2
exten => _NXXXXXX,703,Dial(IAX2/username@voip-providerD/1NXX${EXTEN}) ; another failover
; US Numbers
exten => _1NXXNXXXXXX,1,Set(CALLERID(all)="Your Name" <your number>)
exten => _1NXXNXXXXXX,2,Set(OTHER_PROVIDERS_FLAT_RATE=0.011)
exten => _1NXXNXXXXXX,3,Macro(voicepulseflexrate,${VOICEPULSE_API_KEY},${EXTEN})
exten => _1NXXNXXXXXX,4,Verbose(The rate is ${VOICEPULSE_FLEXRATE})
exten => _1NXXNXXXXXX,5,GotoIf($${VOICEPULSE_FLEXRATE} > ${OTHER_PROVIDERS_FLAT_RATE}?outbound|${EXTEN}|800
exten => _1NXXNXXXXXX,6,Dial(IAX2/${VOICEPULSE_GATEWAY_OUT_A}/${EXTEN})
exten => _1NXXNXXXXXX,7,GotoIf($${DIALSTATUS}=CHANUNAVAIL?${EXTEN}|600)
exten => _1NXXNXXXXXX,600,Dial(IAX2/${VOICEPULSE_GATEWAY_OUT_B}/${EXTEN})
exten => _1NXXNXXXXXX,800,Dial(IAX2/username@voip-providerA/${EXTEN})
exten => _1NXXNXXXXXX,801,Dial(IAX2/${VOICEPULSE_GATEWAY_OUT_A}/${EXTEN})
exten => _1NXXNXXXXXX,802,Dial(IAX2/${VOICEPULSE_GATEWAY_OUT_B}/${EXTEN})
exten => _1NXXNXXXXXX,803,Dial(IAX2/username@voip-providerD/${EXTEN})
Page Changes
Re: Voicepulse SIP ASTERISK nothing
Thanks
NOTICE5686: chan_iax2.c:7359 socket_process: Registration of 'MY_DEVICE_LOGIN' rejected: 'Registration Refused' from: '64.61.93.90'
Re: Voicepulse SIP ASTERISK nothing
If anyone knows, please email me at austin.speer@gotechon.com or reply to this post.
Thanks.
Voicepulse "Registration Refused" code 29 error
These were the errors:
Jun 7 21:22:10 NOTICE5443: chan_iax2.c:7410 socket_read: Registration of 'carmen123' rejected: 'Registration Refused' from: '64.61.93.90'
with iax2 debug on:
Rx-Frame Retry No — OSeqno: 000 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00003ms SCall: 01125 DCall: 00006 64.61.93.87:4569
Rx-Frame Retry No — OSeqno: 000 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00003ms SCall: 00634 DCall: 00005 64.61.93.90:4569
Rx-Frame Retry No — OSeqno: 000 ISeqno: 001 Type: IAX Subclass: REGREJ
Timestamp: 01002ms SCall: 01125 DCall: 00006 64.61.93.87:4569
CAUSE : Registration Refused
CAUSE CODE : 29
The problem was that the username and password I was given by my client regarding the voicepulse account was not the "chanell" username and password.
The voicepulse configuration guide and all else on the web seems to gloss over this detail.
To get the username:password, log onto the connect.voicepulse.com site, and look under "chanell". Each chanell will have its own username and password.
Hope this helps you avoid the time I lost.
Jonathan Galpin
Iqzero.net
Voicepulse SIP ASTERISK nothing
Any one with the same problem?
Very poor quality
Incoming voice quality is terrible on IAX.
The SIP server goes down several times a day.
Other providers works well on both SIP and IAX.
We're less than 20ms away from VoicePulse on our T1 connection...
Re: Create A Channel?
Create A Channel?
Inbound Calling
Re: no IAX2 channel
no IAX2 channel
any ideas?
- my asterisk is working fine with SIP clients within my NAT - does IAX2 also not play nice with NAT like SIP, and if so what can i do about iit?