[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sr-users
Subject:    Re: [SR-Users] [sr-dev] kamailio is returning 500
From:       chanea <chanea () gmail ! com>
Date:       2013-02-27 15:30:27
Message-ID: CAKeQZXugx5av2izD4TkrRVq7nef+4vz_EbZnsGSeoSKL8YH+KA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Carsten,

Thanks for reply.   No idea how this happen but after increase the shared
memory used to run Kamailio , this 500 issue is gone now.

BTW,   REGISTER being routed seems wrong in my config file , therefore
after load balancing ,  client cannot reach each other by MESSAGE.

Client --- > Kamailio LB --->Sip01
                                \ ---->Sip02

Any idea??


Best Regards,

chanea

On Tue, Feb 26, 2013 at 10:39 PM, Carsten Bock <carsten@ng-voice.com> wrote:

> Hi,
>
> i see no point in your config, where the 500 should come from. It must
> come from the servers you are loadbalancing for.
>
> Kind regards,
> Carsten
>
> 2013/2/26 chanea <chanea@gmail.com>:
> > Hi Carsten,
> >
> > Thanks again for your kind reply.
> > I am quite newbie to kamailio,  and I dont see why the load balancer is
> > replying "500".
> >
> > It will be great appreciated if you can point out what i am doing wrong
> in
> > my config file as below.
> > Actually, there is another issue for the setting below is that it cannot
> > load balancing the "REGISTER" correctly.
> >
> > best regards,
> >
> > chanea
> >
> > ==============================================================
> >
> > ####### Global Parameters #########
> > #!define WITH_NAT
> >
> >
> >
> > # - flags
> > #   FLT_ - per transaction (message) flags
> > # FLB_ - per branch flags
> > #!define FLT_ACC 1
> > #!define FLT_ACCMISSED 2
> > #!define FLT_ACCFAILED 3
> > #!define FLT_NATS 5
> >
> > #!define FLB_NATB 6
> > #!define FLB_NATSIPPING 7
> >
> > ####### Global Parameters #########
> >
> > debug=-3
> > log_stderror=no
> >
> > memdbg=5
> > memlog=5
> >
> > log_facility=LOG_LOCAL0
> >
> > fork=yes
> > children=8
> >
> > disable_tcp=yes
> >
> > auto_aliases=no
> >
> > port=5060
> >
> >
> > sip_warning=no
> >
> > ####### Modules Section ########
> >
> > # set paths to location of modules
> > #!ifdef LOCAL_TEST_RUN
> > mpath="modules_k:modules"
> > #!else
> >
> mpath="/usr/local/lib64/kamailio/modules_k/:/usr/local/lib64/kamailio/modules/"
> > #!endif
> > loadmodule "db_mysql.so"
> > loadmodule "mi_fifo.so"
> > loadmodule "kex.so"
> > loadmodule "tm.so"
> > loadmodule "tmx.so"
> > loadmodule "sl.so"
> > loadmodule "rr.so"
> > loadmodule "usrloc.so"
> > loadmodule "pv.so"
> > loadmodule "maxfwd.so"
> > loadmodule "textops.so"
> > loadmodule "siputils.so"
> > loadmodule "xlog.so"
> > loadmodule "sanity.so"
> > loadmodule "ctl.so"
> > loadmodule "mi_rpc.so"
> > loadmodule "acc.so"
> > loadmodule "dispatcher.so"
> >
> > #!ifdef WITH_NAT
> > loadmodule "nathelper.so"
> > loadmodule "rtpproxy.so"
> > #!endif
> >
> >
> > # ----- mi_fifo params -----
> > modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
> >
> >
> > # ----- rr params -----
> > # add value to ;lr param to cope with most of the UAs
> > modparam("rr", "enable_full_lr", 1)
> > # do not append from tag to the RR (no need for this script)
> > modparam("rr", "append_fromtag", 0)
> >
> >
> > # ----- acc params -----
> > modparam("acc", "log_flag", 1)
> > modparam("acc", "failed_transaction_flag", 3)
> > modparam("acc", "log_extra",
> >
> "src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;src_ip=$si")
> >
> > # ----- tm params -----
> > modparam("tm", "fr_timer", 10000)
> > modparam("tm", "fr_inv_timer", 40000)
> >
> >
> > #!ifdef WITH_NAT
> > # ----- rtpproxy params -----
> > #modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")
> > modparam("rtpproxy", "rtpproxy_sock", "udp:{myipaddr}:22222")
> > # ----- nathelper params -----
> > modparam("nathelper", "natping_interval", 600)
> > modparam("nathelper", "ping_nated_only", 1)
> > modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)
> > modparam("nathelper", "sipping_from", "sip:pinger@{myipaddr}")
> >
> > # params needed for NAT traversal in other modules
> > modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")
> > modparam("usrloc", "nat_bflag", FLB_NATB)
> > #!endif
> >
> >
> > # ----- dispatcher params -----
> > modparam("dispatcher", "db_url",
> > "mysql://{mydbsetting}")
> > modparam("dispatcher", "table_name", "dispatcher")
> > modparam("dispatcher", "flags", 2)
> > modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
> > modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
> > modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
> >
> > ####### Routing Logic ########
> >
> >
> > # main request routing logic
> >
> > route {
> >
> > # per request initial checks
> > route(REQINIT);
> >
> > # NAT detection
> > route(NAT);
> >
> > # handle requests within SIP dialogs
> > route(WITHINDLG);
> >
> > ### only initial requests (no To tag)
> >
> > # CANCEL processing
> > if (is_method("CANCEL"))
> > {
> > if (t_check_trans())
> > t_relay();
> > exit;
> > }
> >
> > t_check_trans();
> >
> > # record routing for dialog forming requests (in case they are routed)
> > # - remove preloaded route headers
> > remove_hf("Route");
> > if (is_method("INVITE|SUBSCRIBE"))
> > record_route();
> >
> > # account only INVITEs
> > if (is_method("INVITE"))
> > {
> > setflag(1); # do accounting
> > }
> >
> > # dispatch destinations
> > route(DISPATCH);
> >
> > route(RELAY);
> > }
> >
> >
> > route[RELAY] {
> > #!ifdef WITH_NAT
> > if (check_route_param("nat=yes")) {
> > setbflag(FLB_NATB);
> > }
> > if (isflagset(FLT_NATS) || isbflagset(FLB_NATB)) {
> > route(RTPPROXY);
> > }
> > #!endif
> > if (!t_relay()) {
> > sl_reply_error();
> > }
> > exit;
> > }
> >
> >
> > # Per SIP request initial checks
> > route[REQINIT] {
> > if (!mf_process_maxfwd_header("10")) {
> > sl_send_reply("483","Too Many Hops");
> > exit;
> > }
> >
> > if(!sanity_check("1511", "7"))
> > {
> > xlog("Malformed SIP message from $si:$sp\n");
> > exit;
> > }
> > }
> >
> > # Caller NAT detection route
> > route[NAT] {
> > #!ifdef WITH_NAT
> > force_rport();
> > if (nat_uac_test("19")) {
> > #xlog("L_INFO","ALERT: ua is behind NAT (ru:$ru)(IP:$si:$sp)\n");
> >
> > if (method=="REGISTER") {
> > fix_nated_register();
> > } else {
> > fix_nated_contact();
> > }
> > setflag(FLT_NATS);
> > }
> > #!endif
> > return;
> > }
> >
> > # RTPProxy control
> > route[RTPPROXY] {
> > #!ifdef WITH_NAT
> > if (is_method("BYE")) {
> > unforce_rtp_proxy();
> > } else if (is_method("INVITE")){
> > force_rtp_proxy();
> > }
> > if (!has_totag()) add_rr_param(";nat=yes");
> > #!endif
> > return;
> > }
> >
> >
> >
> > # Handle requests within SIP dialogs
> > route[WITHINDLG] {
> > if (has_totag()) {
> > # sequential request withing a dialog should
> > # take the path determined by record-routing
> > if (loose_route()) {
> > if (is_method("BYE")) {
> > setflag(1); # do accounting ...
> > setflag(3); # ... even if the transaction fails
> > }
> > route(RELAY);
> > } else {
> > if ( is_method("ACK") ) {
> > if ( t_check_trans() ) {
> > # non loose-route, but stateful ACK;
> > # must be ACK after a 487 or e.g. 404 from upstream server
> > t_relay();
> > exit;
> > } else {
> > # ACK without matching transaction ... ignore and discard.
> > exit;
> > }
> > }
> > sl_send_reply("404","Not here");
> > }
> > exit;
> > }
> > }
> >
> > # Dispatch requests
> > route[DISPATCH] {
> > # round robin dispatching on gateways group '1'
> > if(!ds_select_dst("1", "0"))
> > {
> > send_reply("404", "No destination");
> > exit;
> > }
> > xlog("L_INFO", "--- SCRIPT: going to <$ru> via <$du>\n");
> > t_on_failure("RTF_DISPATCH");
> > return;
> > }
> >
> > # Sample failure route
> > failure_route[RTF_DISPATCH] {
> > if (t_is_canceled()) {
> > exit;
> > }
> > # next DST - only for 500 or local timeout
> > if (t_check_status("500")
> > or (t_branch_timeout() and !t_branch_replied()))
> > {
> > if(ds_next_dst())
> > {
> > t_on_failure("RTF_DISPATCH");
> > route(RELAY);
> > exit;
> > }
> > }
> > }
> > =================================================================
> >
> >
> >
> > On Tue, Feb 26, 2013 at 8:32 PM, Carsten Bock <carsten@ng-voice.com>
> wrote:
> >>
> >> Hi,
> >>
> >> the dispatcher module doesn't create "500 Internal Server Error"
> replies.
> >> There must be another source for your error; most likely not the
> >> Kamailio Loadbalancer.
> >>
> >> Kind regards,
> >> Carsten
> >>
> >> 2013/2/26 chanea <chanea@gmail.com>:
> >> > Hi Carsten,
> >> >
> >> > Thanks for your quick reply.
> >> > The "500" is generated by the Kamailio server which is used as Load
> >> > balancer
> >> > ( using dispatcher module).
> >> >
> >> > I dont see any 500 number in my kamailio.cfg in the load balancer
> >> > kamailio.
> >> > Should I go deep into the dispatcher module itself?
> >> >
> >> >
> >> > Unluckily I cannot check the reason by checking the syslog since this
> >> > only
> >> > happen when thousands of request come in at the same time.
> >> >
> >> > chanea
> >> >
> >> >
> >> >
> >> > On Tue, Feb 26, 2013 at 7:24 PM, Carsten Bock <carsten@ng-voice.com>
> >> > wrote:
> >> >>
> >> >> Hi,
> >> >>
> >> >> can you see, why the Kamailio is returning a "500 Server internal
> >> >> error"? This response must be either created by some module or by
> some
> >> >> upstream server (e.g. in case of loadbalancing).
> >> >> Kamailio itself would not create such response, you should (if at
> all)
> >> >> find the answer in the logs...
> >> >>
> >> >> Kind regards,
> >> >> Carsten
> >> >>
> >> >> 2013/2/26 chanea <chanea@gmail.com>:
> >> >> > Dear all
> >> >> >
> >> >> > While lots of request come to my Kamailio 3.1.x in the same time ,
> >> >> > server
> >> >> > is returning "500, Server Internal Error" to some of the request.
> >> >> >
> >> >> > What should i do if i want to reduce the number of "500" response?
> >> >> >
> >> >> >
> >> >> >
> >> >> > chanea
> >> >> >
> >> >> > _______________________________________________
> >> >> > sr-dev mailing list
> >> >> > sr-dev@lists.sip-router.org
> >> >> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
> >> >> >
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Carsten Bock
> >> >> CEO (Geschäftsführer)
> >> >>
> >> >> =============================================================
> >> >> Visit us on the Kamailio World 2013, 16./17. April 2013
> >> >> => http://conference.kamailio.com/k01/
> See
> >> >> you there!
> >> >> =============================================================
> >> >>
> >> >> ng-voice GmbH
> >> >> Schomburgstr. 80
> >> >> D-22767 Hamburg / Germany
> >> >>
> >> >> http://www.ng-voice.com
> >> >> mailto:carsten@ng-voice.com
> >> >>
> >> >> Office +49 40 34927219
> >> >> Fax +49 40 34927220
> >> >>
> >> >> Sitz der Gesellschaft: Hamburg
> >> >> Registergericht: Amtsgericht Hamburg, HRB 120189
> >> >> Geschäftsführer: Carsten Bock
> >> >> Ust-ID: DE279344284
> >> >>
> >> >> Hier finden Sie unsere handelsrechtlichen Pflichtangaben:
> >> >> http://www.ng-voice.com/imprint/
> >> >>
> >> >> _______________________________________________
> >> >> sr-dev mailing list
> >> >> sr-dev@lists.sip-router.org
> >> >> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
> >> >
> >> >
> >> >
> >> > _______________________________________________
> >> > sr-dev mailing list
> >> > sr-dev@lists.sip-router.org
> >> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
> >> >
> >>
> >>
> >>
> >> --
> >> Carsten Bock
> >> CEO (Geschäftsführer)
> >>
> >> =============================================================
> >> Visit us on the Kamailio World 2013, 16./17. April 2013
> >> => http://conference.kamailio.com/k01/                             See
> >> you there!
> >> =============================================================
> >>
> >> ng-voice GmbH
> >> Schomburgstr. 80
> >> D-22767 Hamburg / Germany
> >>
> >> http://www.ng-voice.com
> >> mailto:carsten@ng-voice.com
> >>
> >> Office +49 40 34927219
> >> Fax +49 40 34927220
> >>
> >> Sitz der Gesellschaft: Hamburg
> >> Registergericht: Amtsgericht Hamburg, HRB 120189
> >> Geschäftsführer: Carsten Bock
> >> Ust-ID: DE279344284
> >>
> >> Hier finden Sie unsere handelsrechtlichen Pflichtangaben:
> >> http://www.ng-voice.com/imprint/
> >>
> >> _______________________________________________
> >> sr-dev mailing list
> >> sr-dev@lists.sip-router.org
> >> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
> >
> >
> >
> > _______________________________________________
> > sr-dev mailing list
> > sr-dev@lists.sip-router.org
> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
> >
>
>
>
> --
> Carsten Bock
> CEO (Geschäftsführer)
>
> =============================================================
> Visit us on the Kamailio World 2013, 16./17. April 2013
> => http://conference.kamailio.com/k01/                             See
> you there!
> =============================================================
>
> ng-voice GmbH
> Schomburgstr. 80
> D-22767 Hamburg / Germany
>
> http://www.ng-voice.com
> mailto:carsten@ng-voice.com
>
> Office +49 40 34927219
> Fax +49 40 34927220
>
> Sitz der Gesellschaft: Hamburg
> Registergericht: Amtsgericht Hamburg, HRB 120189
> Geschäftsführer: Carsten Bock
> Ust-ID: DE279344284
>
> Hier finden Sie unsere handelsrechtlichen Pflichtangaben:
> http://www.ng-voice.com/imprint/
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>

[Attachment #5 (text/html)]

<div>Hi Carsten,</div><div><br></div><div>Thanks for reply.    No idea how this \
happen but after increase the shared memory used to run Kamailio , this 500 issue is \
gone now.     </div><div><br></div><div>BTW,    REGISTER being routed seems wrong in \
my config file , therefore after load balancing ,   client cannot reach each other by \
MESSAGE.</div> <div><br></div><div>Client --- &gt; Kamailio LB \
---&gt;Sip01</div><div>                                                \ \
----&gt;Sip02</div><div><br></div>Any \
idea??<div><div><br></div><div><br></div><div>Best Regards,</div><div><br></div> \
<div>chanea<br><br><div class="gmail_quote">On Tue, Feb 26, 2013 at 10:39 PM, Carsten \
Bock <span dir="ltr">&lt;<a href="mailto:carsten@ng-voice.com" \
target="_blank">carsten@ng-voice.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> Hi,<br>
<br>
i see no point in your config, where the 500 should come from. It must<br>
come from the servers you are loadbalancing for.<br>
<div><div class="h5"><br>
Kind regards,<br>
Carsten<br>
<br>
2013/2/26 chanea &lt;<a href="mailto:chanea@gmail.com">chanea@gmail.com</a>&gt;:<br>
&gt; Hi Carsten,<br>
&gt;<br>
&gt; Thanks again for your kind reply.<br>
&gt; I am quite newbie to kamailio,   and I dont see why the load balancer is<br>
&gt; replying &quot;500&quot;.<br>
&gt;<br>
&gt; It will be great appreciated if you can point out what i am doing wrong in<br>
&gt; my config file as below.<br>
&gt; Actually, there is another issue for the setting below is that it cannot<br>
&gt; load balancing the &quot;REGISTER&quot; correctly.<br>
&gt;<br>
&gt; best regards,<br>
&gt;<br>
&gt; chanea<br>
&gt;<br>
&gt; ==============================================================<br>
&gt;<br>
&gt; ####### Global Parameters #########<br>
&gt; #!define WITH_NAT<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; # - flags<br>
&gt; #    FLT_ - per transaction (message) flags<br>
&gt; # FLB_ - per branch flags<br>
&gt; #!define FLT_ACC 1<br>
&gt; #!define FLT_ACCMISSED 2<br>
&gt; #!define FLT_ACCFAILED 3<br>
&gt; #!define FLT_NATS 5<br>
&gt;<br>
&gt; #!define FLB_NATB 6<br>
&gt; #!define FLB_NATSIPPING 7<br>
&gt;<br>
&gt; ####### Global Parameters #########<br>
&gt;<br>
&gt; debug=-3<br>
&gt; log_stderror=no<br>
&gt;<br>
&gt; memdbg=5<br>
&gt; memlog=5<br>
&gt;<br>
&gt; log_facility=LOG_LOCAL0<br>
&gt;<br>
&gt; fork=yes<br>
&gt; children=8<br>
&gt;<br>
&gt; disable_tcp=yes<br>
&gt;<br>
&gt; auto_aliases=no<br>
&gt;<br>
&gt; port=5060<br>
&gt;<br>
&gt;<br>
&gt; sip_warning=no<br>
&gt;<br>
&gt; ####### Modules Section ########<br>
&gt;<br>
&gt; # set paths to location of modules<br>
&gt; #!ifdef LOCAL_TEST_RUN<br>
&gt; mpath=&quot;modules_k:modules&quot;<br>
&gt; #!else<br>
&gt; mpath=&quot;/usr/local/lib64/kamailio/modules_k/:/usr/local/lib64/kamailio/modules/&quot;<br>
 &gt; #!endif<br>
&gt; loadmodule &quot;db_mysql.so&quot;<br>
&gt; loadmodule &quot;mi_fifo.so&quot;<br>
&gt; loadmodule &quot;kex.so&quot;<br>
&gt; loadmodule &quot;tm.so&quot;<br>
&gt; loadmodule &quot;tmx.so&quot;<br>
&gt; loadmodule &quot;sl.so&quot;<br>
&gt; loadmodule &quot;rr.so&quot;<br>
&gt; loadmodule &quot;usrloc.so&quot;<br>
&gt; loadmodule &quot;pv.so&quot;<br>
&gt; loadmodule &quot;maxfwd.so&quot;<br>
&gt; loadmodule &quot;textops.so&quot;<br>
&gt; loadmodule &quot;siputils.so&quot;<br>
&gt; loadmodule &quot;xlog.so&quot;<br>
&gt; loadmodule &quot;sanity.so&quot;<br>
&gt; loadmodule &quot;ctl.so&quot;<br>
&gt; loadmodule &quot;mi_rpc.so&quot;<br>
&gt; loadmodule &quot;acc.so&quot;<br>
&gt; loadmodule &quot;dispatcher.so&quot;<br>
&gt;<br>
&gt; #!ifdef WITH_NAT<br>
&gt; loadmodule &quot;nathelper.so&quot;<br>
&gt; loadmodule &quot;rtpproxy.so&quot;<br>
&gt; #!endif<br>
&gt;<br>
&gt;<br>
&gt; # ----- mi_fifo params -----<br>
&gt; modparam(&quot;mi_fifo&quot;, &quot;fifo_name&quot;, \
&quot;/tmp/kamailio_fifo&quot;)<br> &gt;<br>
&gt;<br>
&gt; # ----- rr params -----<br>
&gt; # add value to ;lr param to cope with most of the UAs<br>
&gt; modparam(&quot;rr&quot;, &quot;enable_full_lr&quot;, 1)<br>
&gt; # do not append from tag to the RR (no need for this script)<br>
&gt; modparam(&quot;rr&quot;, &quot;append_fromtag&quot;, 0)<br>
&gt;<br>
&gt;<br>
&gt; # ----- acc params -----<br>
&gt; modparam(&quot;acc&quot;, &quot;log_flag&quot;, 1)<br>
&gt; modparam(&quot;acc&quot;, &quot;failed_transaction_flag&quot;, 3)<br>
&gt; modparam(&quot;acc&quot;, &quot;log_extra&quot;,<br>
&gt; &quot;src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;src_ip=$si&quot;)<br>
 &gt;<br>
&gt; # ----- tm params -----<br>
&gt; modparam(&quot;tm&quot;, &quot;fr_timer&quot;, 10000)<br>
&gt; modparam(&quot;tm&quot;, &quot;fr_inv_timer&quot;, 40000)<br>
&gt;<br>
&gt;<br>
&gt; #!ifdef WITH_NAT<br>
&gt; # ----- rtpproxy params -----<br>
&gt; #modparam(&quot;rtpproxy&quot;, &quot;rtpproxy_sock&quot;, &quot;udp:<a \
href="http://127.0.0.1:7722" target="_blank">127.0.0.1:7722</a>&quot;)<br> &gt; \
modparam(&quot;rtpproxy&quot;, &quot;rtpproxy_sock&quot;, \
&quot;udp:{myipaddr}:22222&quot;)<br> &gt; # ----- nathelper params -----<br>
&gt; modparam(&quot;nathelper&quot;, &quot;natping_interval&quot;, 600)<br>
&gt; modparam(&quot;nathelper&quot;, &quot;ping_nated_only&quot;, 1)<br>
&gt; modparam(&quot;nathelper&quot;, &quot;sipping_bflag&quot;, FLB_NATSIPPING)<br>
&gt; modparam(&quot;nathelper&quot;, &quot;sipping_from&quot;, \
&quot;sip:pinger@{myipaddr}&quot;)<br> &gt;<br>
&gt; # params needed for NAT traversal in other modules<br>
&gt; modparam(&quot;nathelper|registrar&quot;, &quot;received_avp&quot;, \
&quot;$avp(RECEIVED)&quot;)<br> &gt; modparam(&quot;usrloc&quot;, \
&quot;nat_bflag&quot;, FLB_NATB)<br> &gt; #!endif<br>
&gt;<br>
&gt;<br>
&gt; # ----- dispatcher params -----<br>
&gt; modparam(&quot;dispatcher&quot;, &quot;db_url&quot;,<br>
&gt; &quot;mysql://{mydbsetting}&quot;)<br>
&gt; modparam(&quot;dispatcher&quot;, &quot;table_name&quot;, \
&quot;dispatcher&quot;)<br> &gt; modparam(&quot;dispatcher&quot;, &quot;flags&quot;, \
2)<br> &gt; modparam(&quot;dispatcher&quot;, &quot;dst_avp&quot;, \
&quot;$avp(AVP_DST)&quot;)<br> &gt; modparam(&quot;dispatcher&quot;, \
&quot;grp_avp&quot;, &quot;$avp(AVP_GRP)&quot;)<br> &gt; \
modparam(&quot;dispatcher&quot;, &quot;cnt_avp&quot;, &quot;$avp(AVP_CNT)&quot;)<br> \
&gt;<br> &gt; ####### Routing Logic ########<br>
&gt;<br>
&gt;<br>
&gt; # main request routing logic<br>
&gt;<br>
&gt; route {<br>
&gt;<br>
&gt; # per request initial checks<br>
&gt; route(REQINIT);<br>
&gt;<br>
&gt; # NAT detection<br>
&gt; route(NAT);<br>
&gt;<br>
&gt; # handle requests within SIP dialogs<br>
&gt; route(WITHINDLG);<br>
&gt;<br>
&gt; ### only initial requests (no To tag)<br>
&gt;<br>
&gt; # CANCEL processing<br>
&gt; if (is_method(&quot;CANCEL&quot;))<br>
&gt; {<br>
&gt; if (t_check_trans())<br>
&gt; t_relay();<br>
&gt; exit;<br>
&gt; }<br>
&gt;<br>
&gt; t_check_trans();<br>
&gt;<br>
&gt; # record routing for dialog forming requests (in case they are routed)<br>
&gt; # - remove preloaded route headers<br>
&gt; remove_hf(&quot;Route&quot;);<br>
&gt; if (is_method(&quot;INVITE|SUBSCRIBE&quot;))<br>
&gt; record_route();<br>
&gt;<br>
&gt; # account only INVITEs<br>
&gt; if (is_method(&quot;INVITE&quot;))<br>
&gt; {<br>
&gt; setflag(1); # do accounting<br>
&gt; }<br>
&gt;<br>
&gt; # dispatch destinations<br>
&gt; route(DISPATCH);<br>
&gt;<br>
&gt; route(RELAY);<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt; route[RELAY] {<br>
&gt; #!ifdef WITH_NAT<br>
&gt; if (check_route_param(&quot;nat=yes&quot;)) {<br>
&gt; setbflag(FLB_NATB);<br>
&gt; }<br>
&gt; if (isflagset(FLT_NATS) || isbflagset(FLB_NATB)) {<br>
&gt; route(RTPPROXY);<br>
&gt; }<br>
&gt; #!endif<br>
&gt; if (!t_relay()) {<br>
&gt; sl_reply_error();<br>
&gt; }<br>
&gt; exit;<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt; # Per SIP request initial checks<br>
&gt; route[REQINIT] {<br>
&gt; if (!mf_process_maxfwd_header(&quot;10&quot;)) {<br>
&gt; sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);<br>
&gt; exit;<br>
&gt; }<br>
&gt;<br>
&gt; if(!sanity_check(&quot;1511&quot;, &quot;7&quot;))<br>
&gt; {<br>
&gt; xlog(&quot;Malformed SIP message from $si:$sp\n&quot;);<br>
&gt; exit;<br>
&gt; }<br>
&gt; }<br>
&gt;<br>
&gt; # Caller NAT detection route<br>
&gt; route[NAT] {<br>
&gt; #!ifdef WITH_NAT<br>
&gt; force_rport();<br>
&gt; if (nat_uac_test(&quot;19&quot;)) {<br>
&gt; #xlog(&quot;L_INFO&quot;,&quot;ALERT: ua is behind NAT \
(ru:$ru)(IP:$si:$sp)\n&quot;);<br> &gt;<br>
&gt; if (method==&quot;REGISTER&quot;) {<br>
&gt; fix_nated_register();<br>
&gt; } else {<br>
&gt; fix_nated_contact();<br>
&gt; }<br>
&gt; setflag(FLT_NATS);<br>
&gt; }<br>
&gt; #!endif<br>
&gt; return;<br>
&gt; }<br>
&gt;<br>
&gt; # RTPProxy control<br>
&gt; route[RTPPROXY] {<br>
&gt; #!ifdef WITH_NAT<br>
&gt; if (is_method(&quot;BYE&quot;)) {<br>
&gt; unforce_rtp_proxy();<br>
&gt; } else if (is_method(&quot;INVITE&quot;)){<br>
&gt; force_rtp_proxy();<br>
&gt; }<br>
&gt; if (!has_totag()) add_rr_param(&quot;;nat=yes&quot;);<br>
&gt; #!endif<br>
&gt; return;<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; # Handle requests within SIP dialogs<br>
&gt; route[WITHINDLG] {<br>
&gt; if (has_totag()) {<br>
&gt; # sequential request withing a dialog should<br>
&gt; # take the path determined by record-routing<br>
&gt; if (loose_route()) {<br>
&gt; if (is_method(&quot;BYE&quot;)) {<br>
&gt; setflag(1); # do accounting ...<br>
&gt; setflag(3); # ... even if the transaction fails<br>
&gt; }<br>
&gt; route(RELAY);<br>
&gt; } else {<br>
&gt; if ( is_method(&quot;ACK&quot;) ) {<br>
&gt; if ( t_check_trans() ) {<br>
&gt; # non loose-route, but stateful ACK;<br>
&gt; # must be ACK after a 487 or e.g. 404 from upstream server<br>
&gt; t_relay();<br>
&gt; exit;<br>
&gt; } else {<br>
&gt; # ACK without matching transaction ... ignore and discard.<br>
&gt; exit;<br>
&gt; }<br>
&gt; }<br>
&gt; sl_send_reply(&quot;404&quot;,&quot;Not here&quot;);<br>
&gt; }<br>
&gt; exit;<br>
&gt; }<br>
&gt; }<br>
&gt;<br>
&gt; # Dispatch requests<br>
&gt; route[DISPATCH] {<br>
&gt; # round robin dispatching on gateways group &#39;1&#39;<br>
&gt; if(!ds_select_dst(&quot;1&quot;, &quot;0&quot;))<br>
&gt; {<br>
&gt; send_reply(&quot;404&quot;, &quot;No destination&quot;);<br>
&gt; exit;<br>
&gt; }<br>
&gt; xlog(&quot;L_INFO&quot;, &quot;--- SCRIPT: going to &lt;$ru&gt; via \
&lt;$du&gt;\n&quot;);<br> &gt; t_on_failure(&quot;RTF_DISPATCH&quot;);<br>
&gt; return;<br>
&gt; }<br>
&gt;<br>
&gt; # Sample failure route<br>
&gt; failure_route[RTF_DISPATCH] {<br>
&gt; if (t_is_canceled()) {<br>
&gt; exit;<br>
&gt; }<br>
&gt; # next DST - only for 500 or local timeout<br>
&gt; if (t_check_status(&quot;500&quot;)<br>
&gt; or (t_branch_timeout() and !t_branch_replied()))<br>
&gt; {<br>
&gt; if(ds_next_dst())<br>
&gt; {<br>
&gt; t_on_failure(&quot;RTF_DISPATCH&quot;);<br>
&gt; route(RELAY);<br>
&gt; exit;<br>
&gt; }<br>
&gt; }<br>
&gt; }<br>
&gt; =================================================================<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Feb 26, 2013 at 8:32 PM, Carsten Bock &lt;<a \
href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a>&gt; wrote:<br> \
&gt;&gt;<br> &gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; the dispatcher module doesn&#39;t create &quot;500 Internal Server \
Error&quot; replies.<br> &gt;&gt; There must be another source for your error; most \
likely not the<br> &gt;&gt; Kamailio Loadbalancer.<br>
&gt;&gt;<br>
&gt;&gt; Kind regards,<br>
&gt;&gt; Carsten<br>
&gt;&gt;<br>
&gt;&gt; 2013/2/26 chanea &lt;<a \
href="mailto:chanea@gmail.com">chanea@gmail.com</a>&gt;:<br> &gt;&gt; &gt; Hi \
Carsten,<br> &gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks for your quick reply.<br>
&gt;&gt; &gt; The &quot;500&quot; is generated by the Kamailio server which is used \
as Load<br> &gt;&gt; &gt; balancer<br>
&gt;&gt; &gt; ( using dispatcher module).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I dont see any 500 number in my kamailio.cfg in the load balancer<br>
&gt;&gt; &gt; kamailio.<br>
&gt;&gt; &gt; Should I go deep into the dispatcher module itself?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Unluckily I cannot check the reason by checking the syslog since \
this<br> &gt;&gt; &gt; only<br>
&gt;&gt; &gt; happen when thousands of request come in at the same time.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; chanea<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Tue, Feb 26, 2013 at 7:24 PM, Carsten Bock &lt;<a \
href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a>&gt;<br> &gt;&gt; &gt; \
wrote:<br> &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Hi,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; can you see, why the Kamailio is returning a &quot;500 Server \
internal<br> &gt;&gt; &gt;&gt; error&quot;? This response must be either created by \
some module or by some<br> &gt;&gt; &gt;&gt; upstream server (e.g. in case of \
loadbalancing).<br> &gt;&gt; &gt;&gt; Kamailio itself would not create such response, \
you should (if at all)<br> &gt;&gt; &gt;&gt; find the answer in the logs...<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Kind regards,<br>
&gt;&gt; &gt;&gt; Carsten<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; 2013/2/26 chanea &lt;<a \
href="mailto:chanea@gmail.com">chanea@gmail.com</a>&gt;:<br> &gt;&gt; &gt;&gt; &gt; \
Dear all<br> &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; While lots of request come to my Kamailio 3.1.x in the same \
time ,<br> &gt;&gt; &gt;&gt; &gt; server<br>
&gt;&gt; &gt;&gt; &gt; is returning &quot;500, Server Internal Error&quot; to some of \
the request.<br> &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; What should i do if i want to reduce the number of \
&quot;500&quot; response?<br> &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; chanea<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; &gt; sr-dev mailing list<br>
&gt;&gt; &gt;&gt; &gt; <a \
href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br> \
&gt;&gt; &gt;&gt; &gt; <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> \
&gt;&gt; &gt;&gt; &gt;<br> &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; Carsten Bock<br>
&gt;&gt; &gt;&gt; CEO (Geschäftsführer)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; =============================================================<br>
&gt;&gt; &gt;&gt; Visit us on the Kamailio World 2013, 16./17. April 2013<br>
&gt;&gt; &gt;&gt; =&gt; <a href="http://conference.kamailio.com/k01/" \
target="_blank">http://conference.kamailio.com/k01/</a>                               \
See<br> &gt;&gt; &gt;&gt; you there!<br>
&gt;&gt; &gt;&gt; =============================================================<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; ng-voice GmbH<br>
&gt;&gt; &gt;&gt; Schomburgstr. 80<br>
&gt;&gt; &gt;&gt; D-22767 Hamburg / Germany<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; <a href="http://www.ng-voice.com" \
target="_blank">http://www.ng-voice.com</a><br> &gt;&gt; &gt;&gt; mailto:<a \
href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a><br> &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Office <a href="tel:%2B49%2040%2034927219" \
value="+494034927219">+49 40 34927219</a><br> &gt;&gt; &gt;&gt; Fax <a \
href="tel:%2B49%2040%2034927220" value="+494034927220">+49 40 34927220</a><br> \
&gt;&gt; &gt;&gt;<br> &gt;&gt; &gt;&gt; Sitz der Gesellschaft: Hamburg<br>
&gt;&gt; &gt;&gt; Registergericht: Amtsgericht Hamburg, HRB 120189<br>
&gt;&gt; &gt;&gt; Geschäftsführer: Carsten Bock<br>
&gt;&gt; &gt;&gt; Ust-ID: DE279344284<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Hier finden Sie unsere handelsrechtlichen Pflichtangaben:<br>
&gt;&gt; &gt;&gt; <a href="http://www.ng-voice.com/imprint/" \
target="_blank">http://www.ng-voice.com/imprint/</a><br> &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; sr-dev mailing list<br>
&gt;&gt; &gt;&gt; <a \
href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br> \
&gt;&gt; &gt;&gt; <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> \
&gt;&gt; &gt;<br> &gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; sr-dev mailing list<br>
&gt;&gt; &gt; <a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
 &gt;&gt; &gt; <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> \
&gt;&gt; &gt;<br> &gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Carsten Bock<br>
&gt;&gt; CEO (Geschäftsführer)<br>
&gt;&gt;<br>
&gt;&gt; =============================================================<br>
&gt;&gt; Visit us on the Kamailio World 2013, 16./17. April 2013<br>
&gt;&gt; =&gt; <a href="http://conference.kamailio.com/k01/" \
target="_blank">http://conference.kamailio.com/k01/</a>                               \
See<br> &gt;&gt; you there!<br>
&gt;&gt; =============================================================<br>
&gt;&gt;<br>
&gt;&gt; ng-voice GmbH<br>
&gt;&gt; Schomburgstr. 80<br>
&gt;&gt; D-22767 Hamburg / Germany<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://www.ng-voice.com" \
target="_blank">http://www.ng-voice.com</a><br> &gt;&gt; mailto:<a \
href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a><br> &gt;&gt;<br>
&gt;&gt; Office <a href="tel:%2B49%2040%2034927219" value="+494034927219">+49 40 \
34927219</a><br> &gt;&gt; Fax <a href="tel:%2B49%2040%2034927220" \
value="+494034927220">+49 40 34927220</a><br> &gt;&gt;<br>
&gt;&gt; Sitz der Gesellschaft: Hamburg<br>
&gt;&gt; Registergericht: Amtsgericht Hamburg, HRB 120189<br>
&gt;&gt; Geschäftsführer: Carsten Bock<br>
&gt;&gt; Ust-ID: DE279344284<br>
&gt;&gt;<br>
&gt;&gt; Hier finden Sie unsere handelsrechtlichen Pflichtangaben:<br>
&gt;&gt; <a href="http://www.ng-voice.com/imprint/" \
target="_blank">http://www.ng-voice.com/imprint/</a><br> &gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; sr-dev mailing list<br>
&gt;&gt; <a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
 &gt;&gt; <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> \
&gt;<br> &gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; sr-dev mailing list<br>
&gt; <a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
&gt; <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> \
&gt;<br> <br>
<br>
<br>
--<br>
Carsten Bock<br>
CEO (Geschäftsführer)<br>
<br>
=============================================================<br>
Visit us on the Kamailio World 2013, 16./17. April 2013<br>
=&gt; <a href="http://conference.kamailio.com/k01/" \
target="_blank">http://conference.kamailio.com/k01/</a>                               \
See<br> you there!<br>
=============================================================<br>
<br>
ng-voice GmbH<br>
Schomburgstr. 80<br>
D-22767 Hamburg / Germany<br>
<br>
<a href="http://www.ng-voice.com" target="_blank">http://www.ng-voice.com</a><br>
mailto:<a href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a><br>
<br>
Office <a href="tel:%2B49%2040%2034927219" value="+494034927219">+49 40 \
34927219</a><br> Fax <a href="tel:%2B49%2040%2034927220" value="+494034927220">+49 40 \
34927220</a><br> <br>
Sitz der Gesellschaft: Hamburg<br>
Registergericht: Amtsgericht Hamburg, HRB 120189<br>
Geschäftsführer: Carsten Bock<br>
Ust-ID: DE279344284<br>
<br>
Hier finden Sie unsere handelsrechtlichen Pflichtangaben:<br>
<a href="http://www.ng-voice.com/imprint/" \
target="_blank">http://www.ng-voice.com/imprint/</a><br> <br>
_______________________________________________<br>
</div></div>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing \
list<br> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
 <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" \
target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br> \
</blockquote></div><br></div></div>



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic