Tag Archives: Asterisk

Asterisk; The open source PBX solution.

Google Voice, Asterisk, Motif Channel Driver

I had some free time after a business trip to test out the motif channel driver which although not a new concept is supposed to work much better with the Google Voice/Talk Jabber/XMPP protocols.

My previous setup involved something of the following:

Main Number @ Google Voice -> Calls DID @ FlowRoute <- SIP CSIPSimple on Android Registers to FlowRoute
Voicemail & SMS hit Google Voice.
Voice calls hit Google Voice and redirect to FlowRoute.

This worked quite well, except two things.

First, people would call my Google Voice number and hear two to three rings before it even started ringing my FlowRoute number. This would throw off the number of rings my phone would receive before transferring the caller to the Google Voicemail.

Second, using Google Voice this way caused about a two to three second delay (time to transfer my voice to the other end so the conversation was always lagging behind and not flowing nicely) and sometimes had a slight, maybe 200ms, jitter (speeding up and slowing down of packets making the voice choppy and other anomalies).

I setup another VPS at my provider and installed the AsteriskNOW distribution. I previously tested AsteriskNOW, Elastix, and the FreePBX Distro on my ESXi setup to find the one I wanted. The Elastix distro I downloaded did not have Asterisk 11 so I could not use the motif channel driver (which was the point of this project), FreePBX Distro worked nicely but had lots of things I would never use installed using more memory. I ended up going with AsteriskNOW because it does not have all the extras installed, enabled and running from the start, and used less memory.

freepbx

I first opened Asterisk Advanced settings and changed the extension/user mode from `device` to `extensionanduser` so to add some extra little security.

Motif was enabled by default on AsteriskNOW so I just did the setup, verified the trunk, checked the outgoing route, created an incoming route, created an extension (device) and then created a user that was bound to that device, and registered CSIPSimple on my Android to the server. Test call went through instantly.

I then logged into the server using SSH and created a new user, gave them sudo privileges, changed SSH to listen on non-standard port, locked out root from logging in via SSH, and then setup Fail2Ban.

I also setup iptables on the server to only allow web admin from my home location (which I can VPN into if necessary), block all ports except the very few Asterisk needs to run.

Google Voice forward to Asterisk PBX

I recently started at a new place of employment and wanted to port my cell number over from Sprint which my old employer used. This was okay with them so I ended up porting the number to my Google Voice account. I wanted to forward it to a new DID that I would get with a SIP provider and run my Asterisk PBX from that.

I then got a new phone from the employer and installed a Android SIP client on it. Registered the extension to my Asterisk server and started some testing.

Well sometimes the calls work fine, and sometimes Google Voice ends up just sending the call to the Google Voicemail. I wanted to fix this problem, and I believe I have found the solution if your trying the same thing.

On your incoming route in Asterisk for your Google Voice number, you need to setup a wait period. In the incoming route screen of FreePBX there is a field that allows you to wait before picking up the call. I changed this from an empty default field to 2 seconds.

I then checked the box above it to enable Signal RINGING.

It took me a while to figure this out, but I now have my incoming Google Voice number coming to my Asterisk server, hitting the incoming route, then an IVR, then to various extensions and ring groups.

Google Voice using Asterisk

You will need a Google voice account to do this. You can get one for free by having a normal Google account, and visiting the Google Voice page.

The top most portion of this page: http://pbxinaflash.com/forum/showthread.php?t=10825 will help you setup the Google Voice portion on the Google side. Once you see the screen shots on that page, you can then use this configuration, or read up if you have their software to continue.

Just my working configuration files for using a google voice number on your asterisk server.

gtalk.conf

[general]
context=googlein
bindaddr=0.0.0.0
externip=xxx.xxx.xxx.xxx
;stunaddr=mystunserver.com
allowguest=yes

[guest]
disallow=all
allow=ulaw
connection=asterisk
context=googlein

jabber.conf

[general]
debug=no
autoprune=no
autoregister=yes
;collection_nodes=yes
;pubsub_autocreate=yes
;auth_policy=accept
;----------------------------------------------
[trunkname]
type=client
serverhost=talk.google.com
;pubsub_node=pubsub.astjab.org
username=[email protected]/Talk
secret=secretpassword
priority=1
port=5222
usetls=yes
usesasl=yes
;buddy=[email protected]
;distribute_events=yes
status=Available
statusmessage="I am an Asterisk Server"
timeout=100
keepalive=yes

Add following block to extensions_custom.conf

[googlein]
exten => _[0-9a-z].,1,Noop(Incoming Google Voice call for ${EXTEN})
exten => _[0-9a-z].,n,Set(CALLERID(name)=${CUT(CALLERID(name),@,1)})
exten => _[0-9a-z].,n,GotoIf($["${CALLERID(name):0:2}" != "+1"]?notrim)
exten => _[0-9a-z].,n,Set(CALLERID(name)=${CALLERID(name):2})
exten => _[0-9a-z].,n(notrim),Set(CALLERID(number)=${CALLERID(name)})
exten => _[0-9a-z].,n,Wait(1)
exten => _[0-9a-z].,n,Answer
exten => _[0-9a-z].,n,Wait(1)
exten => _[0-9a-z].,n,SendDTMF(1)
exten => _[0-9a-z].,n,Goto(from-trunk,gv-incoming-${CUT(EXTEN,@,1)},1)
exten => h,1,Macro(hangupcall,)

[gvoice-trunkname]
exten => _X.,1,Dial(Gtalk/username/+${EXTEN}@voice.google.com)
exten => _X.,n,Noop(GVoice Call to ${EXTEN} failed)
exten => h,1,Macro(hangupcall,)

Custom Trunk Configuration:
Trunk Name: GVoice-trunkname
Outbound Callerid: “Name”
Custom Dial String: local/$OUTNUM$@gvoice-trunkname

Outbound Route Configuration:
Use the GVoice trunk.

Incoming Routes DID will be:
gv-incoming-username (without @gmail.com)

Elastix 2.2.0 Stable Release

Elastix 2.2.0 Stable was released. I didn’t think much of it until I saw the new interface.

Along with a new interface, included are:

Kernel
   Linux(x86_64)-2.6.18-238.12.1.el5

 Elastix
   elastix-2.2.0-14
   elastix-firstboot-2.2.0-5
   elastix-pbx-2.2.0-14
   elastix-email_admin-2.2.0-9
   elastix-reports-2.2.0-6
   elastix-asterisk-sounds-1.2.3-1
   elastix-system-2.2.0-14
   elastix-my_extension-2.2.0-5
   elastix-a2billing-1.8.1-16
   elastix-addons-2.2.0-4
   elastix-extras-2.0.4-4
   elastix-agenda-2.2.0-5
   elastix-vtigercrm-5.1.0-8
   elastix-im-2.0.4-2
   elastix-security-2.2.0-7
   elastix-fax-2.2.0-4

 RounCubeMail
   RoundCubeMail-0.3.1-10

 Mail
   postfix-2.3.3-2.3.el5_6
   cyrus-imapd-2.3.7-7.el5_6.4

 IM
   openfire-3.5.1-3

 FreePBX
   freePBX-2.8.1-7

 Asterisk
   asterisk-1.8.7.0-0
   asterisk-perl-0.10-2
   asterisk-addons-1.8.7.0-0

 FAX
   hylafax-4.3.10-2rhel5
   iaxmodem-1.2.0-1.1

 DRIVERS
   dahdi-2.4.1.2-5
   rhino-0.99.4-2.rc1
   wanpipe-util-3.5.23-1

Avaya (Nortel) 1120E IP Phone with Asterisk

I got a hold of some Nortel IP phones at work and was doing some reaserch on how to connect them to an Asterisk server. At first I was using them with the UNIStim protocol support in Asterisk, but instead found out that you can download SIP firmware versions for most Nortel and Avaya phones directly from Avaya since they purchased Nortel.

You can get the SIP 4.x firmware here, or browse the other firmwares as well. You do not need a username and password to download them.

This site can help as well, to get you updated to a SIP firmware from UNIStim firmware and how to configure your TFTP settings.

I needed some more configuration settings in my TFTP DeviceConfig file so this is what I ended up using.

DNS_DOMAIN archaicbinary.home
SIP_DOMAIN1 archaicbinary.home
SERVER_IP1_1 192.168.XXX.XXX
SERVER_PORT1_1 5060
SERVER_RETRIES1 3
DEF_USER1 6001
ENABLE_SERVICE_PACKAGE YES
ENABLE_3WAY_CALL YES
TRANSFER_TYPE STANDARD
REDIRECT_TYPE RFC3261
FORCE_BANNER YES
BANNER Zharvek
UPDATE_USERS NO
ENABLE_UPDATE YES
ENABLE_PRACK YES
RTP_MIN_PORT 50000
RTP_MAX_PORT 50100
SIP_PING YES
AUTOLOGIN_ENABLE YES
DEF_LANG English
VMAIL *98
VMAIL_DELAY 300
EXP_MODULE_ENABLE YES
ENABLE_BT YES
DST_ENABLED YES
TIMEZONE_OFFSET -18000
# (GMT-10:00) Hawaii -36000
# (GMT-09:00) Alaska -32400
# (GMT-08:00) Pacific time (US and Canada) -28800
# (GMT-07:00) Mountain time (US and Canada) -25200
# (GMT-06:00) Central time (US and Canada) -21600
# (GMT-05:00) Eastern time (US and Canada) -18000
# (GMT-04:00) Atlantic time (US and Canada) -14400
# (GMT-03:00) Brasilia, Buenos Aires -10800
# (GMT+00:00) Greenwich, Dublin, London 0
# (GMT+01:00) Amsterdam, Madrid, Paris	3600
# (GMT+02:00) Athens, Istanbul	 7200
# (GMT+03:00) Moscow, St. Petersburg 10800
# (GMT+05:30) Bombay, Calcutta, Madras	 18000
# (GMT+08:00) Beijing, Chongqing, Hong Kong	28800
# (GMT+09:00) Osaka, Sapporo, Tokyo, Seoul 32400
# (GMT+10:00) Canberra, Melbourne, Sydney 36000
# (GMT+12:00) Auckland, Wellington 43200
SNTP_ENABLE YES
SNTP_SERVER pool.ntp.org
AUTO_UPDATE YES
AUTO_UPDATE_TIME 3600
# 48600 = 1:30pm
# 3600 = 1:00am
# 28800 = 8:00am 29700
# 54900 = 3:15pm
AUTO_UPDATE_RANGE 1
MAX_INBOX_ENTRIES 50
MAX_OUTBOX_ENTRIES 50
MAX_REJECTREASONS 5
MAX_CALLSUBJECT 5
IM_NOTIFY NO
IM_MODE DISABLED
DEF_DISPLAY_IM NO
MAX_IM_ENTRIES 20
MAX_ADDR_BOOK_ENTRIES 100
ADDR_BOOK_MODE BOTH
RECOVERY_LEVEL 0
ADMIN_PASSWORD 123456789
DISABLE_PRIVACY_UI YES
LOGOUT_WITHOUT_PASSWORD NO
NAT_SIGNALING NONE
NAT_MEDIA NONE
HOLD_TYPE RFC2543

Post Navigation