01-12-2018, 11:37 PM
Hello,
I am working on Yealink T23G and was trying to send sip account information from my computer to the phone using API with C program.
I followed the documentation on from the link: http://support.yealink.com/documentFront...umentId=33
Does anyone know how can I post XML to the phone using the API?
I do not want to use software/server for the HTTP server or XMLRPC. I want to POST the XML using the C program only.
Also, I was able to login to the phone using `CURL` referring the following link:
http://forum.yealink.com/forum/archive/i...-4066.html
Following command worked fine:
I got the response of "200 ok" and cookies got saved. (was testing on the terminal using terminal command before writing the C program)
I tried the following command to send the XML, but it did not work:
I have also tried using the postman software to find the issue but did not find the solution.
Is there a specific URL for the XML API or should I just use the IP address of the phone? Am I using the wrong API above? Is it possible to share the URL list for the XML API?
Thanks.
I am working on Yealink T23G and was trying to send sip account information from my computer to the phone using API with C program.
I followed the documentation on from the link: http://support.yealink.com/documentFront...umentId=33
Does anyone know how can I post XML to the phone using the API?
I do not want to use software/server for the HTTP server or XMLRPC. I want to POST the XML using the C program only.
Also, I was able to login to the phone using `CURL` referring the following link:
http://forum.yealink.com/forum/archive/i...-4066.html
Following command worked fine:
Code:
curl -D "abcd.txt" "192.168.0.225/servlet?p=login&q=login&username=admin&pwd=admin&jumpto=URI&&key=AutoP"
I got the response of "200 ok" and cookies got saved. (was testing on the terminal using terminal command before writing the C program)
I tried the following command to send the XML, but it did not work:
Code:
[quote]url -D "abcd.txt" -X "POST" -d "xml=<?xml version="1.0" encoding="ISO-8859-1"?><YealinkIPPhoneConfiguration Beep="yes"><Item>account.1.enable=1</Item><Item>account.1.label=1400</Item><Item>account.1.display_name
=1400</Item><Item>account.1.user_name=1400</Item><Item>account.1.auth_name=1400</Item><Item>account.1.sip_server.1.address=10.2.1.199</Item></YealinkIPPhoneConfiguration>" "192.168.0.225/servlet?p=account-register&q=load&acc=0"[/quote]
I have also tried using the postman software to find the issue but did not find the solution.
Is there a specific URL for the XML API or should I just use the IP address of the phone? Am I using the wrong API above? Is it possible to share the URL list for the XML API?
Thanks.