on 01-24-2014 12:14 PM
Hello,
I'm new to the AXL dev environment. Essentially, I have a request from a user to try to automate a query/data pull for the current call forward information for a specific line. I am familiar with both running a job, and CLI Query to pull the information. What I'm not sure of is if there's a way to create some automation to pull the Call forward info and then dump to an excel file or alternative for an end user's retrieval/use. I was thinking there may be an API/SDK tool or something to automate this. Maybe I can set up a repeatable scheduled job, and then use Filezilla (ftp client) to log in automatically and download the job results file? Any idea or help would be greatly appreciated. We are currently running CUCM 9.1(2).
Thanks in advance for any assistance you may be able to provide.
Arras
You can use an AXL SOAP call to do this. Just execute a getLine for the directory number in question. For example, if I want to get the default forward all settings for directory number 3000:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/10.5">
<soapenv:Header/>
<soapenv:Body>
<ns:getLine sequence="?">
<pattern>3000</pattern>
<returnedTags uuid="?">
<callForwardAll>
<forwardToVoiceMail></forwardToVoiceMail>
<callingSearchSpaceName uuid="?"></callingSearchSpaceName>
<secondaryCallingSearchSpaceName uuid="?"></secondaryCallingSearchSpaceName>
<destination></destination>
</callForwardAll>
</returnedTags>
</ns:getLine>
</soapenv:Body>
</soapenv:Envelope>
This request will return something like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:getLineResponse xmlns:ns="http://www.cisco.com/AXL/API/10.5">
<return>
<line uuid="{2D655EE6-D16E-C4F7-D0B5-B1E2846CC8D5}">
<callForwardAll>
<forwardToVoiceMail>false</forwardToVoiceMail>
<callingSearchSpaceName xsi:nil="true" uuid="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<secondaryCallingSearchSpaceName xsi:nil="true" uuid="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<destination>3001</destination>
</callForwardAll>
<enterpriseAltNum/>
<e164AltNum/>
</line>
</return>
</ns:getLineResponse>
</soapenv:Body>
</soapenv:Envelope>
You can do this in a variety of languages. For example, you can create a command-line PHP program. Check out the AXL/PHP Primer here: https://developer.cisco.com/site/axl/learn/how-to/axl-php-primer.gsp
Or just explore the AXL documentation available starting at this link for other languages and methods: Cisco AXL
Nicholas,
Thanks for the reply! I have found that I still don't know what I'm doing with this. I wanted to use command-line PHP as you suggested, but I am quickly finding that even difficult. In following the axl-php-primer link you provided, I am attempting to instantiate the Soap client as instructed, but obviously am not doing that correctly. My steps were as follows:
Unfortunately, regardless of how I ran it, I received the same error of:
PHP Fatal error: Class 'SoapClient' not found in C:\Tools\PHP\SoapClient.php on line 6
My internet search has not turned up anything, so any help would be greatly appreciated. Seeing as how I can't get past the first step, I can't progress to getting the little info I'm after.
I have code to set Callforwarding if you are intrested.
Jan Meeling
Hi, sorry I didn't notice your reply until now. If you want the world's easiest method of setting up PHP (and other support tools like Apache), I strongly recommend XAMPP. It takes care of all the details for you, so you don't have to worry about downloading and installing different modules.
I would definitely be appreciative of the code; which I'm sure I can adopt for my needs. If you want to send it as an attachment, you can send it to avmartin25+cfwdscript@gmail.com
Thanks in advance for your assistance!
Arras
Nicholas,
Thanks, I will look at XAMPP, per your suggestion.
Do you still have that code? I'm looking to do the same for 10.5(2)
Hi jan,
i'm interessted in your code too.
thanks for your help.
Do you still have that code?
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: