简体   繁体   English

尝试使用Javascript XMLHttpRequest的Cisco IP电话

[英]Cisco IP Phone Trying To Use Javascript XMLHttpRequest

I am trying to write a web broswer where I can get my Cisco 7942 phone to dial. 我正在尝试编写网络浏览器,以便可以拨打我的Cisco 7942电话。 I am using firefox to not deal with the same origin/domain issues. 我正在使用firefox来处理相同的来源/域问题。 I am not using a webserver, just the browser page accessing the phone directly. 我使用的不是网络服务器,而是浏览器页面直接访问手机。

I keep getting a NS_ERROR_FAILURE: Failure 我不断收到NS_ERROR_FAILURE:失败

I am able to access(just access...not send any XML objects) the phone if I manually type the URL http://172.25.11.59/CGI/Execute in my browser page...so I don't know. 如果我在浏览器页面中手动键入URL http://172.25.11.59/CGI/Execute ,则可以访问(仅访问...不发送任何XML对象)电话,所以我不知道。

document.domain = "company.com";

    var xml = new XMLHttpRequest();

            xml.open("post", "http://172.25.11.59/CGI/Execute", false);
            xml.setRequestHeader("Authorization", "Basic MTgyMjg6MTgyMjg=");
            xml.setRequestHeader('Content-Type', 'text/xml');

            xml.send('<CiscoIPPhoneExecute><ExecuteItem URL="Dial:2102263232" /></CiscoIPPhoneExecute>');

        console.log(xml.status);
        console.log(xml.responseText);
        console.log("it ran")

我发现仍然是思科电话拒绝了我。

Your xml.send is missing 'XML=' 您的xml.send缺少“ XML =”

'XML=<CiscoIPPhoneExecute><ExecuteItem URL="Dial:2102263232" /></CiscoIPPhoneExecute>'

and are you sure that your authorization server returns 'AUTHORIZED'? 并且确定您的授权服务器返回“ AUTHORIZED”?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM