Call forward with SNOM and FusionPBX

Snom (and other VoIP Phones) have the possibility to define which code should be used to enable and disable call forward and FusionPBX by default uses *72 to enable call forward, *73 to disable call forward.

The only problem is that you can’t pass the destination for the call forward, it either enables call forward if a destination exists or asks for the destination which doesn’t play nice with the way SNOM expects it to work. So let’s change this.

Change the Dialplan in FusionPBX

Go to Dialplan -> Dialplan manager and look for *72, it should look something like this

Add some regex magic and make the destination accept additional digits after which we also set the captured value in a new variable, let’s call it “manual_destination”

condition destination_number ^\*72(\d{2,16})$ 
action set manual_destination=$1

After which it should look like this:

Edit Lua script

Now let’s edit the call_forward.lua, here are the changes I made

< manual_destination = session:getVariable(“manual_destination”);
— -
< if (manual_destination) then
< freeswitch.consoleLog(“notice”,”** LCX: ManualDestination is enabled: “..manual_destination..”\n”);
< forward_all_destination = manual_destination;
< else
< freeswitch.consoleLog(“notice”,”** LCX: NOT SET ManualDestination\n”);
< end
— -
< end
— -
> end

First we get the variable and later in the script if the variable was set, we override the value of forward_all_destination.

Provisioning the phone

Now to the phone, you need to set the fwd_all_on_code to *72 and fwd_all_off_code to *73.

You also need to set a function key to redirect, I used the first function key for that:

<fkey idx=”0" context=”active” label=”” perm=””>redirect</fkey>

Now when you press the defined function key, you can enter a destination where to redirect to, after which SNOM dials *72 with your destination, fusionPBX enables the call forward and SNOM shows it on the display and the LED for call forward is also working.