I no longer recommend using Asterisk’s Google Voice support — try these methods instead!

 

Important
This is an edited version of a post that originally appeared on a blog called The Michigan Telephone Blog, which was written by a friend before he decided to stop blogging. It is reposted with his permission. Comments dated before the year 2013 were originally posted to his blog.

EDIT (May, 2018): FreePBX and Asterisk users that wish to continue using Google Voice after Google drops XMPP support should go here: How to use Google Voice with FreePBX and Asterisk without using XMPP or buying new hardware.

This article was originally written in January of 2012, and has been heavily edited in an attempt to update it a bit.

Not that anyone probably cares what I think, but anyone who regularly reads this blog (or any of the other VoIP-related blog that cover Asterisk) may have noticed that prior to the release of Asterisk 11, Asterisk’s support for Google Voice had become less and less reliable over time, particularly for incoming calls. You have to do all sorts of “tricks” to make it work, and these usually involve adding delays that don’t always fix the problem, inconvenience your callers, and possibly cause more hangups as people get tired of waiting for you to answer the phone.

Therefore, I suggest that if you are using a version of Asterisk earlier than Asterisk 11, you stop using Asterisk’s Google Voice support completely. Assuming that you feel you must keep using an older version of Asterisk, I suggest trying one or more of the following:

  1. Use YATE as a gateway between Asterisk and Google Voice. See Using YATE to overcome Google Voice issues in FreeSWITCH and Asterisk, this article and this forum thread on YATE in a Flash, and this thread on YATE Tips & Tricks). YATE is what powers Bill Simon’s gateway (mentioned below). See comments by Bill and pianoquintet under this article.
  2. Use Bill Simon’s Google Voice-SIP gateway to handle your Google Voice calls. Some people may not want to rely on an external service for this, while others may very much appreciate having the option. I mention it for those in the latter group. For more information see Bill Simon’s Free SIP-to-XMPP Gateway Easily Puts Google Voice on Your VoIP Phone (Voxilla). While the linked articles talk about using the gateway with a SIP device, it can be used as an Asterisk trunk.  EDIT: As of April 7, 2015 the Google Voice Gateway has been relaunched and there is now a one-time fee to sign up.
  3. If your only issue is with incoming calls, you could use a DID to bring the calls into your system.  But keep in mind that Google Voice does not like it when calls are answered the moment they connect, so in your FreePBX Inbound Route be sure to set the “Pause Before Answer” option to at least 1.  I have found that a 1 second pause is sufficient, but I’m not saying that is the correct value for everyone, or even that everyone will need to include such a pause (some DID providers may delay the call sufficiently before connecting through to your system that the pause isn’t needed).

At this point, any of those would likely produce better results than using the Google Voice support in any version of Asterisk prior to Asterisk 11.

EVERYTHING in this article is my personal opinion.  Nothing here should be taken as a statement of fact.

EDIT:  Ward Mundy reports that he just may have found a workaround for the incoming calls issue — see this thread in the PBX in a Flash forum.

Why do Western Digital hard drive power supplies leak so much AC voltage?

 

Important
This is an edited version of a post that originally appeared on a blog called The Michigan Telephone Blog, which was written by a friend before he decided to stop blogging. It is reposted with his permission. Comments dated before the year 2013 were originally posted to his blog.

We recently changed out a case on a computer power supply.  The new case is metal whereas the old one was plastic, and as I was plugging in a USB cable from a USB hub I got a shock.  Not only that, when I accidentally touched it to the bottom of the computer’s case, the computer power supply completely shut down and would not restart until I physically removed the power cord and plugged it back in.  Since this hub had worked just fine with the old case, it led me to wonder what the issue was.  I put a voltmeter on the shell of the USB cable and measured about 50 volts AC to ground!

To make a long story short, I have four external USB drives plugged into that hub and they are all Western Digital. Every single external hard drive had AC voltage on its USB cable shell (when disconnected from the hub), whereas no other devices had more than a volt or two.

That led me to disconnect the power supplies from each of the hard drives, at which point I made a, um, shocking discovery!

I measured the voltage from the power supply DC plugs to ground.  For this test I plugged them into an outlet on a totally different circuit from the one I plug my computers into, since a friend has suggested that the outlets might be miswired (hot and neutral reversed).  I tested for that possibility and that was not the case, but it was still easier to take them out to the kitchen for this test.  I photographed the results for three of them but a fourth gave similar results.  I’m sorry that the pictures are a bit blurry but if I’d used flash it would have washed out the LED display so the exposure times were a bit longer than I would have liked, given that my hand isn’t all that steady.

Western Digita Power Supply #1 - 44 volts leakage

Western Digita Power Supply #2 - 57 volts leakage

Western Digita Power Supply #3 - 44 volts leakage

EDIT: For a few hours after I first posted this, I had image duplicated as . Sorry about that.

A few observations I noted while testing the voltage:

It didn’t matter which way the AC plug was inserted into the socket – the voltage was the same or very nearly the same (within a couple of volts) either way.

It didn’t matter whether I measured to the center or the shell of the DC plug – the voltage was exactly the same either way (this makes me think the leakage might be through a capacitor or capacitors, since otherwise there would be a DC short).

Whatever voltage I measured at the power supply found its way to the USB plug shell once the power supply was connected to the hard drive.

I measured this on FOUR different power supplies, all ones that came with Western Digital hard drives of various sizes. On three I got the 44 volt reading and on one I got 57 volts.

If it were just one or two power supplies doing this, I’d suspect a flaw in that power supply. But since every single one of them is doing it, I have to think it is something inherent in the design of the switching power supplies used with external hard drives. For some reason this never caused any problem with my old computer or case but this new one (new case) can get really strange if you connect or disconnect the USB hub while it is running and the power cable is connected. I just hate the fact that there is this much stray AC but it must be a problem specific to the hard drive power supplies so I don’t think there is anything I can do about it.

I don’t know of any way to correct this problem, or even if it really is a problem. But I REALLY don’t like it!

By the way, I don’t mean to impugn Western Digital specifically, it’s just that right now all four of the external drives connected to this particular computer are WD’s.  I do NOT know whether or not this problem affects power supplies that come with other makes of hard drives (if anyone wants to test yours and post the results in a comment, I’d appreciate it, but please don’t unless you have worked with electricity enough to know how to do the test safely, since I will not be responsible if you fry yourself or your equipment because you didn’t know how to do the test!).

DynDNS (mostly) discontinues free DNS service

 

Important
This is an edited version of a post that originally appeared on a blog called The Michigan Telephone Blog, which was written by a friend before he decided to stop blogging. It is reposted with his permission. Comments dated before the year 2013 were originally posted to his blog.

Dynamic DNS service selections in DD-WRTOver the years, many people have used DynDNS as a way to get a free domain name that will “track” their actual IP address, even if their ISP changes it.  Apparently that free ride has all but come to an end.  If you read the instructions that How-To Geek posted in their article How To Easily Access Your Home Network From Anywhere With DDNS, you will note that when you go to the DynDNS site now, it looks nothing like it did then, and the totally free option seems to have disappeared.

Apparently if you have an existing DynDNS account you can keep it as long as you don’t let it expire, but if you do let it expire or if you are trying to set up a new DynDNS account for yourself or someone else, the free option is no longer shown. It appears that now the only way to get a free DynDNS account is to sign up for a 14-day DynDNS Pro Free Trial and then cancel it before the free trial period is up. Then, “You may keep one hostname free of charge for trying the Pro Trial.” The problem with this is that you have to provide a major credit card to sign up for the trial. This will be a show stopper for many users (it definitely takes DynDNS off my list of recommended services).

I had recommended using DynDNS in my article, Using DynDNS to solve the problem of keeping a firewall open to remote users at changeable IP addresses. Now I sort of wish I had recommended someone else.

Some home routers support several Dynamic DNS services, and one of the most popular is No-IP. My guess is that they will be the main beneficiary of the decision by DynDNS to make their free service less accessible. I think they have been around nearly as long as DynDNS (if not longer) and I’ve not heard anything negative about them, so I now recommend you check out No-IP in preference to DynDNS, unless you enjoy having to give up your credit card information and then having to remember to cancel a “free trial” within an allotted timeframe.

To those router manufacturers that only offer DynDNS as a DDNS option, please consider adding No-IP (and maybe a few others) as a DDNS option in your next firmware upgrade.  Those that have replaced their router’s firmware with DD-WRT have the option to use DynDNS.org, freedns.afraid.org, ZoneEdit.com, No-IP.com, 3322.org, easyDNS.com, TZO.com, and DynSIP.org (or you can use another “custom” service). I do not know if all of those have a free service offering but I believe that most of them do. So, commercial router manufacturers could offer options other than DynDNS, and I hope they’ll consider doing so.

 

Interesting thread on integrating Speech to Text with Asterisk and PBX in a Flash

 

Important
This is an edited version of a post that originally appeared on a blog called The Michigan Telephone Blog, which was written by a friend before he decided to stop blogging. It is reposted with his permission. Comments dated before the year 2013 were originally posted to his blog.
An old microphone
Image via Wikipedia

I just wanted to call your attention to this thread on the PBX in a Flash forum:

Exploring Speech to Text

This thread explores the possibility of adding a simple speech to text demo, and also discusses the possibility of transcribing e-mails to text.  It uses Google’s speech recognition service, and it is free to use.  I doubt you would be free to use it in any commercial application, but for those that just like to tinker with new capabilities for your Asterisk server, you might find this interesting.

I haven’t personally tried it yet, but I will say that if you are using some FreePBX based distro other than PBX in a Flash, you may need to remove the calls to the Flite speech synthesizer (or install Flite support).  I hate Flite (I think the voice quality sucks harder than a black hole — okay, maybe I exaggerate a little, but Cepstral voice synthesis is much better than Flite — unfortunately Cepstral is not free) so I’m not going to tell you how to install it.  Flite’s only used in the demo in the first post so if you are trying to do something else (such as attempt voicemail transcription, as discussed in the thread) you probably don’t need it anyway.

What would be nice would be the ability to dial a code, record a short message, and then have a transcription e-mailed to the address you use for voicemail notifications.  THAT is something I’d actually use on occasion!

EDIT: After posting this, I tried a basic installation on a NON-PBX in a Flash system.  Besides removing the references to Flite, I found I had to do the following:

  1. Change ownership of /var/lib/asterisk/agi-bin/speech-recog.agi to  asterisk:asterisk
  2. Install the perl modules mentioned in the “use” statements in /var/lib/asterisk/agi-bin/speech-recog.agi
  3. Install flac (some users may also need to install sox, but I had installed that previously).

Create an “Unmount” service in Mac OS X

 

Important
This is an edited version of a post that originally appeared on a blog called The Michigan Telephone Blog, which was written by a friend before he decided to stop blogging. It is reposted with his permission. Comments dated before the year 2013 were originally posted to his blog.

I have been having a problem with a couple of different USB devices that I occasionally connect to my Mac.  I would attempt to eject them and they would immediately remount themselves.  Therefore, it was almost impossible to do a “clean” disconnect of the device.  If you’ve had this problem you’ll know exactly what I’m talking about, and if you haven’t then you don’t need this article.  If you choose to use the information here, bear in mind that even though it worked for me I have no idea what it will do on your system, so use at your own risk or don’t use it at all!

I found that I could “Unmount” rather than “Eject” the devices using Disk Utility and then they would not automatically remount, but it was a bit of a pain to have to go to Disk Utility every time I wanted to unmount a device.  Automator to the rescue! Here are the three steps to create and use an “Unmount” service in OS X:

1. Fire up the Automator application and when it comes up, tell it you want to create a Service:

2. Create an Automator workflow exactly as shown here (click on the image to enlarge it).  Note that the top part must say “Service receives selected Folders in Finder” and after that there is one step, “Run Shell Script”, in which you’ll pass input as arguments. In the text field simply put hdiutil unmount $1

Save the workflow using an appropriate filename (I suggest “Unmount”). It will be saved in your ~/Library/Services/ directory.

3. To use the service, open your /Volumes directory in Finder and select the volume you want to unmount, and right-click on it (or however you bring up the context menu in Finder on your system). Near the bottom you should see a menu selection for “Services” and in a sub-menu you should find your “Unmount” service:

Click on that and your volume should be unmounted (if you have Hardware Growler installed from any version of Growl, including the free forked Lion version, then you should get a Growl notification of the unmount). I will note that this has no error checking other than that built into the command-line hdiutil program, so while it probably won’t hurt anything if you try to unmount something that’s not unmountable (such as a file), I’d still try to be careful.

If you have a problem with devices that refuse to unmount the then you could use the same procedure to create a “Force Unmount” service. I’d still create the regular “Unmount” service as shown above, but if you sometimes have the problem that the device won’t unmount the normal way then simply follow the above steps again except name the service “Force Unmount” and add the -force flag, like this:

hdiutil unmount -force $1

Or if eject normally works, but sometimes you want to force it, you could create a “Force Elect” service using:

hdiutil eject -force $1

I do not guarantee anything with regard to the use of the -force option (I read about it here), so if you go that route and lose data, don’t blame me.  As I said, you use this stuff at your own risk.

Happy unmounting!  And if this doesn’t work for you the way it worked for me, I’ll tell you up front that I have no clue why, and that’s partly because I don’t understand why a plain old eject attempt fails on some systems (as I say, eject actually does work, but then the device immediately remounts).  It’s all a mystery to me!

Links: OS X Notifier App Growl Goes Closed Source, but a free forked version (that works in Lion) is available

 

Important
This is an edited version of a post that originally appeared on a blog called The Michigan Telephone Blog, which was written by a friend before he decided to stop blogging. It is reposted with his permission. Comments dated before the year 2013 were originally posted to his blog.

Here’s a few links on this issue:

OS X Notifier App Growl Goes Closed Source (Slashdot)

Episode 47 – Fork You Growl! Interview with Perry Metzger (from The Basement Coders Developer Podcast — if you care at all about Growl you should listen to this, preferably before spending any money on their allegedly broken App).

[growl-discuss] Growl 1.2.x for Lion source for XCode 4.1 (including a fixed HardwareGrowler)

Patched version project page on bitbucket

Download page for forked version

Growl-1.2.2f1.dmg direct download link (if it doesn’t work check the link above — there may be a newer version).

EDIT: Link to Growl Source Installation information for Growl 1.3 — it appears that after the Slashdot article was published, the Growl developers decided to release the source to Growl 1.3 (making the headline of the Slashdot article and this article inaccurate in the process).  However, this does not mean that the problems with the new version have been fixed (as of the date of this article) — it probably only means that they didn’t like the bad publicity about not releasing the source and decided to address that issue, in an attempt to blunt some of the criticism.

I’m presenting the above links so that anyone interested can check them out (and so I can find them again in the future). I will just say that I generally agree with the sentiments expressed in the podcast. I think it’s really underhanded when a project that has been free for years (and has accepted contributions of both cash and code from folks that probably thought it would be free forever) tries to go commercial, and it’s even worse when the commercial app doesn’t work as well as the previous free version.  And I won’t even get into the issue of the censorship, because the Growl developers have the right to censor whomever they want in their forums, but in this case it sure sounds like they were trying to deprive their users of the knowledge that someone else had fixed their buggy code and made it freely available.  If they choose to do that, then it’s up to others (like you and I) to let Growl users know that an alternative exists.

I hope that either the forked version gains acceptance (and exposure, since few people seem to know about it at the moment) or the original Growl developers see the error of their ways sooner rather than later. What IS it with developers turning greedy lately?  Keep in mind that had Growl not existed (and worked so well in its previous free incarnation), it’s quite likely that the Apple folks would have developed their own notification system and made it a component of OS X.

EDIT:  Two things you should know about Growl 1.3 before you fork over your two bucks:  First, due to App Store requirements, it no longer installs as a preference pane in System Preferences – it’s now an application (the podcast explains this in more detail).  And second, “Growl 1.3 and later do not have update checkers built into them, so you will need to keep up with when releases are put out”, according to the Growl Source Installation page.

Full disclosure:  I also censor comments — see my comment policy in the right sidebar — but it’s generally because they are spam or include one or more links that I consider spam, or because someone is being rude and nasty.  You can call me all the names you like, but I’m not going to approve such garbage for others to read.  However, there are right reasons and wrong reasons to censor comments or to ban a user, and I’ll leave it to the reader to decide (after listening to the linked podcast, which I strongly recommend before you form any strong opinions on this) whether the Growl folks should have banned Mr. Metzger.

Link and comment: Slate Reprints Blue-Box Article That Inspired Jobs

 

Important
This is an edited version of a post that originally appeared on a blog called The Michigan Telephone Blog, which was written by a friend before he decided to stop blogging. It is reposted with his permission. Comments dated before the year 2013 were originally posted to his blog.
Blue Box at the Computer History Museum
Image via Wikipedia
From a post on Slashdot, posted by timothy on Monday October 10, @05:09AM:

Slate has reprinted the piece that Ron Rosenbaum wrote for Esquire in 1971, explaining to the world that there was an underground movement of people hacking the phone system. (Rosenbaum is now a columnist for Slate.) According to the article’s new introduction and followup piece by Rosenbaum reflecting on its impact — and to the New York Times obituary for Steve Jobs — this article inspired Jobs and Wozniak to start building blue boxes themselves, an effort that made them several thousand dollars.

It has been reported (though I can’t recall the source at the moment) that this is the article that caused AT&T to turn its employees into common thieves.  The idea that people might have access to this information frightened them so much that they literally sent their people out to steal the copies of this issue of Esquire from every public library in the country (of course they missed a few).  Although this was long before the days of the Internet and the “Streisand effect“, it did have the result that those who had access to the article had a tendency to photocopy it and pass it around, so AT&T’s ham-fisted attempt at censorship probably gave the article far more exposure than it ever would have had in the first place.

I would daresay that one article probably had a significant effect on our modern way of life.  For one thing, it taught us that “security through obscurity” doesn’t work, and for another it forced AT&T and other phone companies to modernize their phone networks (probably much earlier than they would have otherwise intended) to prevent the type of “toll fraud” made possible by the blue box, and that made it much easier for alternative long distance carriers to offer their services.

Although I never had the technical skills to build a blue box, I definitely wanted to know how they worked.  The copy of Esquire at my local library had already gone missing but I discovered they still had a copy at the Grand Rapids public library.  Apparently the librarians there had apparently been tipped off about AT&T’s attempts to make that issue disappear, so they were keeping it behind the desk and you had to request it from a librarian.  Which I did, and then promptly asked where the photocopy machine was.  The librarian looked me over and said, “You’re not going to copy that article, are you?” and I said, “Oh, yes I am!”  She clearly disapproved, but still pointed me in the direction of the copier (the alternative would have been to attempt to forcibly pry the magazine back out of my hands!).  That copy of the article went back home with me and got shared with a few interested friends, and at least two of them later got jobs in the telecommunications field.

Of course, nowadays it would be a simple task for any modern computer to generate the same multifrequency tomes that blue boxes generated, but the last telephone company in the country to actually use that signaling method dropped it on June 15, 2006.  And now we have computers and the Internet and VoIP, but I have a feeling that much of that might still not be in existence had it not been for that one article, which literally gave birth to an entire community of hackers, many of whom later went on to do great things and to build the networks we have today.  It’s funny how one thing that seems so small at the time — in this case, one magazine article — can create such ripples throughout society.

How to install the BIND DNS Server using Webmin, so Asterisk extensions (hopefully) will work even when your Internet connection fails

 

Important
This is an edited version of a post that originally appeared on a blog called The Michigan Telephone Blog, which was written by a friend before he decided to stop blogging. It is reposted with his permission. Comments dated before the year 2013 were originally posted to his blog.

If you run Asterisk you may have encountered this issue: Your Internet connection goes down, and so does your ability to call from extension to extension, even between extensions on your local network. This is a long-standing bug in Asterisk (exactly the sort of bug that drives people to try alternatives such as FreeSWITCH) but let’s say that for whatever reason you need to stick with Asterisk, so you’d like to find a way to make that bug go away.  Without going into all the technical details, the reason that calls fail is that Asterisk can’t access a DNS server.  I’ve read several reports that say the easiest solution is to install the BIND DNS server  on the same machine as your Asterisk server.  If you are also running Webmin on the server, installing and configuring BIND is a relative piece of cake.  So here’s how it’s done.  Please note that most of the images below can be enlarged by clicking on them, and that I have installed the StressFree theme in Webmin, so if it looks a little different from what you’re used to seeing, that’s probably why.

To start with, log into Webmin, click on “Servers”, then click on “BIND DNS Server” (if you don’t find it there, try looking in “Un-used Modules”):

Webmin Servers page — click on "BIND DNS Server"

Assuming you have not previously installed BIND, you’ll get a screen like this.  Just click where it says “Click here”:

Webmin BIND DNS Server error page — click where it says "Click here"

You will then see this screen come up as BIND is installed. Just let it run to completion and (assuming it installs successfully) click on “Return to BIND DNS Server” at the bottom of the page:

Webmin "Install Package" page — click on "Return to BIND DNS Server"

Next, because you don’t yet have an /etc/named.conf file, you’ll see this page.  Click the button for “Setup nameserver for internal non-internet use only” (don’t worry, we’ll fix it in the next steps), then click the bar that says “Create Primary Configuration File and Start Nameserver”:

Webmin — click "Setup nameserver for internal non-internet use only"

At this point BIND is installed and running, but it probably isn’t doing what you want it to, and your system isn’t using it. So the first thing we need to do is tell it where to go when it needs to do a DNS lookup. You should be seeing a page that looks like this — click on “Forwarding and Transfers”:

Webmin BIND DNS Server page — click on "Forwarding and Transfers"

When you get to the following screen, check “Yes” next to “Lookup directly if forwarders cannot?”  You also need to enter one or more addresses of DNS servers that BIND can access when it needs to pull a DNS record.  You might want to give some thought to which DNS servers you want to use, and in what order, before you start entering them. You can enter up to three IP addresses of DNS servers, and then click “Save”. This will throw you out to the previous screen, and if by some chance you want to enter even more DNS servers, you can click on “Forwarding and Transfers” again to come back and enter up to three more servers, until you are finished.  In this example, I have already entered the IP addresses of my router’s DNS Server as the top priority pick,  followed by two Google DNS Server addresses.

Webmin — BIND DNS Server — Forwarding and Transfers page

Once you have done this, you are through configuring BIND directly, but there are two more things we need to do. The first is to make sure that the BIND server starts each time we restart the machine. To do that, go to Webmin’s “System” page and then click on “Bootup and Shutdown”:

Webmin System page — click on "Bootup and Shutdown"

This is a long page so I’m not showing all of it — what you have to do is find the entry for named and check the box next to it:

Webmin Bootup and Shutdown page — check the box next to "named"

Then go to the bottom of the page and click “Start on Boot”:

Bottom of Webmin Bootup and Shutdown page — click "Start on Boot"

At this point BIND is running, and should be using the correct DNS servers, and is set to start at bootup, but your server still isn’t using it for its DNS queries. To get it to do that, go to Webmin’s “Networking” page and click on “Network Configuration”:

Webmin Networking page — click on "Network Configuration"

Once on the Network Configuration page, click on “Hostname and DNS Client”:

Webmin Network Configuration page — click on "Hostname and DNS Client"

Once on the Hostname and DNS Client page, what you need to do is make the first entry in the DNS Servers list 127.0.0.1. If you trust BIND to always be operating, that’s the only entry you need. I didn’t quite trust BIND that much (actually, what I didn’t trust was my ability to set this up correctly) so I set the DNS server in the router as the secondary DNS address. You could use any DNS server as the secondary, or you could choose to just enter the 127.0.0.1 address to use BIND and let it go at that. Personally, I feel a lot more comfortable having a “fallback” DNS. Don’t forget to click “Save” when you are finished making changes here:

Webmin Hostname and DNS Client page - 127.0.0.1 must be first DNS server

That’s all there is to it, as far as I know (if you think I’ve missed anything or done something wrong, the comment section is open!). If you’re like me, the next question you will have is, “How do I know it’s working?” And the easiest way to do that is to go to a Linux command prompt and “dig” some site you have not been to recently twice in a row. Here’s an example, using cnn.com — the part we are interested in is in red:

dig cnn.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_5.3 <<>> cnn.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8274
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 13, ADDITIONAL: 9

;; QUESTION SECTION:
;cnn.com.                       IN      A

;; ANSWER SECTION:
cnn.com.                287     IN      A       157.166.224.25
cnn.com.                287     IN      A       157.166.224.26
cnn.com.                287     IN      A       157.166.226.25
cnn.com.                287     IN      A       157.166.226.26
cnn.com.                287     IN      A       157.166.255.18
cnn.com.                287     IN      A       157.166.255.19

;; AUTHORITY SECTION:
.                       76691   IN      NS      i.root-servers.net.
.                       76691   IN      NS      j.root-servers.net.
.                       76691   IN      NS      k.root-servers.net.
.                       76691   IN      NS      l.root-servers.net.
.                       76691   IN      NS      m.root-servers.net.
.                       76691   IN      NS      a.root-servers.net.
.                       76691   IN      NS      b.root-servers.net.
.                       76691   IN      NS      c.root-servers.net.
.                       76691   IN      NS      d.root-servers.net.
.                       76691   IN      NS      e.root-servers.net.
.                       76691   IN      NS      f.root-servers.net.
.                       76691   IN      NS      g.root-servers.net.
.                       76691   IN      NS      h.root-servers.net.

;; ADDITIONAL SECTION:
b.root-servers.net.     386178  IN      A       192.228.79.201
d.root-servers.net.     402826  IN      A       128.8.10.90
d.root-servers.net.     230000  IN      AAAA    2001:500:2d::d
f.root-servers.net.     370827  IN      A       192.5.5.241
g.root-servers.net.     463754  IN      A       192.112.36.4
h.root-servers.net.     374116  IN      A       128.63.2.53
h.root-servers.net.     517382  IN      AAAA    2001:500:1::803f:235
j.root-servers.net.     185528  IN      A       192.58.128.30
j.root-servers.net.     578747  IN      AAAA    2001:503:c27::2:30

;; Query time: 26 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Sep 16 12:45:41 2011
;; MSG SIZE  rcvd: 512

# dig cnn.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_5.3 <<>> cnn.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8277
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 13, ADDITIONAL: 9

;; QUESTION SECTION:
;cnn.com.                       IN      A

;; ANSWER SECTION:
cnn.com.                223     IN      A       157.166.255.19
cnn.com.                223     IN      A       157.166.224.25
cnn.com.                223     IN      A       157.166.224.26
cnn.com.                223     IN      A       157.166.226.25
cnn.com.                223     IN      A       157.166.226.26
cnn.com.                223     IN      A       157.166.255.18

;; AUTHORITY SECTION:
.                       76627   IN      NS      c.root-servers.net.
.                       76627   IN      NS      d.root-servers.net.
.                       76627   IN      NS      e.root-servers.net.
.                       76627   IN      NS      f.root-servers.net.
.                       76627   IN      NS      g.root-servers.net.
.                       76627   IN      NS      h.root-servers.net.
.                       76627   IN      NS      i.root-servers.net.
.                       76627   IN      NS      j.root-servers.net.
.                       76627   IN      NS      k.root-servers.net.
.                       76627   IN      NS      l.root-servers.net.
.                       76627   IN      NS      m.root-servers.net.
.                       76627   IN      NS      a.root-servers.net.
.                       76627   IN      NS      b.root-servers.net.

;; ADDITIONAL SECTION:
b.root-servers.net.     386114  IN      A       192.228.79.201
d.root-servers.net.     402762  IN      A       128.8.10.90
d.root-servers.net.     229936  IN      AAAA    2001:500:2d::d
f.root-servers.net.     370763  IN      A       192.5.5.241
g.root-servers.net.     463690  IN      A       192.112.36.4
h.root-servers.net.     374052  IN      A       128.63.2.53
h.root-servers.net.     517318  IN      AAAA    2001:500:1::803f:235
j.root-servers.net.     185464  IN      A       192.58.128.30
j.root-servers.net.     578683  IN      AAAA    2001:503:c27::2:30

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Sep 16 12:46:45 2011
;; MSG SIZE  rcvd: 512

Notice how on the first run, it takes 26 msec to do the lookup, because BIND doesn’t have that address cached yet, whereas on the second run it only takes 1 msec to do the lookup!  Could that perhaps improve system performance?  I’ll bet it could! And the SERVER line tells us that it is indeed using our BIND server (127.0.0.1) – if it were using, say, our router’s DNS server then that line would show this:

;; SERVER: 192.168.0.1#53(192.168.0.1)

The idea here is that when your Internet connection takes a dive, Asterisk will still be finding a working DNS server and therefore won’t tank.  That, at least, is the theory I’ve seen on several web sites.  The ONLY thing I am showing here is how to set up BIND using Webmin, and I won’t even guarantee that I’m doing that 100% correctly.  I definitely do not guarantee that it will actually work as intended — you’ll have to test that yourself.  Doing a real test would mean disconnecting your cable or DSL modem, etc. from your router for several hours or days to see if the phones continue to work, and in most households or businesses that idea will go over like a lead balloon.  However, feel free to give it a good test if you like and report the results in the comments.

You may wonder why I selected “Setup nameserver for internal non-internet use only” in the fourth screenshot.  Obviously, that description is not entirely accurate.  The real difference is that if you select that instead of the default “Setup as an internet name server, and download root server information”, it won’t create a “root” DNS zone, which you simply don’t need for this application.  You can use the other option if you want to, but it will download additional information and increase the complexity of your setup.  Either way, you should be able to access the Internet, because we set up DNS forwarding.  If by some chance this BIND server is going to act as a nameserver for your entire network, and you don’t mind the additional traffic and complexity (and it’s the additional traffic that scares me the most, since I have no idea what it’s actually downloading nor how often it’s doing it), then by all means feel free to use the second option.  All I will say is that I used the first. and it works fine, and I’ve seen at least one instance where this same thing is set up using a method other than Webmin, and except for the order of statements it uses an /etc/named.conf file that is identical to what Webmin produces when configured as I have shown here (in other words, no “zones” at all).  I’m just waiting for some Linux purist to say this isn’t the “right” way to do this but keep the goal in mind here — all we are trying to do is work around a bug in Asterisk that should have been fixed years ago, not set up a DNS server to feed an entire subnet.  But again, you can feel free to use whichever of the options you like — it should work either way.

(By the way, if after reading the above you have “setup remorse” — you know, that feeling you get after you’ve installed something that you should have picked a different option — you can get a “do-over” by simply deleting or moving/renaming /etc/named.conf.  If you then exit Webmin’s BIND module and come back in, it should see that named.conf doesn’t exist and start you over at the fourth screen shown above.  Of course, you will lose anything you have already configured from within that module.  If you originally selected the option to download the root server information, I think that’s at least partly stored in the file /etc/db.cache, so you could move or remove that file to make sure it’s not used, however I’m not sure if any other files are or were also downloaded.  That particular file is very small so I’m not worried about that one per se, it’s just that the way things are worded on a couple of pages I read, I don’t know if that’s all it downloads, or if at some point in the middle of the night it rises up and tried to cache all the DNS information for the Internet, or just exactly what it does.  Sometimes I wish people would just give a sentence or two of additional information, so you have a better idea of what’s the right thing to do when you’re setting up something like this.)

Now, if you are a True Linux Geek who somehow stumbled across this article, and are disappointed that it isn’t much more complicated, I’ll refer you to this page.  If you can figure all THAT out, you should be getting paid the big bucks as the networking expert that you are! 🙂

A real help for Linux users with bad memories: Aliaser — take control of your aliases on Linux

 

Important
This is an edited version of a post that originally appeared on a blog called The Michigan Telephone Blog, which was written by a friend before he decided to stop blogging. It is reposted with his permission. Comments dated before the year 2013 were originally posted to his blog.
Tux, the Linux penguin
Image via Wikipedia

Here’s a program that may be useful for those of you who, like me, sometimes find ourselves at a Linux command prompt trying to recall the syntax of a command we use frequently (because, you know, it would never have occurred to the designers of Linux to actually implement commands with names that have a clear meaning in plain English):

Alias are a great tool to help increment your productivity on the terminal with bash (or any shell program you’re using), but usually we are too lazy to think at what are the most common, or long commands that we use frequently and prepare an alias for them.

And so someone has done a small piece of software to do this job: aliaser

Aliaser helps you identify frequently typed commands and creates bash aliases for them. Aliaser analyses your bash history and helps you identify commands that you use frequently.

Full article (with installation instructions) here.

One thing they forgot to mention is that once you’ve added an alias, it won’t actually be available for use until you log out and then log back in.  Also, you can delete the aliaser file and temporary directory from your /tmp directory once installation is complete.  If you ever want to uninstall aliaser, just remove the three lines added to your .bashrc file, remove the ~/.aliaser directory, and remove the /usr/bin/aliaser file.

One way I find this useful is to make commands I can’t remember into ones that that I can remember.  For example, I did this:

aliaser add processes “ps awx”

The Linux purists are probably rushing to comment that I just turned a six character command into a nine character one.  Yes, BUT, I can actually remember the word “processes”, whereas I cannot remember the options I need to use after “ps” to get the output I want. The designers of Linux seem to not realize that some of us users have really bad memories.  Another use for this is turning arcane Linux commands into the equivalent Windows commands that you’re familiar with.  You could do this:

aliaser add dir “ls -al”

So that when you type “dir”, you get a directory listing similar to what you are used to.

If you can’t even remember the aliases you’ve created (yeah, my memory really is that bad some days), just use aliaser show to see all the aliases you’ve added.

How to give a particular extension or group of extensions access to a specific trunk or group of trunks for outgoing calls in FreePBX

 

Important
This is an edited version of a post that originally appeared on a blog called The Michigan Telephone Blog, which was written by a friend before he decided to stop blogging. It is reposted with his permission. Comments dated before the year 2013 were originally posted to his blog.
Dial Patterns that will use this Route
Dial Patterns section of new FreePBX Outbound Route

I’m going to lift a bit of preliminary text from a page on the FreePBX site entitled “How to give a particular extension different or restricted trunk access for outgoing calls“:

IMPORTANT: When implementing any sort of restrictions on extensions, using the method described here or any other method, please be absolutely certain that you do not inadvertently restrict access to emergency services numbers (such as 911 in the U.S./Canada)!

There is a recurring question that comes up every so often, regarding how to give one particular extension (or a group of extensions) access to a different trunk for specific outgoing calls, or perhaps to restrict access to a particular trunk. Usually this involves an extension that is accessible to people that might want to make calls that cost money, and you don’t want them to do that. But there are many other reasons to route calls differently for different extensions, while still keeping all extensions on the same system so they can call each other.

Usually when someone asks about this, a common suggestion is to use the unsupported third-party Custom Contexts module. While this module is very versatile and lets you have a high degree of control over what each extension may access, there are at least two downsides. One is that it’s not part of the official distribution and therefore, a future upgrade of FreePBX might “break” it.

(This is probably less likely now, because it appears some of the FreePBX developers have taken an interest in maintaining it, but it’s still not beyond the realm of possibility.)

The other issue is that you have to go through and check (and maybe change) all the priority dropdowns if you add, remove, or move a route, and that can get to be a pain in the butt very quickly if you are in the habit modifying your routes with any frequency.

The problem with this page is that although it discusses several alternatives to using Custom Contexts (and you may wish to read it just to learn about those other possibilities), it is getting rather dated and therefore does not mention the use of the fourth field in Outbound Routes, a.k.a the “CallerID” field, which is by far the easiest way to implement this.

Let’s say you have an existing outbound route, over which your outbound calls normally travel, and it has a particular selection of trunks.  But you also have an extension, let’s say it’s extension 234, and you want it to use a different trunk or group of trunks.  In FreePBX 2.9 or later, all you have to do is this:

  • Go to the settings page for the Outbound Route that is currently used for outgoing calls.
  • At the bottom of the page, next to the “Submit Changes” button, there is a new “Duplicate Route” button.  Click on “Duplicate Route”.
  • Move the duplicated route to be higher in priority than the original route (it should appear just above the original route in the right-hand column).
  • Optionally rename the duplicated route to something more to your liking.
  • In the duplicated route, under “Dial Patterns that will use this Route“, add the extension number (or pattern matching a group of extensions) to the fourth (CallerID) field of EVERY dial pattern on the list.  Or, if using the Swiss Army Knife Module and you have checked the “Turn On Old (Pre 2.8) Dial Plan Textbox” checkbox (EDIT: or if you have FreePBX 12 or later, and under Settings | Advanced Settings, in the “GUI Behavior” section you have set Enable The Old Style FreePBX Dial Patterns Textarea to True), then add the extension number or pattern to the end of every existing pattern, separated by a forward slash.  As an example, an existing pattern of 1+NXXNXXXXXX would become 1+NXXNXXXXXX/234.  Again, you must do this to every pattern in the pattern list.
  • And finally, in the duplicated route, change the the “Trunk Sequence for Matched Routes” to include only those trunks that you want that extension or group of extensions to use.

If there are additional Outbound Routes for which you want to change the trunk selection for the same extension, repeat the above, starting with the other outbound route(s).  If you have additional extensions and you want one or more of them to have different trunk usage, repeat the above, using the different extension number(s) in the CallerID field and the different trunk selections.

If you want to block an extension’s ability to make toll calls, use the same procedure but only give them access to an ENUM trunk.  ENUM is pretty broken then days, it it would be rare for a call to actually complete, but if it does it’s not going to cost you anything.  This particular usage is discussed in more detail in “How to block a single extension’s ability to make outgoing toll calls in FreePBX“. (EDIT: In the most recent versions of FreePBX you can simply not select any trunks at all in the “Trunk Sequence for Matched Routes” section of the Outbound Route, and then optionally select a failure announcement or whatever treatment you want to give the call in the “Optional Destination on Congestion” section.)

And again, please note that you can use a single extension number OR a pattern in the CallerID field.  For example, if you had a pattern like 1NXXNXXXXXX, you could do something like:

  • 1NXXNXXXXXX/100 – match on the pattern only if the call is from extension 100
  • 1NXXNXXXXXX/2[45]X – match on the pattern only if the call is from an extension in the range 240-259
  • 1NXXNXXXXXX/3XX – match on the pattern only if the call is from an extension in the range 300-399

And if you wanted to allow the call only if it came from extension 100, 240-259, or an extension in the 300’s then you could use all three of the above rules in the same outbound route.

I will offer my opinion that using the Swiss Army Knife Module and checking “Turn On Old (Pre 2.8) Dial Plan Textbox” is the only way to go if you happen to have several hundred dial patterns!  Well, maybe not the only way (you could export a .CSV file, edit it, and import it back in), but definitely the easiest, because you can simply cut all the patterns from the textbox and paste them into a text editor, then use search-and-replace to add the extension numbers, then copy the changed patterns from the text editor and paste them back into the textbox in the Outbound Route.  If the search-and-replace function supports regex matching then it’s easy – set the find string to n and set the replace string to /234n (assuming 234 is the extension number you want to add), and replace all occurrences (be sure to check the first and last lines to make sure they look as they should, in case there was a missing or extra newline character somewhere).

EDIT: We have been informed that the old-style textboxes are once again available in FreePBX 12 and later. You have to click on the Settings tab, then Advanced Settings, then find the “GUI Behavior” section and change the Enable The Old Style FreePBX Dial Patterns Textarea setting to True.

Related Articles:

Recent Posts

Recent Comments

Archives

Categories

Meta

GiottoPress by Enrique Chavez