smsc/lib/GG-SmsRequest.js
function CheckDevAckCB(err, results) {
        self.retry ++; // retry counter for ACK
        self.Debug (6, "CheckDevAckCB Phone=%s Retry=%d/%d Result=%j", smscmd.phone, self.retry, smsc.opts.retry, results);
        // ack no received
        if (results.length === 0) {
            if (self.retry <= smsc.opts.retry) {
                setTimeout (function() {CheckDevAck ();}, smsc.opts.delay);
            } else {
                self.Debug (7, "CheckDevAckCB Ack Abandoned MaxRetry=%s", smsc.opts.retry);
                appcb ({status: -2, smsid: smscmd.id});
            }
        } else {
            // we may have more than one responses for a given command
            for (var slot in results) {
                var ack =
                { status: 2
                    , smsid: smscmd.id
                    , phone: smscmd.phone
                    , ack: results[slot].TextDecoded
                };
                // ACK received, delete it from inbox and send it to application
                self.Debug (6, "CheckDevAckCB Ack Received %j", ack);
                smsc.DelById (DelByIdCB, results[slot].Id);
                appcb({status: 2, smsid: smscmd.id, msg: ack});
            }
            appcb({status: 0});
        }
    }
function CheckDevAckCB(err, results) {
        self.retry ++; // retry counter for ACK
        self.Debug (6, "CheckDevAckCB Phone=%s Retry=%d/%d Result=%j", smscmd.phone, self.retry, smsc.opts.retry, results);
        // ack no received
        if (results.length === 0) {
            if (self.retry <= smsc.opts.retry) {
                setTimeout (function() {CheckDevAck ();}, smsc.opts.delay);
            } else {
                self.Debug (7, "CheckDevAckCB Ack Abandoned MaxRetry=%s", smsc.opts.retry);
                appcb ({status: -2, smsid: smscmd.id});
            }
        } else {
            // we may have more than one responses for a given command
            for (var slot in results) {
                var ack =
                { status: 2
                    , smsid: smscmd.id
                    , phone: smscmd.phone
                    , ack: results[slot].TextDecoded
                };
                // ACK received, delete it from inbox and send it to application
                self.Debug (6, "CheckDevAckCB Ack Received %j", ack);
                smsc.DelById (DelByIdCB, results[slot].Id);
                appcb({status: 2, smsid: smscmd.id, msg: ack});
            }
            appcb({status: 0});
        }
    }
function CheckDevAckCB ( err , results ) { self . retry ++ ; // retry counter for ACK self . Debug ( 6 , "CheckDevAckCB Phone=%s Retry=%d/%d Result=%j" , smscmd . phone , self . retry , smsc . opts . retry , results ) ; // ack no received if ( results . length === 0 ) { if ( self . retry <= smsc . opts . retry ) { setTimeout ( function ( ) { CheckDevAck ( ) ; } , smsc . opts . delay ) ; } else { self . Debug ( 7 , "CheckDevAckCB Ack Abandoned MaxRetry=%s" , smsc . opts . retry ) ; appcb ( { status : - 2 , smsid : smscmd . id } ) ; } } else { // we may have more than one responses for a given command for ( var slot in results ) { var ack = { status : 2 , smsid : smscmd . id , phone : smscmd . phone , ack : results [ slot ] . TextDecoded } ; // ACK received, delete it from inbox and send it to application self . Debug ( 6 , "CheckDevAckCB Ack Received %j" , ack ) ; smsc . DelById ( DelByIdCB , results [ slot ] . Id ) ; appcb ( { status : 2 , smsid : smscmd . id , msg : ack } ) ; } appcb ( { status : 0 } ) ; } }
this method is called by MySql when sms.GetFrom return
this method is called by MySql when sms . GetFrom return