# do not return the Server: header field in a response server_signature=0 # do not return the Warning: header field in a response sip_warning=0 #listen= sctp:(10.36.2.56,10.36.2.58):5080 127.0.0.1 #listen=(eth0) #listen=___MY_IP___ #listen=___XMLRPC_IP___ alias="example.com" children=2 #loadmodule "modules/ctl/ctl.so" # ser xlog loadmodule "modules/xlog/xlog.so" loadmodule "modules/pv/pv.so" # k xlog #loadmodule "modules/x_xlog/xlog.so" #modparam("ctl", "binrpc", "tcp:3012") # tcp any , port 3012 #modparam("ctl", "binrpc", "udp:*:3012") # udp any , port 3012 disable_tls=0 memlog=1 memdbg=100 # disable verbose mallocs use_dns_cache=on dns_try_naptr=on use_dst_blacklist=on tcp_defer_accept=10 tcp_syncnt=1 route { xlog("L_ALERT", "plain string" " test\n"); $avp(fu.stest)="avp_test1"; xlog("L_ALERT", "1. avp %$fu.stest \n"); $fu.stest="test2_" + "avp_test2"; $avp(tmp)="tmp_"+$fu.stest; xlog("L_ALERT", "2. avp fu.stest=%$fu.stest , tmp=%$tmp\n"); if ($tmp!="tmp_"+$fu.stest || "test2_avp_test2"!=$fu.stest || $tmp!="tmp_test2_avp_test2") xlog("L_CRIT", "BUG: sanity check 1 failed: fu.stest=%$fu.stest ," " tmp=%$tmp\n"); $iavp=1+2+3+4+5; $fu.stest=($fu.stest+$iavp)+"-"+1; if ($iavp!=15 || $fu.stest!="test2_avp_test215-1") xlog("L_CRIT", "BUG: sanity check 2 failed: $iavp=%$iavp ," " $fu.stest=%$fu.stest\n"); $(var(foo))=$iavp+100; xlog("L_ALERT", "%%$iavp= %$iavp \n"); xlog("L_ALERT", "%%$f.iavp= %$f.iavp \n"); xlog("L_ALERT", "%%$fr.iavp= %$fr.iavp \n"); xlog("L_ALERT", "%%$fu.iavp= %$fu.iavp \n"); xlog("L_ALERT", "3. avp %$fu.stest \n"); if (2+1>0+1) xlog("L_ALERT", "IF1\n"); if ($iavp>($iavp-1)) xlog("L_ALERT", "IF2\n"); if (($iavp=-1+$iavp)<2) xlog("L_ALERT", "IF3, %%$iavp = %$iavp\n"); if ($tmp=="tmp_test2_avp_test2") xlog("L_ALERT", "IF4, %%$tmp = %$tmp\n"); else xlog("L_ALERT", "ELSEIF4 if failed: %%$tmp = %$tmp\n"); $tmp="host="+@ruri.host; xlog("L_ALERT", "uri: %$tmp\n"); if ($tmp+"xxx" == "host="+@ruri.host+"xxx") xlog("L_ALERT", "IF5 (select):tmp=\"%$tmp\"\n"); if (method=="INVITE") xlog("L_ALERT", "IF6 (method==INVITE)\n"); $tmp="INV"; if (method==$tmp+"ITE") xlog("L_ALERT", "IF7 (method==%$tmp)\n"); if (method=="INVITE" !=0 ) xlog("L_ALERT", "IF8 (method==INVITE !=0)\n"); $tmp=$tmp+"I"+"T"+"E"; if (method==$tmp) xlog("L_ALERT", "IF9 (method==%$tmp)\n"); if (method=="I"+"NV"+"ITE") xlog("L_ALERT", "IF10\n"); # more optimizations tests $var(x)=$iavp; $iavp2=1+$var(x)+2+3; $iavp=1+2+3+$iavp; $iavp3=(2+1)*$iavp*(1+1)-20; $iavp4=$iavp-5-10; $iavp6=(1+4)+($iavp+5); $iavp5=(3+3)+(4+$(avp(iavp)) ); xlog("L_ALERT", "$iavp=%$iavp $iavp2=%$iavp2 $iavp3=%$iavp3" " $iavp4=%$iavp4 $iavp5=%$iavp5 $iavp6=%$iavp6\n"); drop; }