These things on the internet to find a lot of, but also just record their own search. It is convenient for you to copy and paste later.
Finally for the implementation of the extension status in the Web real-time updates, I chose to use WebSocket.
Get extension status
public static String getextensionstate (int status) {
String statename= "";
Switch (status) {
Case-1: statename= "extension cannot be found";
Case 0:statename= "Idle";
Case 1:statename= "in use";
Case 2:statename= "Busy";
Case 4:statename= "not available";
Case 8:statename= "ringing";
Case 16:statename= "Waiting";
}
return statename;
}
Get Hang-up reason
public static String Gethangup (int status) {
String statename= "";
Switch (status) {
Case 1:statename= "Unassigned";
Case 2:statename= "no arrival route";
Case 3:statename= "No routing destination";
Case 6:statename= "Invalid channel";
Case 7:statename= "in the middle of a call";
Case 16:statename= "normal hanging machine";
Case 17:statename= "user Busy";
Case 18:statename= "no answer";
Case 19:statename= "no answer";
Case 21:statename= "refuses to answer";
Case 22:statename= "number changed";
Case 27:statename= "The order of purpose is wrong";
Case 28:statename= "Invalid number format";
Case 29:statename= "Device rejection";
Case 30:statename= "Query response";
Case 31:statename= "not specified normally";
Case 34:statename= "normal call congestion";
Case 38:statename= "Network status Difference";
Case 41:statename= "normal temporary failure";
Case 42:statename= "switch congestion";
Case 43:statename= "Information out of date";
Case 44:statename= "Invalid request Channel";
Case 45:statename= "be preempted";
Case 50:statename= "No call hold or call waiting";
Case 52:statename= "no Call out";
Case 54:statename= "no incoming calls";
Case 57:statename= "overload leads to failure";
Case 58:statename= "Too much load causes unreachable";
Case 65:statename= "Excessive load leads to realization";
Case 66:statename= "channel not Implemented";
Case 69:statename= "Device not implemented";
Case 81:statename= "Invalid call proof";
Case 88:statename= "incompatible destination";
Case 95:statename= "Invalid unknown Information";
Case 96:statename= "IE browser off";
Case 97:statename= "Unrecognized type of information";
Case 98:statename= "error message";
Case 99:statename= "no IE browser";
Case 100:statename= "Invalid IE information";
Case 101:statename= "Call status Error";
Case 102:statename= "timed arrival";
Case 103:statename= "Mandatory IE browser length error";
Case 111:statename= "protocol error";
Case 127:statename= "Interoperability";
Case 0:statename= "The manager hangs the machine";
}
return statename;
}
Asterisk-java ami5 extension status, hang machine reason, and so on