private void AutoMappingCallHandlers() { // List Current Calls of MT. If command succeeds but no calls are available no information response is sent. if (ExecCommand("AT+CLCC=?", TimeoutCommand, new[] { ResponseCode.OK, ResponseCode.ERROR }).Code != ResponseCode.ERROR) { _dialUp = DialUpCLCC; } // Used to interrogate the ME before requesting action from the phone. else if (ExecCommand("AT+CPAS=?", TimeoutCommand, new[] { ResponseCode.OK, ResponseCode.ERROR }).Code != ResponseCode.ERROR) { _dialUp = DialUpCPAS; } else { // Model of mobile is not supportting AT+CLCC и AT+CPAS. Program is using standard mode of modem answer now. _dialUp = DialUp; } if (ExecCommand("AT+CHUP=?", TimeoutCommand, new[] { ResponseCode.OK, ResponseCode.ERROR }).Code != ResponseCode.ERROR) { _hangUp = HangUpCHUP; } else { // Mobile is not support AT+CHUP. Program is using standard mode of call reset now. _hangUp = HangUp; } }
private bool MappingCallHandlers(string phone) { bool res = false; switch (phone) { case "Nokia 2700 classic": // в режиме AT+CLCC через каждые примерно 10 звонков телефон попадает в blacklist case "Nokia 6300": // c AT+CLCC работает некорректно (присылает Ring, a потом Connect для неактивированного номера) case "Nokia X2-00": // RING and then CONNECT for MTC net breakdown and one beep is heard instead of ringing case "Nokia 6131": // Twice on day blacklisted phone(when clcc command is used) even in hybrid model case "Nokia C2-01": // Timeout when recipient reset call, no Busy code received in CLCC mode { _dialUp = DialUpCPAS; _hangUp = HangUpCHUP; res = true; break; } case "Nokia 302": { _dialUp = DialUpHibryd; _hangUp = HangUpCHUP; res = true; break; } case "Nokia 6233": case "Nokia 6500s-1": case "Nokia 5800 XpressMusic": case "E1550": // CLCC shows error when call is reset by abonent, CPAS didn't show that there is no carrier and continue to keep line. { _dialUp = DialUpCLCC; _hangUp = HangUpCHUP; res = true; break; } case "LG-T515": { _dialUp = DialUpCLCC; _hangUp = HangUp; res = true; break; } case "GT-S5230": { _dialUp = DialUp; _hangUp = HangUp; res = true; break; } default: { // "GT-B7722" is silent if (phone.Contains("GT-")) { _dialUp = DialUp; _hangUp = HangUp; res = true; } break; } } return(res); }