【问题标题】:Read dtmf using asterisk-java使用星号-java 读取 dtmf
【发布时间】:2014-06-21 18:50:21
【问题描述】:

我正在编写一个 java 应用程序来拨打一个号码并通过 DTMF 获取用户的密码。我正在使用asterisk-java 连接到星号 VOIP 服务器并拨打号码,但我不知道如何流式传输文件并将用户的输入读取为 DTMF。这是我的代码:

OriginateAction originateAction = new OriginateAction();
originateAction.setChannel("SIP/1001");
originateAction.setContext("default");
originateAction.setCallerId("Server");
originateAction.setPriority(1);

// connect to Asterisk and log in
managerConnection.login();
// send the originate action and wait for a maximum of 30 seconds for Asterisk
// to send a reply
ManagerResponse originateResponse = managerConnection.sendAction(originateAction, 30000);

// print out whether the originate succeeded or not
System.out.println(originateResponse.getResponse());

// and finally log off and disconnect
managerConnection.logoff();

【问题讨论】:

    标签: java asterisk dtmf


    【解决方案1】:

    您正在使用 AMI。

    如果没有拨号方案支持,就无法在 AMI 中获取 dtmf。您可以在拨号计划中使用类似这样的东西通过 ami 获取事件

    exten => s,1,Read(variable,filetoplay)
    exten => s,2,UserEvent(variable: variable)
    

    或者你可以使用fastagi来控制调用执行并收集dtmf

    【讨论】:

      猜你喜欢
      • 2013-04-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多