[Kamailio-Users] ERROR:mi_fifo:mi_fifo_server: fifo command must begin with :: early_dialogs (1.5 rev 5834)

Iñaki Baz Castillo ibc at aliax.net
Thu Oct 15 17:08:48 CEST 2009


Hi, I use the Munin plugin I did in various servers running Kamailio
1.5 (Debian 64 bits).
The munin plugins performs the Mi command:

  kamctl fifo get_statistics inuse_transactions

In one of them the installed revision is 5834 and the plugin works
perfectly, no errors in 3 months with high traffic.

However in the other server (revision  5925) there are no traffic yet
but the plugin fails sometimes (maybe once each 2-3 days). Sometimes
it gets an error:
  ERROR:mi_fifo:mi_fifo_server: fifo command must begin with :: early_dialogs

and sometimes it gets wrong value:
  kamctl fifo get_statistics inuse_transactions => 2819624   (with no
traffic !!!)

In the second case the Munin grapsh gets corrupted due to so high value.

Could it be a bug in dialog module?
Should I upgrade to revision 5939 in which I see a change for
modules/dialog/dlg_handlers.c:

-------------------------------------------------------------------------------------------------------------------------
~# svn diff -r HEAD modules/dialog/dlg_handlers.c

Index: modules/dialog/dlg_handlers.c
===================================================================
--- modules/dialog/dlg_handlers.c       (revisión: 5939)
+++ modules/dialog/dlg_handlers.c       (copia de trabajo)
@@ -824,14 +824,13 @@

        if(dlg->toroute>0 && dlg->toroute<RT_NO)
        {
+               dlg_set_ctx_dialog(dlg);
                fmsg = faked_msg_next();
                if (exec_pre_req_cb(fmsg)>0)
                {
-                       dlg_set_ctx_dialog(dlg);
                        LM_DBG("executing route %d on timeout\n", dlg->toroute);
                        set_route_type(REQUEST_ROUTE);
                        run_top_route(rlist[dlg->toroute], fmsg);
-                       dlg_set_ctx_dialog(0);
                        exec_post_req_cb(fmsg);
                }
        }
------------------------------------------------------------------------------------------------------------------------



I see some differences between the dialog module versions running in
both servers, but I think the main difference is a bug fix for the
case in which there is empty Record-Route in the response (Kamailio
crashed before the fix):

-----------------------------------------------------------------------------------------------------------------------
# svn diff -r 5834:5925 modules/dialog/dlg_handlers.c
Index: modules/dialog/dlg_handlers.c
===================================================================
--- modules/dialog/dlg_handlers.c       (revisión: 5834)
+++ modules/dialog/dlg_handlers.c       (revisión: 5925)
@@ -163,10 +163,10 @@
 int populate_leg_info( struct dlg_cell *dlg, struct sip_msg *msg,
        struct cell* t, unsigned int leg, str *tag)
 {
-       unsigned int skip_recs;
-       str cseq;
-       str contact;
-       str rr_set;
+       unsigned int skip_recs = 0;
+       str cseq = {0, 0};
+       str contact = {0, 0};
+       str rr_set = {0, 0};

        /* extract the cseq number as string */
        if (leg==DLG_CALLER_LEG) {
@@ -184,48 +184,41 @@
        /* extract the contact address */
        if (!msg->contact&&(parse_headers(msg,HDR_CONTACT_F,0)<0||!msg->contact)){
                LM_ERR("bad sip message or missing Contact hdr\n");
-               goto error0;
+       } else {
+               if ( parse_contact(msg->contact)<0 ||
+                               ((contact_body_t
*)msg->contact->parsed)->contacts==NULL ||
+                               ((contact_body_t
*)msg->contact->parsed)->contacts->next!=NULL ) {
+                       LM_ERR("bad Contact HDR\n");
+               } else {
+                       contact = ((contact_body_t
*)msg->contact->parsed)->contacts->uri;
+               }
        }
-       if ( parse_contact(msg->contact)<0 ||
-       ((contact_body_t *)msg->contact->parsed)->contacts==NULL ||
-       ((contact_body_t *)msg->contact->parsed)->contacts->next!=NULL ) {
-               LM_ERR("bad Contact HDR\n");
-               goto error0;
-       }
-       contact = ((contact_body_t *)msg->contact->parsed)->contacts->uri;
-
        /* extract the RR parts */
        if(!msg->record_route && (parse_headers(msg,HDR_RECORDROUTE_F,0)<0)  ){
                LM_ERR("failed to parse record route header\n");
-               goto error0;
-       }
-
-       if (leg==DLG_CALLER_LEG) {
-               skip_recs = 0;
        } else {
-               /* was the 200 OK received or local generated */
-               skip_recs = dlg->from_rr_nb +
-                       ((t->relaied_reply_branch>=0)?
-                               (t->uac[t->relaied_reply_branch].added_rr):0);
-       }
+               if (leg==DLG_CALLEE_LEG) {
+                       /* was the 200 OK received or local generated */
+                       skip_recs = dlg->from_rr_nb +
+                               ((t->relaied_reply_branch>=0)?
+
(t->uac[t->relaied_reply_branch].added_rr):0);
+               }

-       if(msg->record_route){
-               if( print_rr_body(msg->record_route, &rr_set, leg,
-                                                       &skip_recs) != 0 ){
-                       LM_ERR("failed to print route records \n");
-                       goto error0;
+               if(msg->record_route){
+                       if( print_rr_body(msg->record_route, &rr_set, leg,
+
&skip_recs) != 0 ){
+                               LM_ERR("failed to print route records \n");
+                       }
                }
-       } else {
-               rr_set.s = 0;
-               rr_set.len = 0;
        }

        if(leg==DLG_CALLER_LEG)
                dlg->from_rr_nb = skip_recs;

        LM_DBG("route_set %.*s, contact %.*s, cseq %.*s and bind_addr %.*s\n",
-               rr_set.len, rr_set.s, contact.len, contact.s,
-               cseq.len, cseq.s,
+               rr_set.len, (rr_set.len)?rr_set.s:"",
+               contact.len, (contact.len)?contact.s:"",
+               cseq.len, (cseq.len)?cseq.s:"",
                msg->rcv.bind_address->sock_str.len,
                msg->rcv.bind_address->sock_str.s);
-----------------------------------------------------------------------------------------------------------------------



Perhaps a regression in rev 5925 so I should upgrade?
Thanks.


-- 
Iñaki Baz Castillo
<ibc at aliax.net>



More information about the Users mailing list