From an old thread (http://www.mail-archive.com/[email protected]/msg07693.html)
Alex moved the at2_error_string into smsc_at.c
2004-09-18 Alexander Malysh <amalysh at kannel.org>
* gw/smsc/smsc_at.c: added new function 'at2_error_string' and teached
smsc_at to use it.
But some error codes are missing.
1472:2009-06-16 16:00:59.0442 [2255] [8] ERROR: AT2[WAVECOM]: Generic error:
+CME ERROR: 515
2710:2009-06-16 23:35:40.0142 [2255] [8] ERROR: AT2[WAVECOM]: CMS ERROR: +CMS
ERROR: 513
2711:2009-06-16 23:35:40.0142 [2255] [8] ERROR: AT2[WAVECOM]: CMS ERROR: Error
number unknown. Ask google and add it. (513)
Each code is more or less detailled on comments
I think this should be left as it as there are no documentation on it.
This patch also prints the counter before the reset-string.
Vincent.
--
Telemaque - 06560 SOPHIA-ANTIPOLIS - (FR)
Service Technique/Reseau - NOC
Direction du Developpement xMS+
http://www.telemaque.fr/
[email protected]
Tel : +33 4 92 90 99 84 (fax 9142)
--- /gateway-cvs/gw/smsc/smsc_at.c 2009-04-15 14:02:48.000000000 +0200
+++ /gateway/gw/smsc/smsc_at.c 2009-06-17 12:27:11.000000000 +0200
@@ -1329,7 +1329,8 @@
}
if (at2_init_device(privdata) != 0) {
- error(0, "AT2[%s]: Initialization of device failed.",
octstr_get_cstr(privdata->name));
+ error(0, "AT2[%s]: [%d/%ld] Initialization of device failed.",
octstr_get_cstr(privdata->name),
+ error_count, privdata->max_error_count);
at2_close_device(privdata);
error_count++;
reconnecting = 1;
@@ -2895,150 +2896,513 @@
static const char *at2_error_string(int code)
{
switch (code) {
+ case 0:
+ /*
+ * Default the code to 0 then when you extract the value from the
+ * modem response message and no code is found, 0 will result.
+ */
+ return "Modem returned ERROR but no error code - possibly unsupported or
invalid command?";
+ case 1:
+ /*
+ * This cause indicates that the destination requested by the Mobile
+ * Station cannot be reached because, although the number is in a
+ * valid format, it is not currently assigned (allocated).
+ */
+ return "Unassigned (unallocated) number";
+ case 3:
+ /*
+ * This can be a lot of things, depending upon the command, but in
general
+ * it relates to trying to do a command when no connection exists.
+ */
+ return "Operation not allowed at this time (connection may be required)";
+ case 4:
+ /*
+ * This can be a lot of things, depending upon the command, but in
general
+ * it relates to invaid parameters being passed.
+ */
+ return "Operation / Parameter(s) not supported";
case 8:
+ /*
+ * This cause indicates that the MS has tried to send a mobile
originating
+ * short message when the MS's network operator or service provider has
+ * forbidden such transactions.
+ */
return "Operator determined barring";
case 10:
- return "Call barred";
+ /*
+ * This cause indicates that the outgoing call barred service applies to
+ * the short message service for the called destination.
+ */
+ return "Call barred or SIM not inserted or card inserted not a SIM";
+ case 11:
+ return "SIM PIN required";
+ case 12:
+ return "SIM PUK required";
+ case 13:
+ return "SIM failure";
+ case 16:
+ return "Incorrect password";
+ case 17:
+ /*
+ * This cause is sent to the MS if the MSC cannot service an MS generated
+ * request because of PLMN failures, e.g. problems in MAP.
+ */
+ return "Network failure";
+ case 18:
+ return "SIM PUK2 required";
+ case 20:
+ return "Memory full";
case 21:
+ /*
+ * This cause indicates that the equipment sending this cause does not
+ * wish to accept this short message, although it could have accepted
+ * the short message since the equipment sending this cause is neither
+ * busy nor incompatible.
+ */
return "Short message transfer rejected";
+ case 22:
+ /*
+ * This cause is sent if the service request cannot be actioned because
+ * of congestion (e.g. no channel, facility busy/congested etc.). Or
+ * this cause indicates that the mobile station cannot store the
+ * incoming short message due to lack of storage capacity.
+ */
+ return "Congestion or Memory capacity exceeded";
+ case 24:
+ return "Text string too long"; /* +CPBW, +CPIN, +CPIN2, +CLCK, +CPWD */
+ case 26:
+ return "Dial string too long"; /* +CPBW, ATD, +CCFC */
case 27:
+ /*
+ * This cause indicates that the destination indicated by the Mobile
+ * Station cannot be reached because the interface to the destination
+ * is not functioning correctly. The term "not functioning correctly"
+ * indicates that a signalling message was unable to be delivered to
+ * the remote user; e.g., a physical layer or data link layer failure
+ * at the remote user, user equipment off-line, etc.
+ * Also means "Invalid characters in dial string" for +CPBW.
+ */
return "Destination out of service";
case 28:
+ /*
+ * This cause indicates that the subscriber is not registered in the
PLMN
+ * (i.e. IMSI not known).
+ */
return "Unidentified subscriber";
case 29:
+ /*
+ * This cause indicates that the facility requested by the Mobile
Station
+ * is not supported by the PLMN.
+ */
return "Facility rejected";
case 30:
- return "Unknown subscriber";
+ /*
+ * This cause indicates that the subscriber is not registered in the HLR
+ * (i.e. IMSI or directory number is not allocated to a subscriber).
+ * Also means "No network service" for +VTS, +COPS=?, +CLCK, +CCFC,
+CCWA, +CUSD
+ */
+ return "Unknown subscriber or No network service";
+ case 32:
+ return "Network not allowed � emergency calls only"; /* +COPS */
case 38:
+ /*
+ * This cause indicates that the network is not functioning correctly
and
+ * that the condition is likely to last a relatively long period of
time;
+ * e.g., immediately reattempting the short message transfer is not
+ * likely to be successful.
+ */
return "Network out of order";
+ case 40:
+ return "Network personal PIN required (Network lock)";
case 41:
+ /*
+ * This cause indicates that the network is not functioning correctly
and
+ * that the condition is not likely to last a long period of time; e.g.,
+ * the Mobile Station may wish to try another short message transfer
+ * attempt almost immediately.
+ */
return "Temporary failure";
case 42:
+ /*
+ * This cause indicates that the short message service cannot be
serviced
+ * because of high traffic.
+ */
return "Congestion";
case 47:
+ /*
+ * This cause is used to report a resource unavailable event only when
no
+ * other cause applies.
+ */
return "Resources unavailable, unspecified";
case 50:
+ /*
+ * This cause indicates that the requested short message service could
not
+ * be provided by the network because the user has not completed the
+ * necessary administrative arrangements with its supporting networks.
+ */
return "Requested facility not subscribed";
case 69:
+ /*
+ * This cause indicates that the network is unable to provide the
+ * requested short message service.
+ */
return "Requested facility not implemented";
case 81:
+ /*
+ * This cause indicates that the equipment sending this cause has
received
+ * a message with a short message reference which is not currently in
use
+ * on the MS-network interface.
+ */
return "Invalid short message transfer reference value";
case 95:
+ /*
+ * This cause is used to report an invalid message event only when no
+ * other cause in the invalid message class applies.
+ */
return "Invalid message, unspecified";
case 96:
+ /*
+ * This cause indicates that the equipment sending this cause has
received
+ * a message where a mandatory information element is missing and/or has
+ * a content error (the two cases are indistinguishable).
+ */
return "Invalid mandatory information";
case 97:
+ /*
+ * This cause indicates that the equipment sending this cause has
received
+ * a message with a message type it does not recognize either because
this
+ * is a message not defined or defined but not implemented by the
+ * equipment sending this cause.
+ */
return "Message type non-existent or not implemented";
case 98:
+ /*
+ * This cause indicates that the equipment sending this cause has
received
+ * a message such that the procedures do not indicate that this is a
+ * permissible message to receive while in the short message transfer
+ * state.
+ */
return "Message not compatible with short message protocol state";
case 99:
+ /*
+ * This cause indicates that the equipment sending this cause has
received
+ * a message which includes information elements not recognized because
+ * the information element identifier is not defined or it is defined
+ * but not implemented by the equipment sending the cause. However, the
+ * information element is not required to be present in the message in
+ * order for the equipment sending the cause to process the message.
+ */
return "Information element non-existent or not implemented";
+ case 103:
+ return "Illegal MS (#3)"; /* +CGATT */
+ case 106:
+ return "Illegal ME (#6)"; /* +CGATT */
+ case 107:
+ return "GPRS services not allowed (#7)"; /* +CGATT */
case 111:
- return "Protocol error, unspecified";
+ /*
+ * This cause is used to report a protocol error event only when no
other
+ * cause applies.
+ * Also means "PLMN not allowed (#11)" for +CGATT
+ */
+ return "Protocol error, unspecified or PLMN not allowed (#11)";
+ case 112:
+ return "Location area not allowed (#12)"; /* +CGATT */
+ case 113:
+ return "Roaming not allowed in this area (#13)"; /* +CGATT */
case 127:
+ /*
+ * This cause indicates that there has been interworking with a network
+ * which does not provide causes for actions it takes; thus, the precise
+ * cause for a message which is being send cannot be ascertained.
+ */
return "Interworking, unspecified";
case 128:
- return "Telematic interworking not supported";
+ /*
+ */
+ return "Telematic interworking not supported x";
case 129:
- return "Short message Type 0 not supported";
+ /*
+ */
+ return "Short message Type 0 not supported x x";
case 130:
- return "Cannot replace short message";
+ /*
+ */
+ return "Cannot replace short message x x";
+ case 132:
+ return "service option not supported (#32)"; /* +CGACT +CGDATA ATD*99 */
+ case 133:
+ return "requested service option not subscribed (#33)"; /* +CGACT
+CGDATA ATD*99 */
+ case 134:
+ return "service option temporarily out of order (#34)"; /* +CGACT
+CGDATA ATD*99 */
case 143:
- return "Unspecified TP-PID error";
+ /*
+ */
+ return "Unspecified TP-PID error x x";
case 144:
- return "Data coding scheme (alphabet not supported";
+ /*
+ */
+ return "Data coding scheme (alphabet) not supported x";
case 145:
- return "Message class not supported";
+ /*
+ */
+ return "Message class not supported x";
+ case 148:
+ return "unspecified GPRS error";
+ case 149:
+ return "PDP authentication failure"; /* +CGACT +CGDATA ATD*99 */
+ case 150:
+ return "invalid mobile class";
case 159:
- return "Unspecified TP-DCS error";
+ /*
+ */
+ return "Unspecified TP-DCS error x x";
case 160:
- return "Command cannot be actioned";
+ /*
+ */
+ return "Command cannot be actioned x";
case 161:
- return "Command unsupported";
+ /*
+ */
+ return "Command unsupported x";
case 175:
- return "Unspecified TP-Command error";
+ /*
+ */
+ return "Unspecified TP-Command error x";
case 176:
- return "TPDU not supported";
+ /*
+ */
+ return "TPDU not supported x x";
case 192:
- return "SC busy";
+ /*
+ */
+ return "SC busy x";
case 193:
- return "No SC subscription";
+ /*
+ */
+ return "No SC subscription x";
case 194:
- return "SC system failure";
+ /*
+ */
+ return "SC system failure x";
case 195:
- return "Invalid SME address";
+ /*
+ */
+ return "Invalid SME address x";
case 196:
- return "Destination SME barred";
+ /*
+ */
+ return "Destination SME barred x";
case 197:
- return "SM Rejected-Duplicate SM";
+ /*
+ */
+ return "SM Rejected-Duplicate SM x";
case 198:
- return "TP-VPF not supported";
+ /*
+ */
+ return "TP-VPF not supported X";
case 199:
- return "TP-VP not supported";
+ /*
+ */
+ return "TP-VP not supported X";
case 208:
- return "D0 SIM SMS storage full";
+ /*
+ */
+ return "DO SIM SMS storage full x";
case 209:
- return "No SMS storage capability in SIM";
+ /*
+ */
+ return "No SMS storage capability in SIM x";
case 210:
- return "Error in MS";
+ /*
+ */
+ return "Error in MS x";
case 211:
- return "D0 SIM SMS storage full";
+ /*
+ */
+ return "Memory Capacity Exceeded X";
case 212:
- return "SIM Application Toolkit Busy";
+ /*
+ */
+ return "SIM Application Toolkit Busy x x";
case 213:
+ /*
+ */
return "SIM data download error";
case 255:
+ /*
+ */
return "Unspecified error cause";
case 300:
+ /*
+ */
return "ME failure";
case 301:
+ /*
+ */
return "SMS service of ME reserved";
case 302:
+ /*
+ */
return "Operation not allowed";
case 303:
+ /*
+ */
return "Operation not supported";
case 304:
+ /*
+ */
return "Invalid PDU mode parameter";
case 305:
+ /*
+ */
return "Invalid text mode parameter";
case 310:
+ /*
+ */
return "SIM not inserted";
case 311:
+ /*
+ */
return "SIM PIN required";
case 312:
+ /*
+ */
return "PH-SIM PIN required";
case 313:
+ /*
+ */
return "SIM failure";
case 314:
+ /*
+ */
return "SIM busy";
case 315:
+ /*
+ */
return "SIM wrong";
case 316:
+ /*
+ */
return "SIM PUK required";
case 317:
+ /*
+ */
return "SIM PIN2 required";
case 318:
+ /*
+ */
return "SIM PUK2 required";
case 320:
+ /*
+ */
return "Memory failure";
case 321:
+ /*
+ */
return "Invalid memory index -> don't worry, just memory
fragmentation.";
case 322:
+ /*
+ */
return "Memory full";
case 330:
+ /*
+ */
return "SMSC address unknown";
case 331:
+ /*
+ */
return "No network service";
case 332:
+ /*
+ */
return "Network timeout";
case 340:
+ /*
+ */
return "NO +CNMA ACK EXPECTED";
case 500:
+ /*
+ */
return "Unknown error. -> maybe Sim storage is full? I'll have a look
at it.";
case 512:
- return "User abort";
+ /*
+ * Resulting from +CMGS, +CMSS
+ */
+ return "User abort or MM establishment failure (SMS)";
+ case 513:
+ /*
+ * Resulting from +CMGS, +CMSS
+ */
+ return "Lower layer falure (SMS)";
+ case 514:
+ /*
+ * Resulting from +CMGS, +CMSS
+ */
+ return "CP error (SMS)";
+ case 515:
+ /*
+ */
+ return "Please wait, service not available, init or command in progress";
+ case 517:
+ /*
+ * Resulting from +STGI
+ */
+ return "SIM ToolKit facility not supported";
+ case 518:
+ /*
+ * Resulting from +STGI
+ */
+ return "SIM ToolKit indication not received";
+ case 519:
+ /*
+ * Resulting from +ECHO, +VIP
+ */
+ return "Reset the product to activate or change a new echo cancellation
algorithm";
+ case 520:
+ /*
+ * Resulting from +COPS=?
+ */
+ return "Automatic abort about get plmn list for an incoming call";
+ case 526:
+ /*
+ * Resulting from +CLCK
+ */
+ return "PIN deactivation forbidden with this SIM card";
+ case 527:
+ /*
+ * Resulting from +COPS
+ */
+ return "Please wait, RR or MM is busy. Retry your selection later";
+ case 528:
+ /*
+ * Resulting from +COPS
+ */
+ return "Location update failure. Emergency calls only";
+ case 529:
+ /*
+ * Resulting from +COPS
+ */
+ return "PLMN selection failure. Emergency calls only";
+ case 531:
+ /*
+ * Resulting from +CMGS, +CMSS
+ */
+ return "SMS not sent: the <da> is not in FDN phonebook, and FDN lock is
enabled";
+ case 532:
+ /*
+ * Resulting from +WOPEN
+ */
+ return "The embedded application is activated so the objects flash are
not erased.";
+ case 533:
+ /*
+ * Resulting from +ATD*99,+GACT,+CGDATA
+ */
+ return "Missing or unknown APN";
default:
- return "Error number unknown. Ask google and add it.";
+ /*
+ */
+ return "error number not known to us. Ask google and add it.";
}
}