我写一个Java应用程序拨打一个号码,并通过DTMF得到用户的PIN。 我使用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();