Latest additions to TLVs

This commit is contained in:
2015-04-08 14:43:24 +02:00
parent 65be6142ca
commit f0d428794c
3 changed files with 133 additions and 36 deletions
+38
View File
@@ -158,6 +158,44 @@ describe('PDU convertion', function() {
done();
});
});
it('should add TLVs to a PDU', function(done) {
var pduObj = {
'cmdName': 'deliver_sm',
'seqNr': 393,
'cmdStatus': 'ESME_ROK',
'params': {
'source_addr': '46701113311',
'destination_addr': '46709771337',
'esm_class': 4,
'short_message': 'random stuff'
},
'tlvs': {
'receipted_message_id': {
'tagId': 0x001E,
'tagName': 'receipted_message_id',
'tagValue': '293f293'
},
'5142': {
'tagId': 5142,
'tagName': 'Nils',
'tagValue': new Buffer('blajfoo', 'ascii')
}
}
};
larvitsmpp.objToPdu(pduObj, function(err, pduBuf) {
assert( ! err, 'Error should be negative');
larvitsmpp.pduToObj(pduBuf, function(err, pduObj2) {
assert( ! err, 'Error should be negative');
console.log(pduObj2);
done();
});
});
});
});