这些东西网上随便一找一大堆,也只是记录下自己找的。方便以后自己复制粘贴用。
最后为啦实现分机状态在web的实时更新,我选择啦使用websocket。
//获得分机状态
public static String getExtensionState(int status){
String statename="";
switch(status){
case -1: statename="扩展找不到";break;
case 0: statename="空闲";break;
case 1: statename="在使用";break;
case 2: statename="忙";break;
case 4: statename="不可用";break;
case 8: statename="振铃";break;
case 16: statename="正等待";break;
}
return statename;
}
//获得挂机原因
public static String getHangup(int status){
String statename="";
switch(status){
case 1: statename="未分配";break;
case 2: statename="无到达路由";break;
case 3: statename="无路由目的地";break;
case 6: statename="无效通道";break;
case 7: statename="正在通话中";break;
case 16: statename="正常挂机";break;
case 17: statename="用户忙";break;
case 18: statename="无应答";break;
case 19: statename="无人接听";break;
case 21: statename="拒绝接听";break;
case 22: statename="号码已更改";break;
case 27: statename="目的次序不对";break;
case 28: statename="无效的数字格式";break;
case 29: statename="设备拒绝";break;
case 30: statename="查询响应";break;
case 31: statename="正常未指定";break;
case 34: statename="正常的呼叫拥塞";break;
case 38: statename="网络状态差";break;
case 41: statename="正常的临时故障";break;
case 42: statename="交换机拥塞";break;
case 43: statename="信息过时";break;
case 44: statename="请求通道无效";break;
case 45: statename="被抢占";break;
case 50: statename="无呼叫保持或呼叫等待";break;
case 52: statename="禁止呼出";break;
case 54: statename="禁止呼入";break;
case 57: statename="负载过重导致失效";break;
case 58: statename="负载过多导致不可达";break;
case 65: statename="负载过多导致为实现";break;
case 66: statename="通道未实现";break;
case 69: statename="设备未实现";break;
case 81: statename="无效的呼叫证明";break;
case 88: statename="不相容的目的地";break;
case 95: statename="无效的不明信息";break;
case 96: statename="IE浏览器关闭";break;
case 97: statename="不识别的信息类型";break;
case 98: statename="错误信息";break;
case 99: statename="无IE浏览器";break;
case 100: statename="无效的IE信息";break;
case 101: statename="呼叫状态错误";break;
case 102: statename="计时到达";break;
case 103: statename="强制性IE浏览器长度误差";break;
case 111: statename="协议错误";break;
case 127: statename="互通";break;
case 0: statename="管理人员挂机";break;
}
return statename;
}