Harald Welte | 32ff8b9 | 2018-04-14 10:57:41 +0200 | [diff] [blame] | 1 | module SMPP_Templates { |
| 2 | |
| 3 | import from General_Types all; |
| 4 | import from SMPP_Types all; |
| 5 | |
| 6 | template (value) SMPP_header ts_SMPP_hdr(OCT4 command_id, SMPP_error_code status, |
| 7 | integer seq := 0) := { |
| 8 | command_len := 0, |
| 9 | command_id := command_id, |
| 10 | command_status := status, |
| 11 | seq_num := seq |
| 12 | } |
| 13 | template SMPP_header tr_SMPP_hdr(template OCT4 command_id, template SMPP_error_code status, |
| 14 | template integer seq := ?) := { |
| 15 | command_len := ?, |
| 16 | command_id := command_id, |
| 17 | command_status := status, |
| 18 | seq_num := seq |
| 19 | } |
| 20 | |
| 21 | template (value) SMPP_PDU ts_SMPP(OCT4 command_id, SMPP_error_code status, |
| 22 | template (value) SMPP_operation_body body) := { |
| 23 | header := ts_SMPP_hdr(command_id, status), |
| 24 | body := body |
| 25 | } |
| 26 | template SMPP_PDU tr_SMPP(template OCT4 command_id, template SMPP_error_code status, |
| 27 | template integer seq := ?, |
| 28 | template SMPP_operation_body body := ?) := { |
| 29 | header := tr_SMPP_hdr(command_id, status, seq), |
| 30 | body := body |
| 31 | } |
| 32 | |
| 33 | |
| 34 | |
| 35 | template (value) SMPP_PDU ts_SMPP_BIND_TX(template (value) SMPP_Bind bind) := { |
| 36 | header := ts_SMPP_hdr(c_SMPP_command_id_bind_transmitter, ESME_ROK), |
| 37 | body := { |
| 38 | bind_transmitter := bind |
| 39 | } |
| 40 | } |
| 41 | template SMPP_PDU tr_SMPP_BIND_TX(template (value) SMPP_Bind bind, template integer seq := ?) := { |
| 42 | header := tr_SMPP_hdr(c_SMPP_command_id_bind_transmitter, ESME_ROK, seq), |
| 43 | body := { |
| 44 | bind_transmitter := bind |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | template (value) SMPP_PDU ts_SMPP_BIND_TX_resp(SMPP_error_code status, |
| 49 | template (value) SMPP_Bind_resp bind) := { |
| 50 | header := ts_SMPP_hdr(c_SMPP_command_id_bind_transmitter_resp, status), |
| 51 | body := { |
| 52 | bind_transmitter_resp := bind |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | template (value) SMPP_PDU ts_SMPP_BIND_RX(template (value) SMPP_Bind bind) := { |
| 57 | header := ts_SMPP_hdr(c_SMPP_command_id_bind_receiver, ESME_ROK), |
| 58 | body := { |
| 59 | bind_receiver := bind |
| 60 | } |
| 61 | } |
| 62 | template SMPP_PDU tr_SMPP_BIND_RX(template (value) SMPP_Bind bind, template integer seq := ?) := { |
| 63 | header := tr_SMPP_hdr(c_SMPP_command_id_bind_receiver, ESME_ROK, seq), |
| 64 | body := { |
| 65 | bind_receiver := bind |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | template (value) SMPP_PDU ts_SMPP_BIND_RX_resp(SMPP_error_code status, |
| 70 | template (value) SMPP_Bind_resp bind) := { |
| 71 | header := ts_SMPP_hdr(c_SMPP_command_id_bind_receiver_resp, status), |
| 72 | body := { |
| 73 | bind_receiver_resp := bind |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | template (value) SMPP_PDU ts_SMPP_BIND_TRX(template (value) SMPP_Bind bind) := { |
| 78 | header := ts_SMPP_hdr(c_SMPP_command_id_bind_transceiver, ESME_ROK), |
| 79 | body := { |
| 80 | bind_transceiver := bind |
| 81 | } |
| 82 | } |
| 83 | template SMPP_PDU tr_SMPP_BIND_TRX(template (value) SMPP_Bind bind, template integer seq := ?) := { |
| 84 | header := tr_SMPP_hdr(c_SMPP_command_id_bind_transceiver, ESME_ROK, seq), |
| 85 | body := { |
| 86 | bind_transceiver := bind |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | template (value) SMPP_PDU ts_SMPP_BIND_TRX_resp(SMPP_error_code status, |
| 91 | template (value) SMPP_Bind_resp bind) := { |
| 92 | header := ts_SMPP_hdr(c_SMPP_command_id_bind_transceiver_resp, status), |
| 93 | body := { |
| 94 | bind_transceiver_resp := bind |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | template (value) SMPP_PDU ts_SMPP_ENQ_LINK := { |
| 99 | header := ts_SMPP_hdr(c_SMPP_command_id_enquire_link, ESME_ROK), |
| 100 | body := { |
| 101 | enquire_link := {} |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | template (value) SMPP_PDU ts_SMPP_ENQ_LINK_resp := { |
| 106 | header := ts_SMPP_hdr(c_SMPP_command_id_enquire_link_resp, ESME_ROK), |
| 107 | body := { |
| 108 | enquire_link_resp := {} |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | template (value) SMPP_PDU ts_SMPP_DELIVER_SM_resp(SMPP_error_code status, integer seq) := { |
| 113 | header := ts_SMPP_hdr(c_SMPP_command_id_deliver_sm_resp, status, seq), |
| 114 | body := { |
| 115 | deliver_sm_resp := { |
| 116 | message_id := "", /* unused */ |
| 117 | opt_pars := omit |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | |
Harald Welte | f640a01 | 2018-04-14 17:49:21 +0200 | [diff] [blame] | 122 | template (value) SMPP_PDU ts_SMPP_SUBMIT_SM(SMPP_SM sm) := { |
| 123 | header := ts_SMPP_hdr(c_SMPP_command_id_submit_sm, ESME_ROK), |
| 124 | body := { |
| 125 | submit_sm := sm |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | /* Section 5.2.12 esm_class */ |
| 130 | template SMPP_BIT1 tr_ESM_CLASS_DEFAULT := '??????00'B; |
| 131 | template SMPP_BIT1 tr_ESM_CLASS_DATAGRAM := '??????01'B; |
| 132 | template SMPP_BIT1 tr_ESM_CLASS_TRANSACTION := '??????10'B; |
| 133 | template SMPP_BIT1 tr_ESM_CLASS_STORE_FORWARD := '??????11'B; |
| 134 | template SMPP_BIT1 tr_ESM_CLASS_UDHI := '?1??????'B; |
| 135 | template SMPP_BIT1 tr_ESM_CLASS_REPLYP_PATH := '1???????'B; |
| 136 | |
Harald Welte | 32ff8b9 | 2018-04-14 10:57:41 +0200 | [diff] [blame] | 137 | |
| 138 | |
| 139 | |
| 140 | } |