Diverting sms

This is already in other topic… but i’ll put it here too.

I’m programming a small software for Wavecom fastrack M1306B GSM-modem and i’m trying to make the modem forward text messages to a specific number, no matter how many messages the modem receives or when it receives them.

The main problem is that the modem sends error messages (+CMS ERROR: 515 or +CMS ERROR: 512) when sending more than two messages simultaneously or with short intervals. For example, if i send 5 messages to the modem one after the other or simultaneosly, only 4 or less messages are forwarded. The forwarding-function has been programmed like this:

  • When a message arrives, GSM-modem sends a result code to PC
  • The software notifys it, and sends an AT-command to the modem to send the message from previously stored location to a specific number
  • The modem sends the message, and gives a result code to the PC if the sending fails or succees.
  • The result code is error if the modem receives a new message and sends an old message at the same time, or if the modem sends a result code to PC and is received AT-command from PC at the same time.

So is it possible at all to make the modem divert messages? How can i do it properly?