大家好,我是星号的新手,所以不太了解。我目前正纠结于一个进行出站呼叫的应用程序。以前由于某些配置问题,它无法正常工作,然后 ANI 显示 NULL 值。但现在它工作正常,因为我使用了 java 的 setCallerID 函数。
问题是成功地为用户生成了一个出站呼叫,例如 123,但前导零“0”附加到它并变为“0123”,我假设“0”是附加星号的国家号码根据星号中的定义,我需要的数字是'123',我想从java代码中改变它。
我搜索了很多论坛/站点,包括voip-info的领先站点,但还没有成功。如果可能的话,我想通过java代码解决它。任何帮助将不胜感激。
更新:
笔记:
星号版本是 1.8 ,链 ss7 是 2.1
extensions.conf
[gu]
exten =>007775,1,Answer(); this will answer the call
exten =>007775,2,Wait(1); will wait for 1 second
exten =>007775,3,NoOp(Call from ${CALLERID(all)})
exten =>007775,4,AGI(agi://localhost:4573/com.digitania.ivr.gu.domain.ServiceImplDelegate?uniqueId=${UNIQUEID}&isOutbound=${isOutbound}&msisdn=${MSISDN})
exten =>007775,5,Hangup(); end the call
我的java代码
private static final String PARAM_MSISDN = "MSISDN";
private static final String PARAM_ISOUTBOUND = "isOutbound";
private static final String EXTENSION = "007775";
private static final String CALLER_ID = "7775";
public static int callCount = 0;
public void call(String msisdn, CallListener listener) {
try {
{
OriginateAction originateAction = new OriginateAction();
originateAction.setChannel((new StringBuilder("SS7/").append(msisdn).toString()));
originateAction.setContext("gu");
originateAction.setPriority(new Integer(1));
originateAction.setExten(EXTENSION);
originateAction.setCallerId(CALLER_ID);
originateAction.setVariable(PARAM_MSISDN, msisdn);
originateAction.setVariable(PARAM_ISOUTBOUND, "true");
ManagerResponse originateResponse = managerConnection
.sendAction(originateAction, 30000L);
System.out.println((new StringBuilder("RESPONSE: \n")).append(
originateResponse.getResponse()).toString());
System.out.println(originateResponse.getMessage());
}
} catch (TimeoutException e) {
listener.callTimeOutException();
} catch (Exception e) {
e.printStackTrace();
}
callCount++;
}