Category Archives: FreePBX

Asterisk web management GUI

Posting Asterisk/FreePBX calls to Toggl

Toggl is a hosted time tracking system, used to keep track of time spent of different projects.

If you use Asterisk/FreePBX and spend time on the phone to clients that should be assigned to a project you can automatically create time entries in Toggl using their API. To do this we can make a curl call from Asterisk when a call ends.

To be able to do this you’ll need to ensure you have curl compiled in to Asterisk. You can check this with “core show function CURL”.

I tested this on Asterisk 11 and FreePBX v2.11, but it should work the same on other versions.

First we need to add a little dial plan code to Asterisk to tell it to run our script when a call ends. We going to do this by adding the following lines to – /etc/asterisk/extensions_custom.conf

[macro-dialout-trunk-predial-hook]    ; check to ensure this context doesn't already exist before adding
exten => s,1,Set(CHANNEL(hangup_handler_push)=hangup-handler,s,1)

[hangup-handler]
exten => s,1,Noop( capsule crm intergration ${CALLERID(all)})
exten => s,n,Set(foo=${CURL(http://127.0.0.1/toggl.php?strSrc="${CDR(src)}"&strDst=${CDR(dst)}&strDuration="${CDR(duration)}")})
exten => s,n,Noop(${foo})
exten => s,n,Return()

Continue reading

Posting Asterisk/FreePBX CDRs as a task in Capsule CRM

I was recently talking to someone that was looking at running Capsule CRM.

In Capsule you can create a “Task” which is something that has happened or will happen. These “Tasks” can then be assigned to a customer or contact.

Capsule has an API that allows automating posting of these tasks and we can use CURL in Asterisk to post the call details.This guide was written using Asterisk 11. If this doesn’t work for you ensure you have curl compiled in to Asterisk with “core show function CURL”.

First we need to tell Asterisk to run a command when a call ends. We are going to do it at the end so that we can get the length of the call. FreePBX allows for this using a hangup-handler.

We are going to add the following lines to – /etc/asterisk/extensions_custom.conf

[macro-dialout-trunk-predial-hook]    ; check to ensure this context doesn't already exist before adding
exten => s,1,Set(CHANNEL(hangup_handler_push)=hangup-handler,s,1)

[hangup-handler]
exten => s,1,Noop( capsule crm intergration ${CALLERID(all)})
exten => s,n,Set(foo=${CURL(http://127.0.0.1/capsule.php?strCallid="${CALLERID(num)}"&strDuration="${CDR(duration)}")})
exten => s,n,Noop(${foo})
exten => s,n,Return()

Continue reading

Important FreePBX security update in ARI

Yesterday Schmooze announced a security update for FreePBX. This is an important vulnerability as it allows remote code execution (RCE).

For more information about the alert see here – http://www.freepbx.org/node/92822

By default SysAdminMan VPSs include additional security that means they are not vulnerable to this exploit. Additionally all SysAdminMan VPSs have been scanned to ensure the ARI interface is not publicly accessible.

It is still recommended that SysAdminMan customers update their systems with security updates released, including this one.

FOP2 with FreePBX overview

FOP2 makes a great addition to FreePBX, especially if you use your phone system in a sales environment. FOP2 is a web based panel for managing live calls on your PBX.

I’m going to write a few posts going over some of the features, and this post is designed to give you an overview of what FOP2 is and how it works.

My test phone system has 3 extensions linked to a SysAdminMan hosted FreePBX system –

3 x FreePBX extensions

Continue reading

FreePBX 12 upgrade broken on CentOS 5 (and possibly other Distros)

FreePBX 12 is currently in beta testing but there is an option on FreePBX v2.11 called “FreePBX Upgrader” to allow upgrading to FreePBX 12. It is not overly obvious that this currently upgrades you to a beta version.

If you are running on CentOS 5 it is recommended that you do not run this update as it will break your FreePBX install.

This is caused by the way that the module update routine checks for available updates (using wget -q).

There is no intention to fix this issue so FreePBX 12 will not run on CentOS 5 (without some manual intervention). More details about this can be found here – http://issues.freepbx.org/browse/FREEPBX-7994

Free UK DDI and FreePBX

A little while ago I wrote some instructions for setting up a DDI with UKDDI. At the time this involved forwarding the call to a SIP URI and setting up a couple of trunks.

The nice folks at UKDDI have made this process much easier. Now we can register our FreePBX server with them, and they will send the calls to our registered IP address. The process of registration tells the remote provider who we are and what our IP address is, so that they can send calls to us.

Setting up our number in UKDDI

First we need to tell UKDDI that we will be registering with them and how to send the call to us.

Edit the number you want to use and set ‘Route’ to be ‘register’. You can also choose the codecs allowed. I suggest leaving this on G711 as it’s the best call quality, and G729 may not be available on your system

UKDDI route

UKDDI route

Continue reading

OpenVPN to Asterisk using a Microtik router

Microtik RB750GL

Microtik RB750GL

For a while now SysAdminMan has been offering FreePBX/A2Billing hosting with OpenVPN server already installed on the server. What I really want to find is the perfect client/router that’s simple to configure and easy to deploy. We’ve been recommending OpenWRT for a while now but it can be a pain to flash the firmware and get OpenVPN configured.

I’ve also used Microtik routers for a while and they are very powerful routers in such a small, reasonably priced, package. This test was done using a Microtik RB750GL

I wasn’t sure how it would work though as Microtik routers only support OpenVPN over TCP, not UDP. This means all the VOIP traffic will be running over a TCP connection which, in theory, is not ideal.

This performance testing was done using –

  • Virgin Media Broadband with 60mb down and 3mb up. The upload limit on your broadband connection will nearly always be the limiting factor for call quantity/quality
  • Asterisk is running on a SysAdminMan VPS and is placing the incoming calls to music-on-hold
  • sipp was used  at the remote site to generate test calls
  • Linksys SPA941 was used at the remote site to test call quality
  • G711/aLaw was used for all calls
  • No other traffic was happening on the broadband connection

We start off with 10 concurrent calls, then 20 and finally 40.

10 CONCURRENT CALLS

Here you see we have sipp generating 9 G711 calls with audio

sipp 9 calls

sipp 9 calls

Continue reading

FreePBX 2.11 Guide: Inbound calls

Because our VOIP phone system is on the internet there is no geographical restrictions. That means we can purchase a telephone number in any country, and forward the calls to our FreePBX system. Many countries allow anyone to purchase a number in that country, some, such as France, place restrictions that you have to prove you are a resident in that country.

We are going to set up a phone number on our system from UKDDI, currently you can get free UK geographic numbers here.

These telephone numbers are referred to as “DDI numbers” or “DID numbers” depending on which country you are from!

Not working?

There’s no denying that setting up an inbound number can be frustrating sometimes. If you’re a SysAdminMan customer and have set up an inbound number that’s not working then just open a support ticket and we’ll have a look why.

If you’re not a SysAdminMan customer then there’s a couple of troubleshooting guides here –

Sending the call to our FreePBX system

There are 2 different ways this could happen and will depend on which call provider you are using. The 2 different methods are –

  • Our trunk “registered” with the call provider. This tells the call provider what IP to send the calls to
  • We enter a SIP URI in the call providers control panel telling it where to send the calls.

If you enter a SIP URI in your call providers control panel I suggest keeping the number the same as the DDI number you purchased. For example if you purchased the number 441604123123 and your FreePBX server IP address is 91.92.93.94 I would suggest setting to SIP URI to send the call to as SIP:[email protected]

Setting up our number in UKDDI

Here’s our number set up in UKDDI. We are entering a SIP URI and forwarding the call to our FreePBX server IP. Notice I am keeping the number in the SIP URI the same as my DDI number, that’s important later on

UKDDI telephone number

UKDDI telephone number

Continue reading

FreePBX 2.11 Guide: Blacklist a caller

If you get annoying telemarketing calls then it’s really simple to block the caller ID with FreePBX. First you need to ensure the caller ID module is installed, see here for more info – http://sysadminman.net/blog/2014/freepbx-2-11-guide-updating-and-installing-modules-5922

Blocking a caller via the Web GUI

First we need to go to the Blacklist menu option

Blacklist caller

Blacklist caller

Continue reading