blob: 2ff675dde36fbd6380cd207da01ad75814f13e5d [file] [log] [blame]
Harald Welte32ff8b92018-04-14 10:57:41 +02001module SMPP_Templates {
2
3import from General_Types all;
4import from SMPP_Types all;
5
6template (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}
13template 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
21template (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}
26template 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
35template (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}
41template 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
48template (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
56template (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}
62template 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
69template (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
77template (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}
83template 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
90template (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
98template (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
105template (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
112template (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 Weltef640a012018-04-14 17:49:21 +0200122template (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 */
130template SMPP_BIT1 tr_ESM_CLASS_DEFAULT := '??????00'B;
131template SMPP_BIT1 tr_ESM_CLASS_DATAGRAM := '??????01'B;
132template SMPP_BIT1 tr_ESM_CLASS_TRANSACTION := '??????10'B;
133template SMPP_BIT1 tr_ESM_CLASS_STORE_FORWARD := '??????11'B;
134template SMPP_BIT1 tr_ESM_CLASS_UDHI := '?1??????'B;
135template SMPP_BIT1 tr_ESM_CLASS_REPLYP_PATH := '1???????'B;
136
Harald Welte32ff8b92018-04-14 10:57:41 +0200137
138
139
140}