Problem with CGI/Execute method of Sending message to a CISCO IP Phone

Version 1
    This document was generated from CDN thread

    Created by: Suman Banerjee on 16-12-2010 02:18:56 PM
    Hi,
    I had successfully done POC of sending message to a CISCO IP Phone via CGI/Execute method according to the method described in the following URL
    http://blog.crowe.co.nz/archive/2008/10/28/Sending-a-CISCO-IP-Phone-a-simple-command-using-C.aspx
    But while implementing the same in actual scenario we are getting the follwing error as response instead of <CiscoIPPhoneResponse>,as response XML.:
    <CiscoIPPhoneError Number="1" />

    The difference I found is when I typed the URL http://172.20.195.231/CGI/Execute (172.20.195.231 being the IP of the respective IP phone) in browser during POC I used to get <CiscoIPPhoneError Number="6" /> as response whereas in the actual scenario I'm getting "Webpage cannot be displayed".
    I believe some this is due to some service level configuration/firmware issue.
    I am a ASP.NET developer with very limited knowledge of CISCO IP phone services.
    We had invested lot of time and effort during the POC and I shall be grateful if you please let me know what could be the possible cause of this issue. 

    Subject: RE: Problem with CGI/Execute method of Sending message to a CISCO IP Phone
    Replied by: David Staudt on 16-12-2010 03:13:43 PM
    Navigating to /CGI/Execute with a web browser will use HTTP GET.  To use the execute functionality the request must use HTTP POST:
     
    ----------
    POST /CGI/Execute HTTP/1.0
    Authorization: Basic dGVzdFVzZXI6cGFzc3dvcmQ=
    User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9. zlib/1.2.3.4 libidn/1.18
    Host: 10.88.131.139
    Accept: */*
    Content-Length: 177
    Content-Type: application/x-www-form-urlencoded
     
    XML=XML%3D%3CCiscoIPPhoneExecute%3E%3CExecuteItem%20URL%3D%22http%3A%2F%2F10%2E88%2E131%2E137%2Ftest%2Exml%3Fthis%3D1%26amp%3Bthat%3D2%22%2F%3E%3C%2FCiscoIPPhoneExecute%3E%0A%0A
    --------------
     
    I use the 'curl' utility on linux to casually test execute requests:
     
    curl -u testUser:password -0 --data-urlencode XML@ipps.xml http://10.88.131.139/CGI/Execute
     
    where ipps.xml contains something like:
     
    XML=<CiscoIPPhoneExecute><ExecuteItem URL="http://10.88.131.137/test.xml?this=1&amp;that=2"/></CiscoIPPhoneExecute>

    Subject: RE: Problem with CGI/Execute method of Sending message to a CISCO IP Phone
    Replied by: Suman Banerjee on 17-12-2010 06:20:01 AM
    Thanks David.But I believe the issue I'm having is not related to the XML format because the same was working,it's more related to the CiscoIPPhoneExecute object.I think the root of the problem is the CGI/Execute URL is not giving any response in the browser.

    Subject: Re: New Message from Suman Banerjee in Administration XML (AXL) - Administr
    Replied by: Sascha Monteiro on 17-12-2010 08:13:47 AM
    I would listen to David, he is a very knowledgeable person!

    Anyway, as David said, the URL element is not part of the CiscoIPPhoneText object, but is part of the SoftKeyItem,
    so you do have the element misplaced. If it worked before, it might have been a bug...

    On 17/12/2010, at 5:20 PM, Cisco Developer Community Forums wrote:

    > Suman Banerjee has created a new message in the forum "Administration XML Questions":
    > --------------------------------------------------------------
    > Thanks David.But I believe the issue I'm having is not related to the XML format because the same was working,it's more related to the CiscoIPPhoneExecute object.I think the root of the problem is the CGI/Execute URL is not giving any response in the browser.
    > --
    > To respond to this post, please click the following link:
    > <http://developer.cisco.com/web/axl/forums/-/message_boards/message/2835570>
    > or simply reply to this email.

    Subject: RE: Problem with CGI/Execute method of Sending message to a CISCO IP Phone
    Replied by: Suman Banerjee on 17-12-2010 04:35:45 AM
    Thanks David for the reply.My program does the same thing as 'curl' utility does.We initially had tested with 'curl' before doing it via C# program ([url=http://blog.crowe.co.nz/archive/2008/10/28/Sending-a-CISCO-IP-Phone-a-simple-command-using-C.aspx).It]http://blog.crowe.co.nz/archive/2008/10/28/Sending-a-CISCO-IP-Phone-a-simple-command-using-C.aspx).It pushes the following XML to the CGI/Execute URL.
    <CiscoIPPhoneText>
      <URL>Init:Services</URL>
      <Title>HMS REGISTRATION</Title>
      <Prompt>TATA HMS</Prompt>
      <Text>My Text</Text> 
      <SoftKeyItem>
        <Name>Cancel</Name>
        <Position>4</Position>
      </SoftKeyItem>
    </CiscoIPPhoneText> 
    (Please go through my post very carefully.I am getting <CiscoIPPhoneError Number="1" />.Please refer screen shot)
    I somehow believe that CGI/Execute is not running/supported on the IP phone.After spending huge effort to get it done initially it's very frustrating when the same thing does'nt work on another IP phone in the actual scenario.Please help me out !!

    Subject: RE: Problem with CGI/Execute method of Sending message to a CISCO IP Phone
    Replied by: David Staudt on 17-12-2010 05:23:02 AM
    If your XML looks like this:
     

    <CiscoIPPhoneText xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/home/david/Documents/IP%20Phone%20Services/CiscoIPPhone.xsd">
      <URL>Init:Services</URL>
      <Title>HMS REGISTRATION</Title>
      <Prompt>TATA HMS</Prompt>
      <Text>My Text</Text>
      <SoftKeyItem>
        <Name>Cancel</Name>
        <Position>4</Position>
      </SoftKeyItem>
    </CiscoIPPhoneText>

     
    then some elements are out of place.  The following XML is valid:
     

    <CiscoIPPhoneText xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/home/david/Documents/IP%20Phone%20Services/CiscoIPPhone.xsd">
      <Title>HMS REGISTRATION</Title>
      <Prompt>TATA HMS</Prompt>
      <SoftKeyItem>
        <Name>Cancel</Name>
        <Position>4</Position>
        <URL>Init:Services</URL>
      </SoftKeyItem>
      <Text>My Text</Text>
    </CiscoIPPhoneText>



    It's very useful to be able to use an XML validation tool to verify with.  I use XML Copy Editor (http://xml-copy-editor.sourceforge.net/), whiches makes it very easy to validate against the XML services XSD (found here: http://developer.cisco.com/web/ipps/docs)
     


     

    Subject: RE: Re: New Message from Suman Banerjee in Administration XML (AXL) - Admin
    Replied by: David Staudt on 17-12-2010 02:48:25 PM
    It is possible to disable the phone's onboard web server - needed for /CGI/Execute to work - you can check in the UCM admin phone config pages in the Product Specific area.
     
    To fully troubleshoot, the best tool is a network packet capture, taken from the phone's extra PC switch port, e.g.:
     
    - Load Wireshark onto a PC
    - Connect the PC to the phone's extra PC switch port
    - Ensure the PC Port and Span to PC Port options are enabled
    - Start Wireshark and run the test
    - Filter the capture for 'http' and insepct the messages
     
    You can attach the resulting capture file here if you can't identify the issue.

    Subject: RE: Problem with CGI/Execute method of Sending message to a CISCO IP Phone
    Replied by: vladlozmtz (simulated) on 15-04-2011 02:10:14 PM
    I'm getting the same error when using multiple parameters in the querystring CiscoIPPhoneExecute. When I put only one parameter in the query string works fine, but the error apears when using more than one paramter.

    Subject: RE: Problem with CGI/Execute method of Sending message to a CISCO IP Phone
    Replied by: Florian Kroessbacher on 18-04-2011 03:15:02 PM
    I'm getting the same error when using multiple parameters in the querystring CiscoIPPhoneExecute. When I put only one parameter in the query string works fine, but the error apears when using more than one paramter.

     
    Maybe this help's
     
    use
     
    param1=value1&amp;param2=value2&amp;param3=value3
     
    instead of
     

    param1=value1&param2=value&param3=value3
     
    cheers

    Subject: RE: Problem with CGI/Execute method of Sending message to a CISCO IP Phone
    Replied by: Florian Kroessbacher on 18-04-2011 03:20:49 PM
    I'm getting the same error when using multiple parameters in the querystring CiscoIPPhoneExecute. When I put only one parameter in the query string works fine, but the error apears when using more than one paramter.


    Maybe this help's

    use

    param1=value1&amp;param2=value2&amp;param3=value3

    instead of


    param1=value1&param2=value&param3=value3

    cheers