You should be seeing at least the output of "<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">xlog("L_DBG", "HTTP Request Received\n");", </span>if not, there's no http request arriving to the server. Try flushing iptables and disabling selinux. <div>
<br><div class="gmail_quote">On Thu, Aug 16, 2012 at 10:03 AM, Juan Castro <span dir="ltr"><<a href="mailto:jcastro@instant.com.br" target="_blank">jcastro@instant.com.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There's no "#!ifdef WITH_DEBUG" anywhere, and I have "debug=9" which<br>
didn't do any changes. Here's my current config:<br>
<div><div class="h5"><br>
------------------------------------------------------------<br>
#!KAMAILIO<br>
#<br>
# Simple/sample kamailio.cfg for running a proxy/registrar with TLS and<br>
# WebSockets support.<br>
<br>
#!substdef "!DBURL!mysql://ser:heslo@localhost/ser!g"<br>
#!substdef "!MY_IP_ADDR!192.168.0.148!g"<br>
#!substdef "!MY_WS_PORT!80!g"<br>
#!substdef "!MY_WSS_PORT!443!g"<br>
#!substdef "!MY_WS_ADDR!tcp:MY_IP_ADDR:MY_WS_PORT!g"<br>
#!substdef "!MY_WSS_ADDR!tls:MY_IP_ADDR:MY_WSS_PORT!g"<br>
<br>
##!define LOCAL_TEST_RUN<br>
#!define WITH_TLS<br>
#!define WITH_WEBSOCKETS<br>
<br>
####### Global Parameters #########<br>
<br>
fork=yes<br>
children=4<br>
<br>
#alias="<a href="http://example.com" target="_blank">example.com</a>"<br>
<br>
#!ifdef WITH_TLS<br>
enable_tls=1<br>
#!endif<br>
<br>
listen=MY_IP_ADDR<br>
#!ifdef WITH_WEBSOCKETS<br>
listen=MY_WS_ADDR<br>
#!ifdef WITH_TLS<br>
listen=MY_WSS_ADDR<br>
#!endif<br>
#!endif<br>
<br>
tcp_connection_lifetime=3604<br>
tcp_accept_no_cl=yes<br>
tcp_rd_buf_size=16384<br>
<br>
syn_branch=0<br>
</div></div>debug=9<br>
<div class="im"><br>
# set paths to location of modules (to sources or installation folders)<br>
#!ifdef WITH_SRCPATH<br>
mpath="modules_k:modules"<br>
#!else<br>
mpath="/usr/local/kamailio/lib/kamailio/modules_k/:/usr/local/kamailio/lib/kamailio/modules/"<br>
#!endif<br>
<br>
loadmodule "db_mysql.so"<br>
</div>loadmodule "mi_fifo.so"<br>
<div><div class="h5">loadmodule "tm.so"<br>
loadmodule "sl.so"<br>
loadmodule "rr.so"<br>
loadmodule "pv.so"<br>
loadmodule "maxfwd.so"<br>
loadmodule "usrloc.so"<br>
loadmodule "registrar.so"<br>
loadmodule "textops.so"<br>
loadmodule "siputils.so"<br>
loadmodule "xlog.so"<br>
loadmodule "sanity.so"<br>
loadmodule "ctl.so"<br>
loadmodule "auth.so"<br>
loadmodule "auth_db.so"<br>
loadmodule "kex.so"<br>
loadmodule "mi_rpc.so"<br>
#!ifdef WITH_TLS<br>
loadmodule "tls.so"<br>
#!endif<br>
#!ifdef WITH_WEBSOCKETS<br>
loadmodule "xhttp.so"<br>
loadmodule "websocket.so"<br>
loadmodule "nathelper.so"<br>
#!endif<br>
<br>
# ----------------- setting module-specific parameters ---------------<br>
<br>
</div></div># ----- mi_fifo params -----<br>
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")<br>
<div class="HOEnZb"><div class="h5"><br>
# ----- tm params -----<br>
# auto-discard branches from previous serial forking leg<br>
modparam("tm", "failure_reply_mode", 3)<br>
# default retransmission timeout: 30sec<br>
modparam("tm", "fr_timer", 30000)<br>
# default invite retransmission timeout after 1xx: 120sec<br>
modparam("tm", "fr_inv_timer", 120000)<br>
<br>
# ----- rr params -----<br>
# add value to ;lr param to cope with most of the UAs<br>
modparam("rr", "enable_full_lr", 1)<br>
# do not append from tag to the RR (no need for this script)<br>
modparam("rr", "append_fromtag", 0)<br>
<br>
# ----- registrar params -----<br>
modparam("registrar", "method_filtering", 1)<br>
modparam("registrar", "max_expires", 3600)<br>
modparam("registrar", "gruu_enabled", 0)<br>
<br>
# ----- usrloc params -----<br>
modparam("usrloc", "db_url", "DBURL")<br>
modparam("usrloc", "db_mode", 0)<br>
<br>
# ----- auth_db params -----<br>
modparam("auth_db", "db_url", "DBURL")<br>
modparam("auth_db", "calculate_ha1", yes)<br>
modparam("auth_db", "password_column", "password")<br>
modparam("auth_db", "load_credentials", "")<br>
<br>
#!ifdef WITH_TLS<br>
# ----- tls params -----<br>
modparam("tls", "config", "/usr/local/kamailio/etc/kamailio/tls.cfg")<br>
#!endif<br>
<br>
#!ifdef WITH_WEBSOCKETS<br>
# ----- nathelper params -----<br>
modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")<br>
# Note: leaving NAT pings turned off here as nathelper is _only_ being used for<br>
# WebSocket connections. NAT pings are not needed as WebSockets have<br>
# their own keep-alives.<br>
#!endif<br>
<br>
<br>
####### Routing Logic ########<br>
<br>
# Main SIP request routing logic<br>
# - processing of any incoming SIP request starts with this route<br>
# - note: this is the same as route { ... }<br>
request_route {<br>
<br>
# per request initial checks<br>
route(REQINIT);<br>
<br>
#!ifdef WITH_WEBSOCKETS<br>
if (nat_uac_test(64)) {<br>
# Do NAT traversal stuff for requests from a WebSocket<br>
# connection - even if it is not behind a NAT!<br>
# This won't be needed in the future if Kamailio and the<br>
# WebSocket client support Outbound and Path.<br>
force_rport();<br>
if (is_method("REGISTER"))<br>
fix_nated_register();<br>
else {<br>
if (!add_contact_alias()) {<br>
xlog("L_ERR", "Error aliasing contact <$ct>\n");<br>
sl_send_reply("400", "Bad Request");<br>
exit;<br>
}<br>
}<br>
}<br>
#!endif<br>
<br>
# handle requests within SIP dialogs<br>
route(WITHINDLG);<br>
<br>
### only initial requests (no To tag)<br>
<br>
# CANCEL processing<br>
if (is_method("CANCEL")) {<br>
if (t_check_trans())<br>
t_relay();<br>
exit;<br>
}<br>
<br>
t_check_trans();<br>
<br>
# authentication<br>
route(AUTH);<br>
<br>
# record routing for dialog forming requests (in case they are routed)<br>
# - remove preloaded route headers<br>
remove_hf("Route");<br>
if (is_method("INVITE"))<br>
record_route();<br>
<br>
# handle registrations<br>
route(REGISTRAR);<br>
<br>
if ($rU==$null) {<br>
# request with no Username in RURI<br>
sl_send_reply("484","Address Incomplete");<br>
exit;<br>
}<br>
<br>
# user location service<br>
route(LOCATION);<br>
<br>
route(RELAY);<br>
}<br>
<br>
route[RELAY] {<br>
if (!t_relay()) {<br>
sl_reply_error();<br>
}<br>
exit;<br>
}<br>
<br>
# Per SIP request initial checks<br>
route[REQINIT] {<br>
if (!mf_process_maxfwd_header("10")) {<br>
sl_send_reply("483","Too Many Hops");<br>
exit;<br>
}<br>
<br>
if(!sanity_check("1511", "7")) {<br>
xlog("Malformed SIP message from $si:$sp\n");<br>
exit;<br>
}<br>
}<br>
<br>
# Handle requests within SIP dialogs<br>
route[WITHINDLG] {<br>
if (has_totag()) {<br>
# sequential request withing a dialog should<br>
# take the path determined by record-routing<br>
if (loose_route()) {<br>
#!ifdef WITH_WEBSOCKETS<br>
if ($du == "") {<br>
if (!handle_ruri_alias()) {<br>
xlog("L_ERR", "Bad alias <$ru>\n");<br>
sl_send_reply("400", "Bad Request");<br>
exit;<br>
}<br>
}<br>
#!endif<br>
route(RELAY);<br>
} else {<br>
if ( is_method("ACK") ) {<br>
if ( t_check_trans() ) {<br>
# no loose-route, but stateful ACK;<br>
# must be an ACK after a 487<br>
# or e.g. 404 from upstream server<br>
t_relay();<br>
exit;<br>
} else {<br>
# ACK without matching transaction...<br>
# ignore and discard<br>
exit;<br>
}<br>
}<br>
sl_send_reply("404","Not here");<br>
}<br>
exit;<br>
}<br>
}<br>
<br>
# Handle SIP registrations<br>
route[REGISTRAR] {<br>
if (is_method("REGISTER")) {<br>
if (!save("location"))<br>
sl_reply_error();<br>
<br>
exit;<br>
}<br>
}<br>
<br>
# USER location service<br>
route[LOCATION] {<br>
if (!lookup("location")) {<br>
$var(rc) = $rc;<br>
t_newtran();<br>
switch ($var(rc)) {<br>
case -1:<br>
case -3:<br>
send_reply("404", "Not Found");<br>
exit;<br>
case -2:<br>
send_reply("405", "Method Not Allowed");<br>
exit;<br>
}<br>
}<br>
}<br>
<br>
# Authentication route<br>
route[AUTH] {<br>
if (is_method("REGISTER") || from_uri==myself) {<br>
# authenticate requests<br>
if (!auth_check("$fd", "subscriber", "1")) {<br>
auth_challenge("$fd", "0");<br>
exit;<br>
}<br>
# user authenticated - remove auth header<br>
if(!is_method("REGISTER"))<br>
consume_credentials();<br>
}<br>
# if caller is not local subscriber, then check if it calls<br>
# a local destination, otherwise deny, not an open relay here<br>
if (from_uri!=myself && uri!=myself) {<br>
sl_send_reply("403","Not relaying");<br>
exit;<br>
}<br>
}<br>
<br>
#!ifdef WITH_WEBSOCKETS<br>
onreply_route {<br>
if (nat_uac_test(64)) {<br>
# Do NAT traversal stuff for replies to a WebSocket connection<br>
# - even if it is not behind a NAT!<br>
# This won't be needed in the future if Kamailio and the<br>
# WebSocket client support Outbound and Path.<br>
add_contact_alias();<br>
}<br>
}<br>
<br>
event_route[xhttp:request] {<br>
set_reply_close();<br>
set_reply_no_connect();<br>
<br>
</div></div><div class="im HOEnZb"># if ($Rp != MY_WS_PORT && $Rp != MY_WSS_PORT) {<br>
# xlog("L_WARN", "HTTP request received on $Rp\n");<br>
# xhttp_reply("403", "Forbidden", "", "");<br>
# exit;<br>
# }<br>
<br>
</div><div class="im HOEnZb"> xlog("L_DBG", "HTTP Request Received\n");<br>
<br>
if ($hdr(Upgrade)=~"websocket"<br>
&& $hdr(Connection)=~"Upgrade"<br>
&& $rm=~"GET") {<br>
xlog("L_DBG", "WebSocket\n");<br>
xlog("L_DBG", " Host: $hdr(Host)\n");<br>
xlog("L_DBG", " Origin: $hdr(Origin)\n");<br>
<br>
</div><div class="im HOEnZb"># if ($hdr(Host) == $null || !is_myself($hdr(Host))) {<br>
# xlog("L_WARN", "Bad host $hdr(Host)\n");<br>
# xhttp_reply("403", "Forbidden", "", "");<br>
# exit;<br>
# }<br>
<br>
# Optional... validate Origin<br>
# Optional... perform HTTP authentication<br>
<br>
# ws_handle_handshake() exits (no further configuration file<br>
# processing of the request) when complete.<br>
if (ws_handle_handshake())<br>
</div><div class="im HOEnZb"> {<br>
# Optional... cache some information abou the<br>
# successful connection<br>
exit;<br>
}<br>
}<br>
<br>
xhttp_reply("404", "Not found", "", "");<br>
}<br>
<br>
event_route[websocket:closed] {<br>
xlog("L_INFO", "WebSocket connection from $si:$sp has closed\n");<br>
}<br>
#!endif<br>
------------------------------------------------------------<br>
<br>
</div><div class="HOEnZb"><div class="h5">On Thu, Aug 16, 2012 at 10:48 AM, Muhammad Shahzad<br>
<<a href="mailto:shaheryarkh@googlemail.com">shaheryarkh@googlemail.com</a>> wrote:<br>
> By default all logs goto, syslog facility local0. So either,<br>
><br>
> 1. Your syslog daemon is configured to write local0 logs to some different<br>
> file.<br>
><br>
> OR<br>
><br>
> 2. You have set log level in kamailio too low, i think log level 0 disables<br>
> almost all logs. Set it to 4 for debug.<br>
><br>
> Thank you.<br>
><br>
><br>
> On Thu, Aug 16, 2012 at 3:11 PM, Juan Castro <<a href="mailto:jcastro@instant.com.br">jcastro@instant.com.br</a>> wrote:<br>
>><br>
>> I see no logs in /var/log/messages other than Kamailio's startup<br>
>> blah-blah. (I'm using CentOS 6.) Where do the xlog() messages go to?<br>
>><br>
>> On Tue, Aug 14, 2012 at 7:25 PM, Carlos Ruiz Díaz<br>
>> <<a href="mailto:carlos.ruizdiaz@gmail.com">carlos.ruizdiaz@gmail.com</a>> wrote:<br>
>> ><br>
>> > There's probably an error reported in kamaiio's log file so you should<br>
>> > check it out. In my case, I had to comment out parts of the script that were<br>
>> > in charge of doing some validation, particularly, in<br>
>> > event_route[xhttp:request].<br>
>><br>
>> _______________________________________________<br>
>> sr-dev mailing list<br>
>> <a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
>> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Muhammad Shahzad<br>
> -----------------------------------<br>
> CISCO Rich Media Communication Specialist (CRMCS)<br>
> CISCO Certified Network Associate (CCNA)<br>
> Cell: <a href="tel:%2B92%20334%20422%2040%2088" value="+923344224088">+92 334 422 40 88</a><br>
> MSN: <a href="mailto:shari_786pk@hotmail.com">shari_786pk@hotmail.com</a><br>
> Email: <a href="mailto:shaheryarkh@googlemail.com">shaheryarkh@googlemail.com</a><br>
><br>
> _______________________________________________<br>
> sr-dev mailing list<br>
> <a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
><br>
<br>
<br>
<br>
--<br>
</div></div><div class="im HOEnZb">Juan Carlos Castro y Castro<br>
Instant Solutions - Telefonia Gerando Resultado<br>
<a href="http://www.instant.com.br" target="_blank">http://www.instant.com.br</a><br>
Principais capitais: 4063-6100<br>
Demais regiões: (11)4063-6100<br>
<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
</div></div></blockquote></div><br></div>