Open parsibox opened 6 years ago
Hello @parsibox
I'm not very familiar with USSD but as far as I can see it can be used with SMPP through TLVs. This library supports it by ussd_service_op TLV, check it here: https://github.com/farhadi/node-smpp/blob/master/lib/defs.js#L892
As a guide I've found this that can help you, have a look at the explanation, not the code: https://www.activexperts.com/sms-component/sms/ussd/
hi
send submit_sm
session.submit_sm({ source_addr_ton: 0x05, source_addr_npi: 0x01, source_addr: 'myphone', dest_addr_ton: 0x01, dest_addr_npi: 0x01, destination_addr: '*100#', }, (pdu) => { console.log('session.submit_sm pdu='); console.log(pdu); } });
getting status 69
submit_sm failed
how to send ussd to number: *100# ?
Hi @izhrobot
You have to add that data in the corresponding TLV instead of destination_addr:
session.submit_sm(
{
source_addr_ton: 0x05,
source_addr_npi: 0x01,
source_addr: 'myphone',
dest_addr_ton: 0x01,
dest_addr_npi: 0x01,
ussd_service_op: '*100#'
},
(pdu) => {
console.log('session.submit_sm pdu=');
console.log(pdu);
}
);
As I mention before I don't have experience with USSD so have a look at the guide I linked
AND if you would be so kind to share if it works or not I'd really appreciate it, also as a guide for others on this matter
Hi
this one comes to the log response
session.on pdu= PDU { command_length: 16, command_id: 2147483652, command_status: 69, sequence_number: 2, command: 'submit_sm_resp' }
status: 69
Hi
You should ask your provider why you're receiving ESME_RSUBMITFAIL error (69 in decimal, 0x45 in hex) and if and how they happen to support USSD
One last thing I've just noticed reviewing the code, ussd_service_op is a 1 byte int so reconsider the value you want to send
I have a GoIP GSM gateway. It can work on SMPP protocol. I can send USSD through its interface. *100# - this is a balance request
Have you tried sending the USSD command as the submit_sm's short_message field? and maybe 2 as ussd_service_op (USSR Request)
Take a look here for the possible values of ussd_service_op
sending was successful
but such an answer came
short_message: { message: 'id:45013692 sub:0 dlvrd:28 submit date:1908121157 done date:1908121158 stat:UNDELIV err:21 Text:*100#' }
Well that's an standard undelivered deliver_sm_resp you should have documentation for DR errors (21 in this case) if you don't have it then request your provider what that error means
INVSERTYP 0x00000015 (21) Invalid Service Type
here is the full answer
PDU { command_length: 134, command_id: 5, command_status: 0, sequence_number: 8, command: 'deliver_sm', service_type: '', source_addr_ton: 0, source_addr_npi: 0, source_addr: '', dest_addr_ton: 5, dest_addr_npi: 0, destination_addr: '', esm_class: 4, protocol_id: 8, priority_flag: 0, schedule_delivery_time: '', validity_period: '', registered_delivery: 0, replace_if_present_flag: 0, data_coding: 0, sm_default_msg_id: 0, short_message: { message: 'id:59633913 sub:0 dlvrd:28 submit date:1908121249 done date:1908121249 stat:UNDELIV err:21 Text:*100#' } }
As you can see deliver_sm's command_status: 0, on the other hand deliver's "error status" is 21
Do not confuse them, 0x15 (ESME_RINVSERTYP) is the status you would receive in submit_sm_resp if the service was not supported, which is not your case
You have to ask your provider what that error status means, those errors are not defined in the standard
I do not have access to the technical specialists of the provider. the service itself works. I don’t know how to use it using the SMPP protocol. here is a link to some documentation of this provider: http://static.mts.ru/uploadmsk/contents/1655/tekhnicheskie_harakteristiki_trebovaniia_usluge_ussd_meniu.pdf
That is as far as I can go, not knowing what the delivery errors are there is no way to debug this The service works (I assume from their panel) because they know how to send USSD messages to their own service of course, in your case you need to know how to configure the PDU and for that you need more documentation or access to tech team
As I understand it, you need to know the phone number of the USSD provider. And add it to destination_addr. I do not have this number. And my GoIP sends USSD using AT commands: AT + CUSD = 1, "* 100 #"
And my GoIP sends USSD using AT commands: AT + CUSD = 1, "* 100 #"
I'm afraid I can't be of help with this as it falls out of my knowledge, sorry
It turns out that my GoIP is a server in which the SMPP protocol is implemented. I wrote to tech support the developers of this device. Maybe they will tell me how to send USSD via SMPP on their GoIP device.
Please once you have it figured out share, so this lays as documentation for future developers
ok I'm waiting for a response from tech support
Came the reply from tech support
GoIP do not support USSD sending in SMPP.
Awesome, no luck there
sending was successful but such an answer came
short_message: { message: 'id:45013692 sub:0 dlvrd:28 submit date:1908121157 done date:1908121158 stat:UNDELIV err:21 Text:*100#' }
Hello,How can you get de short_message? Can you offer me a demo ?
@wuzhitian, that short_message is the payload of the deliver_sm PDU received with the delivery report of the sent sms
hi can you explain how can use ussd via smpp?