Hi, Jayesh!

It seems like the problem appears while parsing the string got from the database, so after opensips is restarted. The patch attached should give us more information about the error.

Regards,

--
Răzvan Crainea
OpenSIPS Developer


On 12/07/2011 12:37 PM, Jayesh Nambiar wrote:
This is the string what I see when I query the dialog table for vars:

accX_flags#   |accX_db#(  2 1
 1000000001 1002
                 12013386166
919833171405 0 203.153.53.158 203.153.53.136 0 17 0 2 IP India - Mobile 919 9198 2 1 2 4 0.0150 0.0130 0 0.0000 0.0226 1.0000 6 1 6 1 1 2 2 2
 Aal Izz Well
Aal Izz Well 1 3 1.2.3.4|accX_leg# |accX_core# INVITE/ 100eb870-9e3599cb-13c4-50029-3b71-60de50d0-3b71\# 97.208.30.751120+1+31850054+b8c0a68/ 100f7670-9e3599cb-13c4-50029-3b71-3c625412-3b71 200 O á=ÃN |accX_created#Ã=ÃN |

--- Jayesh

On Wed, Dec 7, 2011 at 4:00 PM, Razvan Crainea <razvancrai...@opensips.org <mailto:razvancrai...@opensips.org>> wrote:

    Hi, Jayesh!

    And what is the string in the database? You can see it in the
    database after you kill opensips with the following command:

    select vars from dialog;


    Regards,

    --
    Răzvan Crainea
    OpenSIPS Developer


    On 12/07/2011 12:24 PM, Jayesh Nambiar wrote:
    Hi Razvan,
    Applied the patch and re-tested it. Here the logs that you are
    interested in specifically:

    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: Dumping var name: <accX_flags> value: <#026>
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: compare char 22 - 0 - 11
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: compare char 0 - 1 - 12
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: compare char 0 - 2 - 13
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: compare char 0 - 3 - 14
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: Serialized string <accX_flags##026> (16)
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 0) char: a hex: 61
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 1) char: c hex: 63
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 2) char: c hex: 63
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 3) char: X hex: 58
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 4) char: _ hex: 5F
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 5) char: f hex: 66
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 6) char: l hex: 6C
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 7) char: a hex: 61
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 8) char: g hex: 67
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 9) char: s hex: 73
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 10) char: # hex: 23
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 11) char: #026 hex: 16
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 12) char: #000 hex: 00
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 13) char: #000 hex: 00
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 14) char: #000 hex: 00
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: 15) char: | hex: 7C
    Dec  7 15:50:33 dev /usr/local/sbin/opensips[8011]:
    DBG:dialog:write_pair: Dumping var name: <accX_db> value: <(>

    Apart from this, I have pasted everything in syslog after
    opensips shutdown in the paste-bin here:
    http://pastebin.com/gx0ZxFLb

    Let me know if there is anything more to test.

    --- Jayesh

    On Wed, Dec 7, 2011 at 3:36 PM, Razvan Crainea
    <razvancrai...@opensips.org <mailto:razvancrai...@opensips.org>>
    wrote:

        Sorr, I forgot to attach it. Here it is.


        Regards,

        --
        Răzvan Crainea
        OpenSIPS Developer


        On 12/07/2011 11:59 AM, Jayesh Nambiar wrote:
        Hi Razvan,
        I don't see the patch attached !!

        --- Jayesh

        On Wed, Dec 7, 2011 at 2:57 PM, Razvan Crainea
        <razvancrai...@opensips.org
        <mailto:razvancrai...@opensips.org>> wrote:

            Hi, Jayesh !

            The root of the problem is the accX_flags dialog
            variable isn't properly serialized. What I'm trying to
            find out is why this happens, that's why I will need
            some extra debug as I can't figure out the problem
            there. So please apply this last patch and try again. It
            should be applied after the previous patch I've sent
            you, so you won't need another fresh checkout.
            This time there will be a lot of dumped info in the log,
            so I would really appreciate if you could send them over
            pastebin. The only part that I will be interested in is
            between these lines:


            DBG:dialog:write_pair: Dumping var name: <accX_flags>
            value: <#026>

            and


            DBG:dialog:write_pair: Dumping var name: <accX_db>
            value: <(>

            Thank you very much for testing!
            Regards,

            --
            Răzvan Crainea
            OpenSIPS Developer


            On 12/06/2011 07:57 PM, Jayesh Nambiar wrote:
            Hi Razvan,
            I just did a fresh download from
            http://opensips.org/pub/opensips/latest/src/. I did
            apply the patch successfully and I still have the
            problem of CDR not being recorded after restart. Here
            is the syslog pasted after opensips was being shut down:

            Dec  6 20:20:13 dev /usr/local/sbin/opensips[
            15700]: DBG:dialog:dialog_update_db: inserting new
            dialog 0x7f3d323bd5f8
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Dumping var name: <accX_flags>
            value: <#026>
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Serialized string
            <accX_flags##026> (16)
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Dumping var name: <accX_db>
            value: <(>
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Serialized string <accX_db#(> (263)
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Dumping var name: <accX_leg>
            value: <>
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Serialized string <accX_leg#> (14)
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Dumping var name: <accX_core>
            value: <#006>
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: escaping char 53
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Serialized string
            <accX_core##006> (165)
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Dumping var name: <accX_created>
            value: <<95>+ÃN>
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Serialized string
            <accX_created#<95>+ÃN> (22)
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_dialog_vars: var string is
            <accX_flags##026>(480)
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Dumping var name:
            <carrierChannels> value: <1002>
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Serialized string
            <carrierChannels#1002|> (21)
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Dumping var name:
            <carrierChannels> value: <1003>
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Serialized string
            <carrierChannels#1003|> (21)
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Dumping var name:
            <carrierChannels> value: <1007>
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_pair: Serialized string
            <carrierChannels#1007|> (21)
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:dialog:write_dialog_profiles: profile string is
            
<carrierChannels#1002|carrierChannels#1003|carrierChannels#1007|>(63)
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:db_mysql:has_stmt_ctx: ctx found for dialog
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:db_mysql:db_mysql_do_prepared_query: conn=0x810858
            (tail=8454488) MC=0x8101b8
            Dec  6 20:20:13 dev /usr/local/sbin/opensips[15700]:
            DBG:db_mysql:db_mysql_do_prepared_query: set values for
            the statement run

            I hope this will help you figure out something more
            relevant.


            --- Jayesh


            On Tue, Dec 6, 2011 at 7:56 PM, Razvan Crainea
            <razvancrai...@opensips.org
            <mailto:razvancrai...@opensips.org>> wrote:

                Hi, Jayesh!

                Can you post your dlg_db_handler.c file on
                pastebin? I think you are using an old version of
                the dialog module, and that's why you have this
                problem.


                Regards,

                --
                Răzvan Crainea
                OpenSIPS Developer




--- modules/dialog/dlg_db_handler.c	2011-12-07 13:04:25.056302523 +0200
+++ modules/dialog/dlg_db_handler.c	2011-12-07 13:05:02.304302247 +0200
@@ -312,7 +312,7 @@
 	name->len = b - name->s;
 	if (name->len==0) goto skip;
 	strip_esc(name);
-	/*LM_DBG("-----read name <%.*s>(%d)\n",name->len,name->s,name->len);*/
+	LM_DBG("-----read name <%.*s>(%d)\n",name->len,name->s,name->len);
 
 	/* read # */
 	b++;
@@ -320,20 +320,24 @@
 	/* read value */
 	val->s = b;
 	while( b<end && !( (*b=='|'|| *b=='#') &&
-				(*(b-1)!='\\' || *(b-2)=='\\')) )
+				(*(b-1)!='\\' || *(b-2)=='\\')) ) {
+		LM_DBG("Passing over %d\n", *b);
 		b++;
+	}
 	if (b==end) return NULL;
+	LM_DBG("At this point the string is %s [%d]\n", b, strlen(b));
 	if (*b=='#') goto skip;
 	val->len = b - val->s;
 	if (val->len==0) val->s = 0;
 	strip_esc(val);
-	/*LM_DBG("-----read value <%.*s>(%d)\n",val->len,val->s,val->len);*/
+	LM_DBG("-----read value <%.*s>(%d)\n",val->len,val->s,val->len);
 
 	/* read | */
 	b++;
 	return b;
 
 skip:
+	LM_DBG("skipping to next token %d - %d\n", *b, end - b);
 	while(b<end && *b=='|' && *(b-1)!='\\') b++;
 	if (b!=end) b++;
 	return (b==end)?NULL:b;
@@ -351,7 +355,10 @@
 	do {
 		/* read a new pair from input string */
 		p = read_pair( p, end, &name, &val);
-		if (p==NULL) break;
+		if (p==NULL) {
+			LM_DBG("Unable to parse var\n");
+			break;
+		}
 
 		if (val.len==0) continue;
 
@@ -520,6 +527,8 @@
 			if (!VAL_NULL(values+18))
 				read_dialog_vars( VAL_STR(values+18).s,
 					VAL_STR(values+18).len, dlg);
+			else
+				LM_DBG("Dialog Variables are null\n");
 
 			/* profiles */
 			if (!VAL_NULL(values+19))
_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to