Cisco SPA Template Mods & Notes

Status
Not open for further replies.

bcmike

Active Member
Jun 7, 2018
337
58
28
54
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:
  • Like
Reactions: Griffinm84

bcmike

Active Member
Jun 7, 2018
337
58
28
54
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}
 

Andrew Byrd

Member
Feb 16, 2018
309
10
18
54
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
 

bcmike

Active Member
Jun 7, 2018
337
58
28
54
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}
 

bcmike

Active Member
Jun 7, 2018
337
58
28
54
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.
 

Andrew Byrd

Member
Feb 16, 2018
309
10
18
54
I would be most appreciative and if you would like me to pay you for your time just send me a paypal email

Thjanks!
 

bcmike

Active Member
Jun 7, 2018
337
58
28
54
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.
 

bcmike

Active Member
Jun 7, 2018
337
58
28
54
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}_>
 

thedoble

New Member
Aug 22, 2019
5
1
3
36
@bcmike thank you for this! We are migrating to FusionPBX and we have a bunch of SPA504/525's using BLF.

I couldn't understand why setting the line to 'disabled' didnt do anything!

Very much appreciate you sharing this
 
  • Like
Reactions: bcmike

thedoble

New Member
Aug 22, 2019
5
1
3
36
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:

bcmike

Active Member
Jun 7, 2018
337
58
28
54
Good catches! I'm in the middle of migrating away from Cisco SPA (Sadly) to Yealink, but I still support a good number in the field.

Let me know if you find anything else!
 
  • Like
Reactions: thedoble

thedoble

New Member
Aug 22, 2019
5
1
3
36
Thanks :)

Here's one more - the side panels (SPA500) didnt work for me, so I had to add the below around line 713. It will let you use 'BLF' or 'Line' settings. Line works as a speed dial.

Then you can configure profiles to deploy the settings to multiple devices. Works great!

Code:
{foreach $keys["expansion-1"] as $row}
<Unit_1_Key_{$row.device_key_id} group="Attendant_Console/Unit_1">
    {if {$row.device_key_type} == "blf"}
    fnc=blf+sd+cp;sub={$row.device_key_value}@{$domain_name};ext={$row.device_key_value}@{$domain_name}
    {/if}
    {if {$row.device_key_type} == "line"}
    fnc=sd;ext={$row.device_key_value}
    {/if}
    </Unit_1_Key_{$row.device_key_id}>
{/foreach}
 

bcmike

Active Member
Jun 7, 2018
337
58
28
54
Great thanks. At some point we should update the templates and submit them as a pull request to the Fusion PBX people.
 

Andrew Byrd

Member
Feb 16, 2018
309
10
18
54
I have found that call parking does not work correctly on the SPA 525G2 template. It works great on the 504 and the 508. But I can't figure out why it does not work on the SPA525G2. I use the same string on the 525 that I did on the 508 with different results. On the 508 it works perfectly. On the 525G2 it returns a message that says "invalid number" "Anonymous call" when attempted. This is the string I used on both.

fnc=blf+sd+cp;sub=park+*5901@$PROXY (Works perfectly on the 504 and 508)

I also tried this based on other articles I have read on Freeswitch with no success

fnc=blf+sd+cp;sub=park+*5901@my.domain.com

Any suggestions to modify the template would be appreciated.
 

Attachments

  • 5383752556216320.png
    5383752556216320.png
    26 KB · Views: 11

bcmike

Active Member
Jun 7, 2018
337
58
28
54
Make sure that the call park supplementary service is enabled:

<Call_Park_Serv group="Phone/Supplementary_Services">Yes</Call_Park_Serv>

Also check the other related fields:

<Call_Park_Monitor_Enable_1_ group="Ext_1/Call_Feature_Settings">No</Call_Park_Monitor_Enable_1_>

<Call_Park_Code group="Regional/Vertical_Service_Activation_Codes">*38</Call_Park_Code>

<Call_Pickup_Code group="Regional/Vertical_Service_Activation_Codes">*36</Call_Pickup_Code>

<Call_UnPark_Code group="Regional/Vertical_Service_Activation_Codes">*39</Call_UnPark_Code>

Honestly not sure what the settings should be for your situation, but that's where I'd look to comapre to the 508 template.
 

bcmike

Active Member
Jun 7, 2018
337
58
28
54
Andrew did you ever get this figure out? I'm running into it myself.
 

Andrew Byrd

Member
Feb 16, 2018
309
10
18
54
I never did. This has been a project that has been on going. For some reason, I can get the 504 and the 508 to provision perfectly but I still have not mastered the 525
 

bcmike

Active Member
Jun 7, 2018
337
58
28
54
Ok, this took me the better part of a day to track down so here's the solution:

<Enable_IP_Dialing_1_ group="Ext_1/Dial_Plan">Yes</Enable_IP_Dialing_1_>

It's set to "No" in the default SPA525 templates and "Yes" in the SPA50x templates. Basically the phone won't let you dial the "park+" part of the dial string without this enabled. It has to be done for every line # as well.
 
Status
Not open for further replies.