Browse code

xhttp: kemi funtion to return $hu - http uri

Daniel-Constantin Mierla authored on 25/12/2020 19:00:49
Showing 1 changed files
... ...
@@ -513,6 +513,28 @@ int bind_xhttp(xhttp_api_t *api)
513 513
 	return 0;
514 514
 }
515 515
 
516
+/**
517
+ *
518
+ */
519
+static sr_kemi_xval_t _sr_kemi_xhttp_xval = {0};
520
+
521
+/**
522
+ *
523
+ */
524
+static sr_kemi_xval_t* ki_xhttp_get_hu(sip_msg_t *msg)
525
+{
526
+	memset(&_sr_kemi_xhttp_xval, 0, sizeof(sr_kemi_xval_t));
527
+
528
+	if(msg==NULL) {
529
+		sr_kemi_xval_null(&_sr_kemi_xhttp_xval, SR_KEMI_XVAL_NULL_EMPTY);
530
+		return &_sr_kemi_xhttp_xval;
531
+	}
532
+
533
+	_sr_kemi_xhttp_xval.vtype = SR_KEMIP_STR;
534
+	_sr_kemi_xhttp_xval.v.s = msg->first_line.u.request.uri;
535
+	return &_sr_kemi_xhttp_xval;
536
+}
537
+
516 538
 /**
517 539
  *
518 540
  */
... ...
@@ -523,6 +545,11 @@ static sr_kemi_t sr_kemi_xhttp_exports[] = {
523 545
 		{ SR_KEMIP_INT, SR_KEMIP_STR, SR_KEMIP_STR,
524 546
 			SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE }
525 547
 	},
548
+	{ str_init("xhttp"), str_init("get_hu"),
549
+		SR_KEMIP_XVAL, ki_xhttp_get_hu,
550
+		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
551
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
552
+	},
526 553
 
527 554
 	{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
528 555
 };