Cisco SPA Template Mods & Notes

Hi,

I had to do some rejigging of the Cisco SPA templates to get the disable and blf function working the way I wanted it to.

Here are my edits to line 185 to 94 of the SPA504g template, I've highlighted the changes:

{foreach $keys["line"] as $row}
{if $row.device_key_category == "line"}
<!-- Phone/Line_Key_{$row.device_key_id} -->

<Extension_{$row.device_key_id}_ group="Phone/Line_Key_{$row.device_key_id}">{if {$row.device_key_type} == "disabled" or {$row.device_key_type} == "blf"}Disabled{else}{$row.device_key_line}{/if}</Extension_{$row.device_key_id}_>
<!-- This line detects if either "disabled" or "blf" is in the key type field and sets disabled in the extension field of the phone -->


<Short_Name_{$row.device_key_id}_ group="Phone/Line_Key_{$row.device_key_id}">{$row.device_key_label}</Short_Name_{$row.device_key_id}_>

<Share_Call_Appearance_{$row.device_key_id}_ group="Phone/Line_Key_{$row.device_key_id}">{if $row.device_key_type == "shared"}shared{else}private{/if}</Share_Call_Appearance_{$row.device_key_id}_>

<Extended_Function_{$row.device_key_id}_ group="Phone/Line_Key_{$row.device_key_id}">{if {$row.device_key_type} == "blf"}fnc=blf+sd+cp;sub={$row.device_key_value}@{$domain_name};ext={$row.device_key_value}@{$domain_name}{else}{$row.device_key_value}{/if}</Extended_Function_{$row.device_key_id}_>
<!-- This line detects if blf was entered as they key type and populates the extended functions field on the phone with the right values for a BLF based the value entered in the line value field of the device. Note its uses the $doamin_name vairable -->

{/if}
{/foreach}

The line key has to be disabled for extended functions like blf to work. I also like to be able to disable line keys that are not in use, these functions didn't seem to be working, thus the hacks

Bellow is an image of a phone device (SPA504) setup with two extensions, keys 1 and 2 are assigned to the extensions, key 3 is disabled, and key 4 is a BLF monitoring extension 101

fusion_cisco_blf.jpg

This is the resulting phone tab on the phone:

fusion_cisco_phone.jpg

This has been tested on the SPA504G
 
Last edited:
OK Not sure why i keep working on the Cisco/Linksys SPA templates when the phones are EOL. I guess its because these where my go to phones for a long time.

Anyway, there's a bit of code in the Cisco templates that should be in the Linksys templates if you want the provisioning button to work and you're using http auth for provisioning.

In the Linksys template you need to insert this at line 135

{if isset ($http_auth_username)}
<Profile_Rule group="Provisioning/Configuration_Profile">[--uid {$http_auth_username} --pwd {$http_auth_password}]http://{$domain_name}{$project_path}/app/provision/?mac=$MA</Profile_Rule>
{else}
<Profile_Rule group="Provisioning/Configuration_Profile">http://{$domain_name}{$project_path}/app/provision/?mac=$MA</Profile_Rule>
{/if}
 
Hello. I was trying to modify your suggestions to get the line key to "disable" on my Spa 525g2 but I screwed up all the code on the provisioning editor for the spa 525 g2. You wouldn't by chance fix that section the way it should be starting at line 702-710 for me and post it here would you? I would be in your debt. I broke it beyond use
 
Here is the original lines 702-711 of spa525g2 template:

{foreach $keys["line"] as $row}
{if $row.device_key_category == "line"}

<Extension_{$row.device_key_id}_ group="Phone/Line_Key_{$row.device_key_id}">{$row.device_key_line}</Extension_{$row.device_key_id}_> <!-- options: 1/2/3/4/5/6/7/8/9/10/11/12/Disabled -->
<Short_Name_{$row.device_key_id}_ group="Phone/Line_Key_{$row.device_key_id}">{$row.device_key_label}</Short_Name_{$row.device_key_id}_>
<Share_Call_Appearance_{$row.device_key_id}_ group="Phone/Line_Key_{$row.device_key_id}">{if $row.device_key_type == "shared"}shared{else}private{/if}</Share_Call_Appearance_{$row.device_key_id}_> <!-- options: private/shared -->
<Extended_Function_{$row.device_key_id}_ group="Phone/Line_Key_{$row.device_key_id}">{$row.device_key_value}</Extended_Function_{$row.device_key_id}_>

{/if}
{/foreach}
 
Before modifiying the files its helpful to make a backup. The files are located here: /var/www/fusionpbx/resources/templates/provision/cisco/

I'll try to get some time to work out how to modify the 525.
 
Ok so I dug a SPA525 out of junk drawer and surprise.. It was junk, I couldn't get it to work so I couldn't test it fully but here are my instructions.

## backup your existing provisioning files. This is over kill but everything will be backed up:

cd /var/backups
tar -czvf provisioningbackup.tar.gz /var/www/fusionpbx/resources/templates/provision

This should give you gzip of the provisioning template directory.

Now in the Fusion GUI go to Advanced => Provision Editor
In the provision editor select cisco => spa525g2 => {$mac}.xml

Replace line 705 with the following:
XML:
<Extension_{$row.device_key_id}_ group="Phone/Line_Key_{$row.device_key_id}">{if {$row.device_key_type} == "disabled" or {$row.device_key_type} == "blf"}Disabled{else}{$row.device_key_line}{/if}</Extension_{$row.device_key_id}_>
Then replace line 708 with the following:
XML:
<Extension_{$row.device_key_id}_ group="Phone/Line_Key_{$row.device_key_id}">{if {$row.device_key_type} == "disabled" or {$row.device_key_type} == "blf"}Disabled{else}{$row.device_key_line}{/if}</Extension_{$row.device_key_id}_>
Now save the file clicking on the disk icon.

I did not test on a phone but I did create a device with the modified template and downloaded the XML provisioning file that was generated. It has the following output which should do what you want on the phone (I created a blf on line 4):


<Extension_4_ group="Phone/Line_Key_4">Disabled</Extension_4_>
<Short_Name_4_ group="Phone/Line_Key_4">104</Short_Name_4_>
<Share_Call_Appearance_4_ group="Phone/Line_Key_4">private</Share_Call_Appearance_4_>
<!-- options: private/shared -->
<Extended_Function_4_ group="Phone/Line_Key_4">fnc=blf+sd+cp;sub=104@10.1.5.205;ext=104@10.1.5.205</Extended_Function_4_>

If it gets screwed up again just re-insert the original lines.
 
Oops
This should be line 708:

XML:
<Extended_Function_{$row.device_key_id}_ group="Phone/Line_Key_{$row.device_key_id}">{if {$row.device_key_type} == "blf"}fnc=blf+sd+cp;sub={$row.device_key_value}@{$domain_name};ext={$row.device_key_value}@{$domain_name}{else}{$row.device_key_value}{/if}</Extended_Function_{$row.device_key_id}_>
 
I also found that call pickup wasn't working on our SPA525G2's, but OK on our SPA504's.
That is, when you press a BLF line key on an extension which is ringing, it should pick up the call.

I had to change the following line in the 525G2 provisioning to fix it:

Line 1439 from this:
<Attendant_Console_Call_Pickup_Code group="Att_Console/General">*98</Attendant_Console_Call_Pickup_Code>

To this:
<Attendant_Console_Call_Pickup_Code group="Att_Console/General">**#</Attendant_Console_Call_Pickup_Code>

The time zone settings were also incorrect on the SPA525G2 template.

Line 681 from this:
<Time_Zone group="Regional/Time">GMT-04:00</Time_Zone>

To this:
<Time_Zone group="Regional/Time">{$spa_time_zone}</Time_Zone>
 
Last edited: