#
# configuration for TurboSIP testing
#
# $ID: $
#


debug=3          # debug level (cmd line: -dddddddddd)
#fork=yes          # (cmd. line: -D)
fork=no
log_stderror=yes # (cmd line: -E)
#log_stderror=no	# (cmd line: -E)


children=4
check_via=no     # (cmd. line: -v)
dns=off           # (cmd. line: -r)
rev_dns=off      # (cmd. line: -R)
#port=5070
#listen=10.0.0.179
listen=192.168.57.33
loop_checks=0
# for more info: sip_router -h

#modules
#loadmodule "modules/print/print.so"
loadmodule "modules/tm/tm.so"
#loadmodule "modules/rr/rr.so"
loadmodule "modules/maxfwd/maxfwd.so"
#loadmodule "modules/sl/sl.so"


route{

             if ( mf_is_maxfwd_present() )
             {
                   if ( !mf_decrement_maxfwd() )
                   {
                     log("SER : unable to decrement MAX_FORWARD!\n");
                   };
                   if ( mf_is_maxfwd_zero() )
                   {
                     log("SER: MAX FORWARD header is zero\n");
                     drop();
                   };
             }else{
                   mf_add_maxfwd_header( "10" );
             };


             #if (method=="INVITE")
             #{
                 #sl_send_reply("404","Not found");
                 #drop();
              #  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");
                #if ( method=="INVITE" )
                #{
                  # log ("SER : INVITE found - > adding RecordRoute!\n");
                   #addRecordRoute();
                #};
             #}
             #else
             #{
                #log( "SER : ROUTE found! \n");
             #};

             t_relay();
}