Browse code

smsops: support for 7bit special chars

- Added support for 7bit special chars
for MO/MT SMSs.

(cherry picked from commit f82c4775efca0580401f4b1a48dcb4d2cf26814f)

Aleksandar Yosifov authored on 02/06/2021 07:02:53 • Daniel-Constantin Mierla committed on 10/06/2021 10:28:34
Showing 1 changed files
... ...
@@ -183,29 +183,170 @@ void freeRP_DATA(sms_rp_data_t * rpdata) {
183 183
 #define BITMASK_TP_VPF_ENHANCED 0x08
184 184
 #define BITMASK_TP_VPF_ABSOLUTE 0x18
185 185
 
186
+#define GSM7BIT_ESCAPE	0x1B
187
+
188
+static unsigned char gsm7bit_codes[128] = {
189
+0x40,0xA3,0x24,0xA5,0x65,0x65,0xF9,0xEC,
190
+0x6F,0x43,0x0A,0x4F,0x6F,0x0D,0x41,0x61,
191
+0xFF,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
192
+0xFF,0xFF,0xFF,0x1B,0xC6,0xE6,0xDF,0x45,
193
+0x20,0x21,0x22,0x23,0xA4,0x25,0x26,0x27,
194
+0x28,0X29,0x2A,0x2B,0x2C,0xAD,0x2E,0x2F,
195
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,
196
+0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
197
+0xA1,0x41,0x42,0x43,0x44,0x45,0x46,0x47,
198
+0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
199
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,
200
+0x58,0x59,0x5A,0x41,0x4F,0x4E,0x55,0xA7,
201
+0xBF,0x61,0x62,0x63,0x64,0x65,0x66,0x67,
202
+0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
203
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,
204
+0x78,0x79,0x7A,0x61,0x6F,0x6E,0x75,0x61
205
+};
206
+
207
+static unsigned char gsm7bit_ext_codes[128] = {
208
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
209
+0xFF,0xFF,0x0C,0xFF,0xFF,0xFF,0xFF,0xFF,
210
+0xFF,0xFF,0xFF,0xFF,0x5E,0xFF,0xFF,0xFF,
211
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
212
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
213
+0x7B,0x7D,0xFF,0xFF,0xFF,0xFF,0xFF,0x5C,
214
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
215
+0xFF,0xFF,0xFF,0xFF,0x5B,0x7E,0x5D,0xFF,
216
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
217
+0x7C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
218
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
219
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
220
+0xFF,0xFF,0xFF,0xFF,0xFF,0x45,0xFF,0xFF,
221
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
222
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
223
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
224
+};
225
+
226
+static unsigned char ascii2gsm7bit_codes[256] = {
227
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 07
228
+0xFF,0xFF,0x0A,0xFF,0x1B,0x0D,0xFF,0xFF, // 15
229
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 23
230
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 31
231
+0x20,0x21,0x22,0x23,0x02,0x25,0x26,0x27, // 39
232
+0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, // 47
233
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37, // 55
234
+0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, // 63
235
+0x00,0x41,0x42,0x43,0x44,0x45,0x46,0x47, // 71
236
+0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, // 79
237
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57, // 87
238
+0x58,0x59,0x5A,0x1B,0x1B,0x1B,0x1B,0x11, // 95
239
+0xFF,0x61,0x62,0x63,0x64,0x65,0x66,0x67, // 103
240
+0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, // 111
241
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77, // 119
242
+0x78,0x79,0x7A,0x1B,0x1B,0x1B,0x1B,0xFF, // 127
243
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 135
244
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 143
245
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 151
246
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 159
247
+0xFF,0x40,0xFF,0x01,0x23,0x03,0xFF,0x5F, // 167
248
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 175
249
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 183
250
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x60, // 191
251
+0xFF,0xFF,0xFF,0xFF,0x5B,0x0E,0x1C,0x09, // 199
252
+0xFF,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 207
253
+0xFF,0x5D,0xFF,0xFF,0xFF,0xFF,0x5C,0xFF, // 215
254
+0x0B,0xFF,0xFF,0xFF,0x5E,0xFF,0xFF,0x1E, // 223
255
+0x7F,0xFF,0xFF,0xFF,0x7B,0x0F,0x1D,0xFF, // 231
256
+0x04,0x05,0xFF,0xFF,0x07,0xFF,0xFF,0xFF, // 239
257
+0xFF,0x7D,0x08,0xFF,0xFF,0xFF,0x7C,0xFF, // 247
258
+0x0C,0x06,0xFF,0xFF,0x7E,0xFF,0xFF,0xFF, // 255
259
+};
260
+
261
+static unsigned char ascii2gsm7bit_ext_codes[256] = {
262
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 07
263
+0xFF,0xFF,0xFF,0xFF,0x0A,0xFF,0xFF,0xFF, // 15
264
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 23
265
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 31
266
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 39
267
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 47
268
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 55
269
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 63
270
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 71
271
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 79
272
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 87
273
+0xFF,0xFF,0xFF,0x3C,0x2F,0x3E,0x14,0xFF, // 95
274
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 103
275
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 111
276
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 119
277
+0xFF,0xFF,0xFF,0x28,0x40,0x29,0x3D,0xFF, // 127
278
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 135
279
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 143
280
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 151
281
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 159
282
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 167
283
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 175
284
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 183
285
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 191
286
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 199
287
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 207
288
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 215
289
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 223
290
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 231
291
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 239
292
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 247
293
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // 255
294
+};
295
+
186 296
 // Encode SMS-Message by merging 7 bit ASCII characters into 8 bit octets.
187
-static int ascii_to_gsm(str sms, char * output_buffer, int buffer_size) {
297
+static int ascii_to_gsm(str sms, char * output_buffer, int buffer_size, int* output_text_size, unsigned char paddingBits) {
188 298
 	// Check if output buffer is big enough.
189 299
 	if ((sms.len * 7 + 7) / 8 > buffer_size)
190
-		return -1;
300
+		return 0;
191 301
 
192 302
 	int output_buffer_length = 0;
193
-	int carry_on_bits = 1;
303
+	int carry_on_bits = 0;
194 304
 	int i = 0;
305
+	unsigned char symbol;
306
+	int out_size = 0;
307
+	char* tmp_buff = (char*)pkg_malloc(sms.len * 2);
308
+
309
+	if(tmp_buff == NULL) {
310
+		LM_ERR("Error allocating memory to encode sms text\n");
311
+		return -1;
312
+	}
313
+
314
+	memset(tmp_buff, 0, sms.len * 2);
195 315
 
196 316
 	for (; i < sms.len; ++i) {
197
-		output_buffer[output_buffer_length++] =
198
-			((sms.s[i] & BITMASK_7BITS) >> (carry_on_bits - 1)) |
199
-			((sms.s[i + 1] & BITMASK_7BITS) << (8 - carry_on_bits));
200
-		carry_on_bits++;
201
-		if (carry_on_bits == 8) {
202
-			carry_on_bits = 1;
203
-			++i;
317
+		if(ascii2gsm7bit_codes[(unsigned char)sms.s[i]] == GSM7BIT_ESCAPE) {
318
+			tmp_buff[out_size++] = GSM7BIT_ESCAPE;
319
+			tmp_buff[out_size++] = ascii2gsm7bit_ext_codes[(unsigned char)sms.s[i]];
320
+		} else {
321
+			tmp_buff[out_size++] = ascii2gsm7bit_codes[(unsigned char)sms.s[i]];
322
+		}
323
+	}
324
+
325
+	*output_text_size = out_size;
326
+
327
+	if (paddingBits) {
328
+		carry_on_bits = 7 - paddingBits;
329
+ 		output_buffer[output_buffer_length++] = tmp_buff[0] << (7 - carry_on_bits);
330
+ 		carry_on_bits++;
331
+	}
332
+
333
+	for (i = 0; i < out_size; ++i) {
334
+		if (carry_on_bits == 7) {
335
+			carry_on_bits = 0;
336
+			continue;
337
+		}
338
+
339
+		symbol = (tmp_buff[i] & BITMASK_7BITS) >> carry_on_bits;
340
+
341
+		if (i < out_size - 1) {
342
+			symbol |= tmp_buff[i + 1] << (7 - carry_on_bits);
204 343
 		}
344
+
345
+		output_buffer[output_buffer_length++] = symbol;
346
+		carry_on_bits++;
205 347
 	}
206 348
 
207
-	if (i < sms.len)
208
-		output_buffer[output_buffer_length++] =	(sms.s[i] & BITMASK_7BITS) >> (carry_on_bits - 1);
349
+	pkg_free(tmp_buff);
209 350
 
210 351
 	return output_buffer_length;
211 352
 }
... ...
@@ -214,7 +355,7 @@ static int ascii_to_gsm(str sms, char * output_buffer, int buffer_size) {
214 355
 int gsm_to_ascii(char* buffer, int buffer_length, str sms, const int fill_bits) {
215 356
 		int output_text_length = 0;
216 357
 
217
-		if(buffer_length <= 2)
358
+		if(!buffer_length || (fill_bits && buffer_length < 2))
218 359
 			return 0;
219 360
 
220 361
 		// How many bits we have carried from the next octet. This number can be positive or negative:
... ...
@@ -224,7 +365,10 @@ int gsm_to_ascii(char* buffer, int buffer_length, str sms, const int fill_bits)
224 365
 		int carry_on_bits = 0;
225 366
 
226 367
 		// Used to iterate over buffer. Declared here, because if there are fill_bits it have to be incremented
227
-		int i = 0;
368
+		int i = 0, num_bytes = 0;
369
+
370
+		unsigned char symbol;
371
+		unsigned char isEscape = 0; 
228 372
 
229 373
 		// First remove the fill bits, if any
230 374
 		if(fill_bits) {
... ...
@@ -234,13 +378,20 @@ int gsm_to_ascii(char* buffer, int buffer_length, str sms, const int fill_bits)
234 378
 			// cmask stands for carry mask or how many bits to carry from the 2nd octet
235 379
 			unsigned char cmask = (1 << (fill_bits - 1)) - 1;
236 380
 
237
-			sms.s[output_text_length++] = ( (buffer[0] >> fill_bits) |	// remove the fill bits from the first octet
381
+			symbol = ( (buffer[0] >> fill_bits) |	// remove the fill bits from the first octet
238 382
 											(buffer[1] & cmask << (8 - fill_bits)) // mask the required number of bits
239 383
 																					//and shift them accordingly
240 384
 										) & BITMASK_7BITS;	// mask just 7 bits from the first octet
241 385
 
386
+			if (symbol != GSM7BIT_ESCAPE) {
387
+				sms.s[output_text_length++] = gsm7bit_codes[symbol];
388
+			}else{
389
+				isEscape = 1;
390
+			}
391
+
242 392
 			carry_on_bits = fill_bits - 1;
243 393
 			i++;
394
+			num_bytes++;
244 395
 		}
245 396
 
246 397
 
... ...
@@ -248,7 +399,7 @@ int gsm_to_ascii(char* buffer, int buffer_length, str sms, const int fill_bits)
248 399
 			if(carry_on_bits > 0) {
249 400
 				unsigned char cmask = (1 << (carry_on_bits - 1)) - 1;	//mask for the rightmost carry_on_bits
250 401
 																		//E.g. carry_on_bits=3 -> _ _ _ _ _ X X X
251
-				sms.s[output_text_length++] = ( (buffer[i] >> carry_on_bits) | //shift right to remove carried bits
402
+				symbol = ( (buffer[i] >> carry_on_bits) | //shift right to remove carried bits
252 403
 												(buffer[i+1] & cmask) << (8 - carry_on_bits)	// carry from the next
253 404
 																								// and shift accordingly
254 405
 												) & BITMASK_7BITS;	// mask just 7 bits from the first octet
... ...
@@ -257,7 +408,7 @@ int gsm_to_ascii(char* buffer, int buffer_length, str sms, const int fill_bits)
257 408
 				carry_on_bits = carry_on_bits * -1;	//make carry_on_bits positive for the bitwise ops
258 409
 				unsigned char cmask = ((1 << carry_on_bits) - 1) << (8 - carry_on_bits);	//mask for the leftmost carry_on_bits.
259 410
 																						//E.g. carry_on_bits=3 -> X X X _ _ _ _ _
260
-				sms.s[output_text_length++] = ( (buffer[i] << carry_on_bits) | //shift left to make space for the carried bits
411
+				symbol = ( (buffer[i] << carry_on_bits) | //shift left to make space for the carried bits
261 412
 												(buffer[i-1] & cmask) >> (8 - carry_on_bits)	// get the bits from the previous octet
262 413
 																								// and shift accordingly
263 414
 												) & BITMASK_7BITS;	// mask just 7 bits from the first octet
... ...
@@ -265,18 +416,43 @@ int gsm_to_ascii(char* buffer, int buffer_length, str sms, const int fill_bits)
265 416
 				carry_on_bits = carry_on_bits * -1;	//return the original value
266 417
 			}
267 418
 			else {// carry_on_bits == 0
268
-				sms.s[output_text_length++] = buffer[i] & BITMASK_7BITS;
419
+				symbol = buffer[i] & BITMASK_7BITS;
420
+			}
421
+
422
+			if (isEscape) {
423
+				isEscape = 0;
424
+
425
+				sms.s[output_text_length++] = gsm7bit_ext_codes[symbol];
426
+			} else {
427
+				if (symbol != GSM7BIT_ESCAPE) {
428
+					sms.s[output_text_length++] = gsm7bit_codes[symbol];
429
+				} else {
430
+					isEscape = 1;
431
+				}
269 432
 			}
270 433
 
271 434
 			//Update carry_on bits. It is always decremented, because we iterate over octests but read just septets
272 435
 			carry_on_bits--;
273 436
 
274
-			if (output_text_length == sms.len) break;
437
+			if (++num_bytes == sms.len) break;
275 438
 
276 439
 			if (carry_on_bits == -8) {
277 440
 				carry_on_bits = -1;
278
-				sms.s[output_text_length++] = buffer[i] & BITMASK_7BITS;
279
-				if (output_text_length == sms.len) break;
441
+				symbol = buffer[i] & BITMASK_7BITS;
442
+
443
+				if (isEscape) {
444
+					isEscape = 0;
445
+
446
+					sms.s[output_text_length++] = gsm7bit_ext_codes[symbol];
447
+				} else {
448
+					if (symbol != GSM7BIT_ESCAPE) {
449
+						sms.s[output_text_length++] = gsm7bit_codes[symbol];
450
+					} else {
451
+						isEscape = 1;
452
+					}
453
+				}
454
+
455
+				if (++num_bytes == sms.len) break;
280 456
 			}
281 457
 
282 458
 			if(carry_on_bits > 0 && (i + 2 >= buffer_length)) {
... ...
@@ -286,8 +462,11 @@ int gsm_to_ascii(char* buffer, int buffer_length, str sms, const int fill_bits)
286 462
 			}
287 463
 		}
288 464
 
289
-		if (output_text_length < sms.len)  // Add last remainder.
290
-			sms.s[output_text_length++] = buffer[i - 1] >> (8 - carry_on_bits);
465
+		if (num_bytes < sms.len) { // Add last remainder.
466
+			symbol = buffer[i - 1] >> (8 - carry_on_bits);
467
+
468
+			sms.s[output_text_length++] = gsm7bit_codes[symbol];
469
+		}
291 470
 
292 471
 		return output_text_length;
293 472
 }
... ...
@@ -801,6 +980,8 @@ int pv_sms_body(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) {
801 980
 
802 981
 	str sms_body = {0, 0};
803 982
 	int buffer_size = 1024, lenpos = 0, i = 0, smstext_len_pos = 0;
983
+	unsigned char udh_len = 0;
984
+	struct ie_concat_sm_8bit_ref* concat = NULL;
804 985
 
805 986
 	// We assume a maximum size of 1024 Bytes, to be verified.
806 987
 	sms_body.s = (char*)pkg_malloc(buffer_size);
... ...
@@ -850,10 +1031,29 @@ int pv_sms_body(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) {
850 1031
 	smstext_len_pos = sms_body.len;
851 1032
 	sms_body.s[sms_body.len++] = rp_send_data->pdu.payload.sm.len;
852 1033
 
1034
+	// Check for UDH
1035
+	concat = GetConcatShortMsg8bitRefIE(rp_send_data);
1036
+	if(concat->max_num_sm && concat->seq) {
1037
+		sms_body.s[sms_body.len++] = 5; // always 5 for TP_UDH_IE_CONCAT_SM_8BIT_REF
1038
+		sms_body.s[sms_body.len++] = TP_UDH_IE_CONCAT_SM_8BIT_REF;
1039
+		sms_body.s[sms_body.len++] = 3; // always 3 for TP_UDH_IE_CONCAT_SM_8BIT_REF
1040
+		sms_body.s[sms_body.len++] = concat->ref;
1041
+		sms_body.s[sms_body.len++] = concat->max_num_sm;
1042
+		sms_body.s[sms_body.len++] = concat->seq;
1043
+		udh_len = 6;
1044
+	}
1045
+
853 1046
 	// Coding: 7 Bit
854 1047
 	if (rp_send_data->pdu.coding == 0x00) {
855
-		i = ascii_to_gsm(rp_send_data->pdu.payload.sm, &sms_body.s[sms_body.len], buffer_size - sms_body.len);
1048
+		int actual_text_size = 0;
1049
+		unsigned char paddingBits = (udh_len * 8 ) % 7;
1050
+		if (paddingBits) {
1051
+			paddingBits = 7 - paddingBits; 
1052
+		}
1053
+
1054
+		i = ascii_to_gsm(rp_send_data->pdu.payload.sm, &sms_body.s[sms_body.len], buffer_size - sms_body.len, &actual_text_size, paddingBits);
856 1055
 		sms_body.len += i;
1056
+		sms_body.s[smstext_len_pos] = actual_text_size + udh_len;
857 1057
 	} else {
858 1058
 	// Coding: ucs2
859 1059
 		int i, ucs2, ucs2len = 0;
... ...
@@ -876,7 +1076,7 @@ int pv_sms_body(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) {
876 1076
 		}
877 1077
 
878 1078
 		// Update the sms text len
879
-		sms_body.s[smstext_len_pos] = (unsigned char)ucs2len;
1079
+		sms_body.s[smstext_len_pos] = (unsigned char)ucs2len + udh_len;
880 1080
 	}
881 1081
 
882 1082
 	// Update the len of the PDU
... ...
@@ -1176,7 +1376,7 @@ int pv_set_sms(struct sip_msg* msg, pv_param_t *param, int op, pv_value_t *val)
1176 1376
 				LM_ERR("Invalid type\n");
1177 1377
 				return -1;
1178 1378
 			}
1179
-			struct ie_concat_sm_8bit_ref* concat = GetConcatShortMsg8bitRefIE(rp_data);
1379
+			struct ie_concat_sm_8bit_ref* concat = GetConcatShortMsg8bitRefIE(rp_send_data);
1180 1380
 			if(concat == NULL)
1181 1381
 				return -1;
1182 1382
 
... ...
@@ -1190,7 +1390,7 @@ int pv_set_sms(struct sip_msg* msg, pv_param_t *param, int op, pv_value_t *val)
1190 1390
 				LM_ERR("Invalid type\n");
1191 1391
 				return -1;
1192 1392
 			}
1193
-			struct ie_concat_sm_8bit_ref* concat = GetConcatShortMsg8bitRefIE(rp_data);
1393
+			struct ie_concat_sm_8bit_ref* concat = GetConcatShortMsg8bitRefIE(rp_send_data);
1194 1394
 			if(concat == NULL)
1195 1395
 				return -1;
1196 1396
 
... ...
@@ -1204,7 +1404,7 @@ int pv_set_sms(struct sip_msg* msg, pv_param_t *param, int op, pv_value_t *val)
1204 1404
 				LM_ERR("Invalid type\n");
1205 1405
 				return -1;
1206 1406
 			}
1207
-			struct ie_concat_sm_8bit_ref* concat = GetConcatShortMsg8bitRefIE(rp_data);
1407
+			struct ie_concat_sm_8bit_ref* concat = GetConcatShortMsg8bitRefIE(rp_send_data);
1208 1408
 			if(concat == NULL)
1209 1409
 				return -1;
1210 1410