Author Topic: Pushing XML to phone  (Read 2410 times)

Offline cunningdavid

  • New Member
  • *
  • Posts: 2
  • Country: nz
  • Karma: +1/-0
    • View Profile
Pushing XML to phone
« on: August 09, 2020, 11:20:26 PM »
Hello,

I've a Mitel 6930 IP phone with a SIP load, and am trying to push XML to it to set icons on the display. The Mitel XML development guide has lots of details on the different types of request that can be made, but is short on examples of how to actually make the request.

What I've tried is:
curl -X POST -d '<AastraIPPhoneStatus><Session/><Message index="0" type="icon" icon="1"/><IconList><Icon index="1">Icon:DND</Icon></IconList></AastraIPPhoneStatus>' http://192.168.1.115 --header "Content-Type:text/xml"

However what I get back is the front page of the phone's web interface. The last 3 lines are:
<div id='content'>
<p><p style='{color:red}'>No changes made<br><br>Settings could not be saved.</p></p>
</div></div><div id='footer'><span class='copyright'>Copyright &copy; 2018 Mitel Networks Corporation</span><span class='support'><a href='http://www.mitel.com/content/technical-support-ticket-request-form'>Customer Support</a></span></div></div></body></html>

Does anyone have any advice? Perhaps I need to send the request to a certain path on the phone's web server?

Thanks in advance.


Offline cunningdavid

  • New Member
  • *
  • Posts: 2
  • Country: nz
  • Karma: +1/-0
    • View Profile
Re: Pushing XML to phone
« Reply #1 on: August 18, 2020, 06:15:36 AM »
Answering my own question, it seems I just needed to use "xml=" on the start of the message sent to the phone.

Code: [Select]
#!/usr/bin/perl -w
use LWP::UserAgent;
use LWP::ConnCache;
use HTTP::Request::Common;

my $ua = LWP::UserAgent->new(agent => 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)');
$ua->conn_cache(LWP::ConnCache->new());

# Set icons on
$ua->request( POST 'http://192.168.1.15', Content_Type => 'text/xml', Content => 'xml=<AastraIPPhoneStatus><Session/><Message index="0" type="icon" icon="1"/><Message index="1" type="icon" icon="2"/><IconList><Icon index="1">Icon:DND</Icon><Icon index="2">Icon:CallFwd</Icon></IconList></AastraIPPhoneStatus>' );

Offline sarond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1404
  • Country: au
  • Karma: +73/-0
    • View Profile
Re: Pushing XML to phone
« Reply #2 on: August 18, 2020, 07:18:05 AM »
Thanks for sharing your solution.


 

Sitemap 1 2 3 4 5 6 7 8 9 10