Asterisk, and other worldly endeavours.

A blog by Leif Madsen

Posts Tagged ‘Asterisk

Docker container results in x509: failed to load system roots and no roots provided

We have a small system running in AWS as a CentOS 7 image. It has a few containers that we’re using to host a few Golang API proxies. We migrated a customers API proxy that was running on the local VM into a container, and spun it up. Upon testing, we ran into the following error:

x509: failed to load system roots and no roots provided

We get that failure when trying to connect to an HTTPS endpoint (remote API that we’re proxying to Asterisk).

Figured it had to do with the fact we were using a scratch disk to build the container image, and that there were no certs loaded. Did some Googling and found some people with similar problems, but their solutions didn’t work for us on our CentOS 7 host system.

Then I thought maybe there was some issue with following a symlink as the source since we were loading in the ca-bundle.crt file as a volume. I didn’t test enough to determine if that was the issue (it probably wasn’t), but this post gave me a hint:

https://github.com/docker/docker/issues/5157#issuecomment-69325677

So we did the following:

docker run -d -p 8085:8085 -v /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem:/etc/ssl/certs/ca-certificates.crt [etc...]

After linking that file and mounting it in the container, all was well. I suspect it’s the path to the ca-certificates.crt that was the real trick.

Advertisements

Written by Leif Madsen

2015/10/30 at 3:30 pm

Posted in Asterisk, DevOps, Docker

Tagged with , , , , ,

Asterisk: The Definitive Guide 4th Edition goes to print

Howdy folks,

Sorry for the lack of updates lately. I’ve recently (December 2012) started at Thinking Phone Networks as the Lead UC Systems Engineer, and we’ve been incredibly busy there. In addition, the authors and I had been working on the final touches to the 4th edition of Asterisk: The Definitive Guide, which documents Asterisk 11 LTS.

Late last week, the book went to print, and should start to appear on store shelves and start shipping from Amazon and other locations within the next 6-8 weeks I believe. However, if you’ve purchased the digital version, it’s already available!

I got mine from O’Reilly, and sync’d it to my Dropbox and shared it with my co-workers. There are usually deals around on Amazon and the O’Reilly website that will let you purchase both the digital and printed versions. The digital should be available immediately, with the printed version shipping as soon as it’s available.

Thanks to everyone who helped make the 4th edition a success, and to get it done in the last 8 months! It’s been quite the journey since the 1st edition was released in 2005.

Written by Leif Madsen

2013/05/16 at 8:31 am

Digium D40 and D70 Phone Unboxing

Today I received a couple of phones from Digium; the D40 and D70. I’ll be using these phones for testing and documentation in the 4th edition of Asterisk: The Definitive Guide (which Jim Van Meggelen, Russell Bryant and myself are working on right now).

Here is my unboxing of the phones and some commentary about my initial impressions of the hardware itself.

Pretty boxes!

Phones arrived in some nice looking boxes.

Digium D40

Comes with a little pamphlet to help you get the phones setup on your network.

Comes with all the little things you need to get the phone up and running, including a network cable. I was just using POE to power the phone, so I didn’t end up with the 5VDC power adapter.

Nice looking base. Easy to put onto the phone. Just uses friction to hold the phones on the base. Not sure how well that’ll work over time, but this isn’t something that should be getting attached and detached a lot. The space for cables in the base is also quite large.

Holes to mount to wall. Requires adapter.

Easy access!

Lots of space for my hand to plug in cables. Much nicer than any of the Polycom bases where I usually give up and just remove it.

Boot screen

Booting up with the Digium logo.

Handset hook access

The tab on the back here is well designed so that you don’t require a tool to pull out and flip around. I prefer to have the hook for the handset so it doesn’t fall off the base easily. On the Polycoms (which have the same type of setup) it’s nearly impossible to remove with your fingers

D40 vs IP335 size comparison

.Size comparison between the D40 and IP335.

Digium D70

Open box

Hidden compartment

Back of the D70


I don’t quite get the base with the wall mount holes, but impossible mounting angles on the base. Must have something to do with the manufacturing process and not having separate molds for footing.

Update: Michael pointed out that the A-frame is actually two separate pieces, so with a (separately purchased) piece, you can attach it to the base and make the system wall mountable. With the number of phones I’ve actually wall mounted in deployments (I think the number is only one or two), I think I prefer the 2 options for steep and shallow angles. Neat idea.

Side cut outs for cables that I didn’t even notice the first time through. Michael pointed out they are for cable management. Nice!

Oh my! So much space! Very roomy 🙂
Side by side comparison of the D70 vs the IP650 w/ sidecar.
Front to back comparison of the D70 vs IP650 w/ sidecar.

Written by Leif Madsen

2012/10/11 at 3:43 pm

Posted in Asterisk, Musings

Tagged with , , , , ,

Converting multiple exten => lines to using same => in Asterisk dialplan

Last week I wanted to start changing some 1.4 based Asterisk dialplan to a 1.8 based Asterisk system, and in that process wanted to convert lines like:

exten => _NXXNXXXXXX,1,NoOp()
exten => _NXXNXXXXXX,2,GotoIf($[...]?reject,1)
exten => _NXXNXXXXXX,3,Dial(SIP/foo/${EXTEN})
...

into using the same => prefix:

exten => _NXXNXXXXXX,1,NoOp()
 same => n,GotoIf($[...]?reject,1)
 same => n,Dial(SIP/foo/${EXTEN})

In order to do that, Mike King helped me out with the following regular expressing which I used in vim:

%s/exten\s*=>\s*[^,]\+,\s*[n2-9]/ same => n/g

Written by Leif Madsen

2012/01/16 at 8:28 am

Now working with CoreDial

As of January 3rd, I’m now working with the CoreDial team full time. I’ve worked with them as a consultant on their infrastructure over the last few years but now will be spending significantly more time working with the engineering team 🙂

From the announcement,

CoreDial is pleased to announce the addition of Leif Madsen to the CoreDial team,” said Alan Rihm, CEO at CoreDial. “Leif is a well known Asterisk consultant who specializes in distributed telephony deployments and database integration. In addition, Leif is co-author of several O’Reilly published books on Asterisk, including Asterisk: The Definitive Guide (3rd edition). We’re pleased to be adding Leif to our team, and look forward to the exciting opportunity to work together.

The entire announcement can be found at http://coredial.com/asterisk-consultant-leif-madsen-joins-coredial-team/

I’m really excited to be working with these guys, and to see what we’ll develop over the coming months! I’ll keep you informed here on my blog, and will continue to post Asterisk tidbits and snippets as I go.

Written by Leif Madsen

2012/01/04 at 3:22 pm

Cooking With Asterisk (Video)

And I found the Cooking With Asterisk presentation as well! Apologies for the low quality on the video (as this one has a lot more text than the Distributed Call Centre video), but you can follow along with the presentation on your screen as available on my website at:

http://leifmadsen.com/sites/default/files/AstriCon%202011%20-%20Cooking%20With%20Asterisk.pdf

The video presentation is available here:

http://www.tmcnet.com/tmc/videos/default.aspx?vid=5741&title=Cooking+with+Asterisk#

Written by Leif Madsen

2011/12/23 at 11:17 am

Asterisk Powered Distributed Call Centres (Video)

Looks like TMC has posted my presentation from AstriCon 2011! You can see the presentation in its entirety over here:

http://www.tmcnet.com/tmc/videos/default.aspx?vid=5821&title=Asterisk-Powered+Distributed+Call+Centers

And the presentation along with the demo configuration files is available on my website at:

http://leifmadsen.com/sites/default/files/AstriCon%202011%20-%20Building%20a%20distributed%20call%20centre.zip