[cisco-voip] Using speed dials to access features

Anthony Holloway avholloway+cisco-voip at gmail.com
Thu Oct 8 16:29:03 EDT 2015


I just happen to have PHP code to do this in AXL.  I make no promises.

*Requirements:*

1. You need a web server to run your PHP code on
2. You need to create a Phone Service pointing to your web server
3. You need to subscribe the phone to the service
4. You need to add an SURL line to the phone

*Limitations*:

1. You cannot have more than on SURL to the same phone service on the
phone.  However, you can create two phone services which point at the same
URL to overcome this.
2. You unforward the phone with the normal unforwarding procedure (E.g.,
Forward Off softkey on 9971)

*PHP Source Code:*

<?php

// Set the content of the response to plain text
header('Content-type: text/plain');

// This is an internal URI to close the confirmation window
header("Refresh: 1; url=Key:Soft1");

// If no device name was given via HTTP GET, abort
if (!array_key_exists('device', $_GET)) {
die();
}

// Capture the given device name
$target_device = $_GET['device'];

// If no destination was given via HTTP GET, abort
if (!array_key_exists('destination', $_GET)) {
die();
}

//Capture the new forwarding destination
$target_destination = $_GET['destination'];

// Setup the connection to the publisher
$client = new SoapClient(
'projects\cisco\axl\schema\10.5\AXLAPI.wsdl',
array(
'trace'=>true,
'exceptions'=>true,
'location'=>"https://cucmpub.company.com:8443/axl/",
'login'=>'admin',
'password'=>'Cisco123',
)
);

// Try to pull the phone lines (DN and Index) via AXL
try {
$response = $client->getPhone(
array(
'name' => $target_device,
'returnedTags' => array(
'lines' => array(
'line' => array(
'index' => true,
'dirn' => array(
'pattern' => true
)
)
)
)
)
);
} catch (Exception $fault) {
// Could not pull the phone lines, display error on phone and quit
die('Could not find this phone.');
}

// line is an array of lines despite the name being singular
if (isset($response->return->phone->lines->line)) {
// $lines is now an array of objects...or is it?
$lines = $response->return->phone->lines->line;
} else {
// There were no lines found on this phone, quit
die('No lines found.');
}

// If there was only a single line on the phone, then $lines
// is not an array, and so we make it one so that processing
// a phone with a single line is the same as one with multiple
if (!is_array($lines)) {
$lines = array($lines);
}

// Iterate over each line on the phone
foreach ($lines as $line) {
// But target only the line with an Index of 1 (primary line)
if ($line->index == '1') {
// Store a reference to the DN UUID for the primary line
$dirn = $line->dirn;
// Try to make an AXL call to query the details of the line
try {
$response = $client->getLine(
array(
'uuid' => $dirn->uuid,
'returnedTags' => array(
'pattern' => true,
'callForwardAll' => array(
'forwardToVoiceMail' => true,
'destination' => true,
'callingSearchSpaceName' => true,
'secondaryCallingSearchSpaceName' => true
)
)
)
);
} catch (Exception $fault) {
// Something went wrong getting the details of the primary line
die('Could not get line details.');
}
// $dirn was the uuid but now it's an object with line properties
$dirn = $response->return->line;
// Try to update the line on the phone with the new target destination
try {
$response = $client->updateLine(
array(
'uuid' => $dirn->uuid,
'callForwardAll' => array(
'forwardToVoiceMail' => 'false',
'destination' => $target_destination,
'callingSearchSpaceName' => $dirn->callForwardAll->callingSearchSpaceName,
'secondaryCallingSearchSpaceName' =>
$dirn->callForwardAll->secondaryCallingSearchSpaceName
)
)
);
// Display the outcome of the AXL call to the phone screen
echo "Successfully Forwarded to " . $target_destination;
} catch (Exception $fault) {
// Something went wrong with changing the line
die('Could not update the line.');
}
}
}

?>

*CallManager Phone Service*

[image: Inline image 1]

*Subscribed to a Phone (with destination defined - would be different for
different people)*

[image: Inline image 2]

*Added as an SURL on the line:*

[image: Inline image 3]

*Phone Screen*

[image: Inline image 4]


On Thu, Oct 8, 2015 at 2:36 PM, Ryan Ratliff (rratliff) <rratliff at cisco.com>
wrote:

> You can achieve almost the same thing by configuring SNR on the line and
> using a Mobility button to enable/disable SNR.  This won’t be a forward
> strictly because the IP Phone will continue to ring, but it will toggle
> whether the call is extended to the mobile.
>
> Otherwise you could use a phone service that uses AXL to turn CFA on or
> off on the line.
>
> -Ryan
>
> On Oct 8, 2015, at 3:00 PM, Ryan Huff <ryanhuff at outlook.com> wrote:
>
> I should further add my suggestion would mean removing the line on the
> phone and creating it as a hunt pilot and then putting a pseudo number on
> the phone in place of the line, as the line group member.
>
> Sent from my iPad
>
> On Oct 8, 2015, at 2:54 PM, Ryan Huff <ryanhuff at outlook.com> wrote:
>
> Off the top .... (and this is by no means elegant);
>
> 1.) Create a hunt group with the pilot's CFWNA action to forward to the
> cell phone (using a Pstn egress patter).
> 2.) Make the line a member of the line group serviced by the hunt
> list/hunt group.
> 3.) Use an Hlog button on the phone to toggle whether the line is active
> in the line group or not.
>
> You may need to play around with the diversion header settings and answer
> timers a bit ... etc, but in theory this should work.
>
> Sent from my iPad
>
> On Oct 8, 2015, at 2:38 PM, norm.nicholson at kitchener.ca wrote:
>
>
>
>
>
> I have a request to program a button to forward a line on a 7965/7916 to a
> cell phone automatically by pressing one button.  Do features like CFwdALL
> have a dialable number associated with them ?
>
>
>
>
>
>
>
> Thanks
>
>
>
>
>
>
>
>
>
>
>
> *Norm Nicholson*
>
> *Telecom Analyst*
>
> *City of Kitchener*
>
> *(519) 741-2200 x 7000 <%28519%29%20741-2200%20x%207000>*
>
>
>
>
>
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>
> <Mail Attachment.txt><Mail Attachment.txt>
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>
>
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20151008/898e90b1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 15214 bytes
Desc: not available
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20151008/898e90b1/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 169929 bytes
Desc: not available
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20151008/898e90b1/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 7246 bytes
Desc: not available
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20151008/898e90b1/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 9917 bytes
Desc: not available
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20151008/898e90b1/attachment-0003.png>


More information about the cisco-voip mailing list