[Kamailio-Users] Debugging Openser v1.4 scripts

Jim Burke jim at evolutiontel.net
Mon Aug 4 16:57:39 CEST 2008


Hi Daniel,

After  a lot of trial and error I have worked it out!

The following portion of script causes the error in both 1.3 and 1.4,
however not in 1.2.  Root cause is that I have not added "" in my case
statements.

I.e. case 404: should be case "404":



The var reply_status is set from PV $rs in a on_reply or on_failure route
using $var(reply_status) = $rs;.

  switch($(var(reply_status)))
  {
    case 404: #Not Found
      xlog("L_INFO", "[$rm] from <$fu> <$si:$sp> to <$tu>  Terminating UA
Not Found R4\n");
      seturi("sip:rva404 at domain");
      $(avp(early_code)) = "404";
      $(avp(early_reason)) = "Not Found!";
      append_hf("P-App-name: early_announcement\r\n");
      append_hf("P-App-Param:
Final-Reply-Code=$(avp(early_code));Final-Reply-Reason=$(avp(early_reason));
");
      break;
SNIP
    default:
      sl_send_reply("$(var(reply_status))","$(var(reply_reason)))");
      xlog("L_INFO", "[$rm] from <$fu> <$si:$sp> to <$tu>  Default Route
4\n");
      exit;
      break;
  }

Let me know if you consider this a bug and I will open a ticket.

Regards,
Jim
-----Original Message-----
From: Jim Burke [mailto:jim at evolutiontel.net]
Sent: Saturday, 2 August 2008 11:28 PM
To: miconda at gmail.com
Cc: users at lists.kamailio.org
Subject: RE: [Kamailio-Users] Debugging Openser v1.4 scripts


Hi Daniel,

Have been busy, will send yuo the config shortly.  For my information how do
you plan to find the corrupt line.  Is there something in GDB that can help
us set a tracepoint and identify it?

Regards,
Jim

-----Original Message-----
From: Daniel-Constantin Mierla [mailto:miconda at gmail.com]
Sent: Wednesday, 30 July 2008 12:03 AM
To: Jim Burke
Cc: users at lists.kamailio.org
Subject: Re: [Kamailio-Users] Debugging Openser v1.4 scripts


Hello,

On 07/29/08 15:43, Jim Burke wrote:
> Hi All,
>
> We are working to get our script working on Version 1.4 and are having
> problems debugging the script.  Previously if I saw the following error in
> the logs it would highlight the line and colomb numbers were the error
> existed.  Can someone help out?
>
> Jul 29 22:29:18 [19064] CRITICAL:core:yyerror: parse error in config file,
> line 9459656, column 1-1: syntax error
> Jul 29 22:29:18 [19064] CRITICAL:core:yyerror: parse error in config file,
> line 9459656, column 1-1: bad command!)
> Jul 29 22:29:18 [19064] ERROR:core:main: bad config file (2 errors)
>
it should still show the line and column where error occurred, but here
is something wrong with the line. Can you obfuscate the private details
in the config (passwords, ip addresses) and send it to me?

Cheers,
Daniel

> Thanks,
> Jim
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.kamailio.org
> http://lists.openser.org/cgi-bin/mailman/listinfo/users
>

--
Daniel-Constantin Mierla
http://www.asipto.com






More information about the sr-users mailing list