03-19-2015 11:10 AM - edited 03-21-2019 08:35 AM
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
03-20-2015 03:48 AM
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
05-08-2015 06:41 AM
Hi, Aaron
How to send "Dial" and "Key" in a single post-query
Thanks.
05-12-2015 03:29 AM
Just put in multiple 'ExecuteItem' elements.
I would submit them separately though to ensure the order of the actions.
Aaron
05-13-2015 04:47 AM
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.
05-14-2015 01:17 AM
Why not submit multiple requests? This will give you more control over sequencing.
Aaron
05-29-2015 07:10 PM
Re posted to to XML Phone Applications.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide