[sr-dev] git:master:cbaeb436: Revert "sl: new pv $ltt(key) - return local generated to tag"

Daniel-Constantin Mierla miconda at gmail.com
Wed Oct 10 12:02:16 CEST 2018


Module: kamailio
Branch: master
Commit: cbaeb4361b512a3bb8525bb3f628894dbea495f5
URL: https://github.com/kamailio/kamailio/commit/cbaeb4361b512a3bb8525bb3f628894dbea495f5

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-10-10T12:01:22+02:00

Revert "sl: new pv $ltt(key) - return local generated to tag"

This reverts commit 5d0494f9444b73a639a90c4ff2da933fb2d11d5d.

- mistakenly pushed in master, not personal branch

---

Modified: src/modules/sl/sl.c

---

Diff:  https://github.com/kamailio/kamailio/commit/cbaeb4361b512a3bb8525bb3f628894dbea495f5.diff
Patch: https://github.com/kamailio/kamailio/commit/cbaeb4361b512a3bb8525bb3f628894dbea495f5.patch

---

diff --git a/src/modules/sl/sl.c b/src/modules/sl/sl.c
index 36c8a8eec7..96c3fdfdf5 100644
--- a/src/modules/sl/sl.c
+++ b/src/modules/sl/sl.c
@@ -78,17 +78,6 @@ static int child_init(int rank);
 static void mod_destroy();
 static int fixup_sl_reply(void** param, int param_no);
 
-static int pv_get_ltt(sip_msg_t *msg, pv_param_t *param, pv_value_t *res);
-static int pv_parse_ltt_name(pv_spec_p sp, str *in);
-
-
-static pv_export_t mod_pvs[] = {
-	{ {"ltt", (sizeof("ltt")-1)}, PVT_OTHER, pv_get_ltt, 0,
-		pv_parse_ltt_name, 0, 0, 0 },
-
-	{ {0, 0}, 0, 0, 0, 0, 0, 0, 0 }
-};
-
 static cmd_export_t cmds[]={
 	{"sl_send_reply",  w_sl_send_reply,             2, fixup_sl_reply, 0,
 		REQUEST_ROUTE},
@@ -131,7 +120,7 @@ struct module_exports exports= {
 	cmds,				/* cmd (cfg function) exports */
 	params,			    /* param exports */
 	sl_rpc,			    /* RPC method exports */
-	mod_pvs,			/* pv exports */
+	0,					/* pv exports */
 	0,					/* response handling function */
 	mod_init,			/* module init function */
 	child_init,			/* per-child init function */
@@ -496,83 +485,6 @@ static int w_sl_forward_reply2(sip_msg_t* msg, char* str1, char* str2)
 	return w_sl_forward_reply(msg, &code, &reason);
 }
 
-/**
- *
- */
-static int pv_get_ltt(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
-{
-	str ttag = STR_NULL;
-	tm_cell_t *t = NULL;
-
-	if(msg==NULL)
-		return pv_get_null(msg, param, res);
-
-	if(param==NULL)
-		return pv_get_null(msg, param, res);
-
-	switch(param->pvn.u.isname.name.n) {
-		case 0: /* mixed */
-			if(get_reply_totag(msg, &ttag)<0) {
-				return pv_get_null(msg, param, res);
-			}
-			return pv_get_strval(msg, param, res, &ttag);
-		case 1: /* stateless */
-			if(sl_get_reply_totag(msg, &ttag)<0) {
-				return pv_get_null(msg, param, res);
-			}
-			return pv_get_strval(msg, param, res, &ttag);
-		case 2: /* transaction stateful */
-			if(sl_bind_tm==0 || tmb.t_gett==0) {
-				return pv_get_null(msg, param, res);
-			}
-
-			t = tmb.t_gett();
-			if(t== NULL || t==T_UNDEFINED) {
-				return pv_get_null(msg, param, res);
-			}
-			if(tmb.t_get_reply_totag(msg, &ttag)<0) {
-				return pv_get_null(msg, param, res);
-			}
-			return pv_get_strval(msg, param, res, &ttag);
-		default:
-			return pv_get_null(msg, param, res);
-	}
-}
-
-/**
- *
- */
-static int pv_parse_ltt_name(pv_spec_p sp, str *in)
-{
-	if(sp==NULL || in==NULL || in->len<=0)
-		return -1;
-
-	switch(in->len) {
-		case 1:
-			if(strncmp(in->s, "x", 1)==0) {
-				sp->pvp.pvn.u.isname.name.n = 0;
-			} else if(strncmp(in->s, "s", 1)==0) {
-				sp->pvp.pvn.u.isname.name.n = 1;
-			} else if(strncmp(in->s, "t", 1)==0) {
-				sp->pvp.pvn.u.isname.name.n = 2;
-			} else {
-				goto error;
-			}
-		break;
-		default:
-			goto error;
-	}
-	sp->pvp.pvn.type = PV_NAME_INTSTR;
-	sp->pvp.pvn.u.isname.type = 0;
-
-	return 0;
-
-error:
-	LM_ERR("unknown PV ltt key: %.*s\n", in->len, in->s);
-	return -1;
-}
-
-
 /**
  * @brief bind functions to SL API structure
  */




More information about the sr-dev mailing list