浏览代码

CPL module added

Bogdan-Andrei Iancu 23 年之前
父节点
当前提交
c826bba653
共有 1 个文件被更改,包括 22 次插入3 次删除
  1. 22 3
      test/th-uri.cfg

+ 22 - 3
test/th-uri.cfg

@@ -5,7 +5,7 @@
 #
 
 
-debug=3          # debug level (cmd line: -dddddddddd)
+debug=9          # debug level (cmd line: -dddddddddd)
 #fork=yes          # (cmd. line: -D)
 fork=no
 log_stderror=yes # (cmd line: -E)
@@ -18,8 +18,8 @@ dns=on           # (cmd. line: -r)
 rev_dns=yes      # (cmd. line: -R)
 #port=5070
 #listen=127.0.0.1
-listen=192.168.57.33
-loop_checks=0
+#listen=192.168.57.33
+#loop_checks=0
 # for more info: sip_router -h
 
 #modules
@@ -27,6 +27,7 @@ loop_checks=0
 loadmodule "modules/tm/tm.so"
 loadmodule "modules/rr/rr.so"
 loadmodule "modules/maxfwd/maxfwd.so"
+loadmodule "modules/cpl/cpl.so"
 
 
 route{
@@ -45,6 +46,24 @@ route{
                    mf_add_maxfwd_header( "10" );
              };
 
+             if (method=="INVITE")
+             {
+                log("SER : runing CPL!! :)\n");
+                if ( !cpl_run_script() )
+                {
+                   log("SER : Error during running CPL script!\n");
+                }else{
+                   if ( cpl_is_response_reject() )
+                   {
+                       t_add_transaction();
+                       t_send_reply("486","I am not available!");
+                       drop();
+                   }else if ( cpl_is_response_redirect() ) {
+                         log("SER : redirect\n");
+                   };
+                };
+             };
+
              #if ( !rewriteFromRoute() )
              #{
                 log( " SER : no route found!\n");