如何使用Cordova向SIP客户端发送电话号码

How to send a phone number to a SIP client with Cordova?

本文关键字:电话号码 客户端 SIP 何使用 Cordova      更新时间:2023-09-26

我正在使用Cordova开发一个手机应用程序(目前专注于android),我希望能够让用户通过他的SIP客户端进行呼叫。目前,我正在使用Sipdroid进行测试。

这将是Sipdoid的意向过滤器:http://pastie.org/pastes/8442254

我正在尝试使用WebIntent(https://github.com/Initsogar/cordova-webintent)传递一个数字并启动"Open with…"兼容SIP客户端的列表。一旦用户选择了一个客户端,该客户端就会拨打所传递的号码。

我已经尝试过在Javascript中使用以下代码:

//number is in the format of tel:555-555-5555
var call = function(number){
    window.plugins.webintent.startActivity({
    action: android.intent.action.CALL,
    sip: number},
    function() {},
    function() {alert("Error");}); 
};

我建议使用sipjs进行调用。看看我在这里的答案

问题是由于sip方案。"sip:"应该只包含一个类似5555555555的数字。