def sendMessage(self, to, message):
        logger.debug('sendMessage() to ' + to + ' message ' + message)
        logger.debug('self ' + str(self))
        logger.debug('self.messageQueue ' + str(id(self.messageQueue)))

        msg = Message()
        msg.createMessage(to, message)

        self.messageQueue.append(msg)
    def _forwardCall(self, sNumber):
        logger.debug('_forwardCall() sNumber ' + sNumber)

        self.modem.setCallForward(sNumber)

        if self.bCallForwardNotify == True:
            notify = Message()
            notify.createMessage(sNumber,
                                 'Calls are now being diverted to you.')
            self.modem.sendMessage(notify)
    def _autoReply(self, message):

        result = True
        logger.debug('_autoReply() ' + message.toString())
        logger.debug('_autoReply() ' + str(self.listAutoReply))

        if (message.getFrom() in self.listAutoReply) == False:
            self.listAutoReply.append(message.getFrom())

            reply = Message()
            reply.createMessage(message.getFrom(), self.sAutoReplyText)

            result = self.modem.sendMessage(reply)

        return result
    def _forwardSMS(self, message):

        forwardMessage = Message()

        if message.getFrom() == self.sForwardSMSNumber:
            if len(self.sLastMessageFrom) > 0:
                forwardMessage.createMessage(self.sLastMessageFrom,
                                             message.getMessage())
            else:
                forwardMessage.createMessage(
                    self.sForwardSMSNumber,
                    'There is no message to reply to ... sorry')
        else:
            self.sLastMessageFrom = message.getFrom()

            newMessage = '(' + message.getFrom() + ') ' + message.getMessage()

            forwardMessage.createMessage(self.sForwardSMSNumber, newMessage)

        logger.debug(forwardMessage.toString())
        return self.modem.sendMessage(forwardMessage)