cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2029
Views
10
Helpful
6
Replies

<CiscoIPPhoneExecute> what command for dial ext line 2 on spa504g

hugokanner
Level 1
Level 1

Hello,

 

I'm trying to  dial on line 2 (ext2)  on a spa504g (4 lines)   with C#.  I have to account sip registred on the phone . How can select the  line 2 with my command xml ? 

 

<CiscoIPPhoneExecute><ExecuteItem Priority="0"  URL="Dial:1546" /></CiscoIPPhoneExecute>

 

Here is my code : 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 WebRequest request = WebRequest.Create("http://192.168.1.17/CGI/Execute");
        request.Method = "POST";
        string postData = @"XML=<CiscoIPPhoneExecute><ExecuteItem Priority=""0""  URL=""Dial:1546"" /></CiscoIPPhoneExecute>";
           byte[] byteArray = Encoding.UTF8.GetBytes(postData);
        request.ContentType = "text/xml; charset=\"UTF-8\"";
        request.ContentLength = byteArray.Length;
        Stream dataStream = request.GetRequestStream();
        dataStream.Write(byteArray, 0, byteArray.Length);
        dataStream.Close();
        WebResponse response = request.GetResponse();
        Label1.Text = ((HttpWebResponse)response).StatusDescription.ToString();
        dataStream = response.GetResponseStream();
        StreamReader reader = new StreamReader(dataStream);
        string responseFromServer = reader.ReadToEnd();
        Label1.Text += responseFromServer;
        reader.Close();
        dataStream.Close();
        response.Close();

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

thanks

 

6 Replies 6

Aaron Harrison
VIP Alumni
VIP Alumni

Hi

You would first send a 'Line2' message to pick up line two, and then send the dial command.

XML=<CiscoIPPhoneExecute><ExecuteItem URL="Key:Line2"/></CiscoIPPhoneExecute>

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

Hi, Aaron

How to send "Dial" and "Key" in a single post-query

Thanks.

Just put in multiple 'ExecuteItem' elements.

I would submit them separately though to ensure the order of the actions.

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

Here is a sample of my query:


Host: 192.168.1.246

Accept: /

Content-Type: text/xml; charset="UTF-8"

XML=<CiscoIPPhoneExecute>
<ExecuteItem URL="Key:Line2"/>
<ExecuteItem Priority="0" URL="Dial:124"/>
</CiscoIPPhoneExecute>

<Enter>

 

when sending a POST query, is performed only one. 

Is it possible for a query to execute in sequence 2 URL ?

Maybe you need some form?

 

Thanks.

Why not submit multiple requests? This will give you more control over sequencing.

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

Re posted to to XML Phone Applications.