smsc/lib/GG-SmsBatch.js
function InternalCB (data) {

        // [good or bad] let's notify user application
        if (data.status != 0) callback (data);

        // it's time to move to next message
        if (data.status <= 0) {
            if (++idx < smsarray.length) {
                new SmsRequest (smsc, InternalCB, smsarray [idx]);
            } else {
                callback ({status: 0});
            }
        }
    }
function InternalCB (data) {

        // [good or bad] let's notify user application
        if (data.status != 0) callback (data);

        // it's time to move to next message
        if (data.status <= 0) {
            if (++idx < smsarray.length) {
                new SmsRequest (smsc, InternalCB, smsarray [idx]);
            } else {
                callback ({status: 0});
            }
        }
    }
function InternalCB ( data ) { // [good or bad] let's notify user application if ( data . status != 0 ) callback ( data ) ; // it's time to move to next message if ( data . status <= 0 ) { if ( ++ idx < smsarray . length ) { new SmsRequest ( smsc , InternalCB , smsarray [ idx ] ) ; } else { callback ( { status : 0 } ) ; } } }
when message is processed move to next one otherwise call user applicationCB
when message is processed move to next one otherwise call user applicationCB