**>From: "Simon Yip" <[EMAIL PROTECTED]>
**>To: <[email protected]>
**>Subject: Receiving SMS
**>Date: Wed, 26 Jan 2005 10:58:28 +0800
**>
**>I'm still testing it but I have got this error on core group log file
**>
**>2005-01-26 10:52:39 [16465] [6] ERROR: AT2[t39]: got +CMT but pdu_extract 
**>failed
**>
**>Is it about the received message ?

Yes, the +CMT is the unsolicited notification coming from your mobile
device.  This is how the GSM modem will tell Kannel's bearerbox that
it has received an MT SMS.

To find out why the pdu_extract failed, you would need to look at
the bearerbox logs with loglevel set to 0.  Then, look at the 
dialog betwen the bearerbox and the GSM modem.  Kannel expects
the "+CMT: ...." stuff to be in a specific format and byte sequence.
If it is not then the at2_pdu_extract() function will fail you get
you the message you see in the log.

Also, timing matters as well, the current version only tolerates
a 1 second delay between receiving the "+CMT:..." message and
receiving the hexadecimal encoded PDU.

at2_pdu_extract() looks for the following for a +CMT:
  - "+CMT:" within the received byte stream
  - If "broken" is not true, then expect to see a ",size_of_SMS".
    BTW, the "broken" boolean declaration in the modem group does not
    seem to be documented in the current CVS userguide. I'll add
    that to my updates of the userguide.
  - After the size_of_SMS, should be whitespace (that includes the LF)
    that is skipped over.
  - If "no_smsc" is set to "false" (the default), then the first two
    characters of the PDU will be the length of the SMSC's phone
    number. The phone number of the SMSC will follow after the length
    indication.
  - The encoded SMS as represented in hexadecimal follows the
    SMSC information in the PDU.

If you notice that the "+CMT:..." does not provide you with the
length of the SMS, then you might want to set the "broken = true"
parameter for your "group = modems" secton.

If you know that your modem does not set the SMSC phone number in the
PDU, then you should try "no_smsc = true" for your "group = modems"
section.

If none of it works, then try submitting your bearerbox logs to
the mailing list.

See ya...

d.c.

Reply via email to