2012-04-13 6 views
0

나는 node-smpp을 사용 중이며 "deliver_sm"요청을 보내고 user_message_reference에 "TLV"응답을 추가하는 방법을 알고 싶습니다. node-smpp/lib/smpp.jsdeliver_sm 요청을 보내는 방법 node.js에서 user_message_reference TLV 추가 SMPP

추출 :

exports.addTLV = function(tag, options) { 
    options.tag = tag; 
    defs.tlvs[tlv] = options; 
    defs.tlvsById[options.id] = options; 
}; 

테스트 코드 :

var tlv = new Object(); 
tlv.tag = 0x001E; // smpp.receipted_message_id; 
tlv.lenght = msgid.lenght; 
tlv.value = msgid; 

smpp.addTLV(tlv,tlv); 

결과 :

defs.tlvs[tlv] = options; 
    ^
ReferenceError: tlv is not defined 
+0

SMPP는 모듈 이름입니까? 또한 TLV는 무엇을 의미합니까? – booyaa

답변

1

나는 노드 SMPP 모듈의 저자입니다.

tlv 매개 변수 또는 표준 매개 변수를 PDU에 추가하려면 pdu에 적절한 이름으로 속성을 추가하기 만하면됩니다.

session.deliver_sm({ 
    source_addr: 'blahblah', 
    destination_addr: 'blahblah', 
    short_message: 'blahblah', 
    receipted_message_id: 'blahblah', 
    user_message_reference: msgid 
}); 

위의 매개 변수와 다른 필수 paramers를 기본값으로 설정 한 deliver_sm pdu를 보냅니다.

일반적으로 smpp.addTLV을 사용할 필요가 없습니다. 이는 사용자 지정 공급 업체 특정 TLV (0x1400과 0x3FFF 사이의 태그)를 정의하기위한 것입니다.