[sr-dev] git:master:f7c2c4db: misc/examples: tunings to sqlang kemi script

Daniel-Constantin Mierla miconda at gmail.com
Fri Jun 9 12:59:26 CEST 2017


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-06-09T12:56:26+02:00

misc/examples: tunings to sqlang kemi script

---

Modified: misc/examples/kemi/kamailio-basic-kemi-sqlang.sq

---

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

---

diff --git a/misc/examples/kemi/kamailio-basic-kemi-sqlang.sq b/misc/examples/kemi/kamailio-basic-kemi-sqlang.sq
index 9eda6a9a30..8618ef68a0 100644
--- a/misc/examples/kemi/kamailio-basic-kemi-sqlang.sq
+++ b/misc/examples/kemi/kamailio-basic-kemi-sqlang.sq
@@ -14,13 +14,15 @@ local FLAGS = {
 	FLB_NATSIPPING=7
 }
 
+// local sipscanregex = regexp("friendly-scanner|sipcli");
+
 // SIP request routing
 // equivalent of request_route{}
 function ksr_request_route()
 {
 	local METHOD = KSR.pv.get("$rm");
 	// KSR.sl.sl_send_reply(100,"Intelligent trying");
-	// KSR.info("===== request - from kamailio lua script\n");
+	// KSR.info("===== request - from kamailio SQLang script\n");
 
 	// per request initial checks
 	ksr_route_reqinit();
@@ -135,7 +137,8 @@ function ksr_route_reqinit()
 	}
 	if (!KSR.pv.is_null("$ua")) {
 		local UA = KSR.pv.get("$ua");
-		if (UA.indexOf("friendly-scanner")>=0 || UA.indexOf("sipcli")>=0) {
+		// if (sipscanregex.match(UA)) {
+		if (UA.find("friendly-scanner")!=null || UA.find("sipcli")!=null) {
 			KSR.sl.sl_send_reply(200, "OK");
 			KSR.x.exit();
 		}
@@ -343,7 +346,7 @@ function ksr_route_sipout()
 // equivalent of branch_route[...]{}
 function ksr_branch_manage()
 {
-	KSR.dbg("new branch [" + KSR.pv.get("$T_branch_idx]")
+	KSR.dbg("new branch [" + KSR.pv.get("$T_branch_idx")
 				+ " to " + KSR.pv.get("$ru") + "\n");
 	ksr_route_natmanage();
 	return;
@@ -377,6 +380,6 @@ function ksr_failure_manage()
 // equivalent of reply_route{}
 function ksr_reply_route()
 {
-	KSR.info("===== response - from kamailio JS script\n");
+	KSR.info("===== response - from kamailio SQLang script\n");
 	return;
 }




More information about the sr-dev mailing list