|
@@ -0,0 +1,78 @@
|
|
|
+#!KAMAILIO
|
|
|
+
|
|
|
+children=1
|
|
|
+
|
|
|
+loadmodule "kex.so"
|
|
|
+loadmodule "jsonrpcs.so"
|
|
|
+loadmodule "tm.so"
|
|
|
+loadmodule "tmx.so"
|
|
|
+loadmodule "sl.so"
|
|
|
+loadmodule "rr.so"
|
|
|
+loadmodule "pv.so"
|
|
|
+loadmodule "textops.so"
|
|
|
+loadmodule "usrloc.so"
|
|
|
+loadmodule "registrar.so"
|
|
|
+loadmodule "xlog.so"
|
|
|
+
|
|
|
+modparam("jsonrpcs", "pretty_format", 1)
|
|
|
+
|
|
|
+modparam("registrar", "xavp_rcd", "rcd")
|
|
|
+
|
|
|
+include_file "kamailio-tregxx0001-inc.cfg"
|
|
|
+
|
|
|
+request_route {
|
|
|
+ route(REGISTRAR);
|
|
|
+ route(LOCATION);
|
|
|
+ exit;
|
|
|
+}
|
|
|
+
|
|
|
+route[REGISTRAR] {
|
|
|
+ if (!is_method("REGISTER")) return;
|
|
|
+ xlog("registrar: $ru\n");
|
|
|
+ if (!save("location")) {
|
|
|
+ sl_reply_error();
|
|
|
+ }
|
|
|
+ route(CHECK);
|
|
|
+ exit;
|
|
|
+}
|
|
|
+
|
|
|
+route[LOCATION] {
|
|
|
+ if (!is_method("MESSAGE")) return;
|
|
|
+ if (!lookup("location", "sip:[email protected]:5066")) {
|
|
|
+ $var(rc) = $rc;
|
|
|
+ t_newtran();
|
|
|
+ switch ($var(rc)) {
|
|
|
+ case -1:
|
|
|
+ case -3:
|
|
|
+ send_reply("404", "Not Found");
|
|
|
+ exit;
|
|
|
+ case -2:
|
|
|
+ send_reply("405", "Method Not Allowed");
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ send_reply("200", "OK");
|
|
|
+ }
|
|
|
+ route(CHECK);
|
|
|
+ return;
|
|
|
+}
|
|
|
+
|
|
|
+route[CHECK] {
|
|
|
+ pv_xavp_print();
|
|
|
+ if(pv_isset("$xavp(rcd[0]=>ruid)")) {
|
|
|
+ xlog("check[$rm]: ruid exists\n");
|
|
|
+ }
|
|
|
+ if(pv_isset("$xavp(rcd[0]=>contact)")) {
|
|
|
+ xlog("check[$rm]: contact exists\n");
|
|
|
+ }
|
|
|
+ if(pv_isset("$xavp(rcd[0]=>expires)")) {
|
|
|
+ xlog("check[$rm]: expires exists\n");
|
|
|
+ }
|
|
|
+ if(pv_isset("$xavp(rcd[0]=>received)")) {
|
|
|
+ xlog("check[$rm]: received exists\n");
|
|
|
+ }
|
|
|
+ if(pv_isset("$xavp(rcd[0]=>path)")) {
|
|
|
+ xlog("check[$rm]: path exists\n");
|
|
|
+ }
|
|
|
+ return;
|
|
|
+}
|