Skip to content
OmniChannels.ai

SMS and telecom

What is submit_sm?

submit_sm PDU · SMPP submit

Definition

submit_sm is the SMPP v3.4 operation (command_id 0x00000004) an application uses to submit a single SMS to the SMSC. The SMSC replies with submit_sm_resp containing a message_id used to match later delivery receipts.

Key fields are source_addr (the sender ID) with its TON/NPI, destination_addr, esm_class, registered_delivery (request a receipt), data_coding (for example 0x00 default alphabet or 0x08 UCS-2), sm_length and short_message.

short_message holds up to 254 octets. For longer user data the specification says to set sm_length to zero and put the content in the message_payload TLV instead.

If the sender builds its own concatenation header, it sets the UDHI bit (0x40) in esm_class and prepends the UDH to short_message.

A non-zero command_status in submit_sm_resp means the SMSC rejected the message, for example ESME_RINVDSTADR (invalid destination) or ESME_RTHROTTLED (throughput exceeded). Acceptance only means the SMSC took the message; the delivery receipt reports the final outcome.

data_coding tells the SMSC how to interpret short_message. 0x00 means the SMSC default alphabet, which is usually GSM-7 but not guaranteed, 0x03 is Latin-1 and 0x08 is UCS-2. Sending Arabic text with the wrong value produces garbled characters, so test with real Arabic strings against each route. Alphanumeric sender IDs are normally sent with source_addr_ton set to 5.

Concatenated messages can be sent two ways: the client splits the text and sets a UDH in each part, or it uses the sar_msg_ref_num, sar_total_segments and sar_segment_seqnum TLVs. Providers differ on which they accept, and a wrong choice causes parts to arrive as separate messages.

Useful optional fields are validity_period, which caps how long the SMSC retries, schedule_delivery_time for deferred sending, and priority_flag. Whether these are honoured depends on the provider and the destination operator, so check support before relying on them.

The delivery receipt is not in submit_sm_resp. It comes later as a deliver_sm with the same message_id in its text, which is why storing the id at submission time is essential.

Operational tips: log the sequence_number, message_id and command_status for every submission, alert on a rising share of non-zero responses, and keep the destination in international format without a plus sign in destination_addr, as the sample shows. When you debug a missing message, the combination of submit_sm_resp and the later receipt tells you where it was lost.

Example

submit_sm: source_addr_ton=5 source_addr="AcmeBank" dest_addr_ton=1 destination_addr="971501234567" registered_delivery=1 data_coding=0x00 short_message="Your code is 482913"

Frequently asked questions

What is the difference between submit_sm and deliver_sm?

submit_sm sends a message from your application to the SMSC. deliver_sm travels the other way and carries either an inbound message from a handset or a delivery receipt for one you sent.

What does a submit_sm_resp with a non-zero command_status mean?

The SMSC rejected the submission. Typical codes are ESME_RINVDSTADR for a bad destination and ESME_RTHROTTLED when you exceed your rate. Fix the cause or back off, rather than resending immediately.

How do I send a message longer than 160 characters with submit_sm?

Split it into parts with a concatenation header or SAR TLVs, or ask your provider whether it splits long messages for you. Each part is billed as a segment.

Can submit_sm send Arabic text?

Yes. Set data_coding to 0x08 and encode the text as UCS-2 (big-endian UTF-16). Each message then holds 70 characters, or 67 per part when split.

Sources