[英]Asterisk - click2call Java works but takes 2 steps
I've implemented a Java method (using Asterisk-Java library) that initiates a call between two users. 我已经实现了Java方法(使用Asterisk-Java库),该方法可以在两个用户之间发起调用。 Alice is the caller and bob the receiver.
爱丽丝是呼叫者,鲍勃是接收者。 It works but I don't know why, it's doing it in 2 steps :
它可以工作,但我不知道为什么,它分两个步骤进行:
Any idea why Alice receives a call from herself first? 知道为什么爱丽丝首先会接到自己的电话吗?
Here's my code : 这是我的代码:
public void call(final String user, final String exten) throws IOException, AuthenticationFailedException, TimeoutException {
OriginateAction originateAction;
ManagerResponse originateResponse;
originateAction = new OriginateAction();
originateAction.setChannel("SIP/" + user);
originateAction.setContext("work");
originateAction.setExten(exten);
originateAction.setPriority(new Integer(1));
originateAction.setTimeout(new Long(30000));
// 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
originateResponse = managerConnection.sendAction(originateAction, 30000);
// and finally log off and disconnect
managerConnection.logoff();
}
originateAction.setChannel("SIP/" + user);
This action launched first. 该行动首先启动。
If you need other order, you shoudl do it other order. 如果需要其他命令,则应另做一个命令。
You can do dial via Local/ channel. 您可以通过本地/频道拨号。
This question was answered by me in last month 4 or 5 times. 这个问题在上个月被我回答了4到5次。
For more info see other similar questions. 有关更多信息,请参见其他类似问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.