[OpenSIPS-Users] Need some help adding extra column in acc table in oepsnisp-1.11

Sasmita Panda spanda at 3clogic.com
Wed Sep 6 06:20:15 EDT 2017


Thank you so much . I have tried this and its working for default
parameters of opensips . like $fU , $oU , $rd etc .

When I am adding trying to save some data in user define variable like
below , its not getting saved in every call .
May be I am doing something wrong . Please have a look into the script and
suggest the solution .


modparam("acc", "db_extra", "cc_info=$var(c);caller=$fU;
callee=$oU;carrier=$rd")

route{
$var(c)="NULL";
$var(d)="NULL";
$var(e)="NULL";
$var(f)="NULL";

  if (is_method("INVITE")) {

                        if(is_present_hf("X-Info"))
                       {
                        $var(c)=$hdr(X-Info);

                       }
                        #Set the flag for counting the dialogs. We user
flag=4 for counting dialogs
                  #      setflag(4);
                        xlog( "L_NOTICE", "CallCenter_Info & $ci,$var(c)
\n" );
                         xlog( "L_NOTICE", "3CLogicCDR & $ci,$fU,$oU,$rd
\n" );

                        setflag(3);
                        setflag(2);
                        setflag(1);
}}

In the cc_info column , sometime value get filled and sometime its filled
as NULL . Why this is happening . Why its saving the default value which I
defined in the starting .


can I pass this information in pseudo-variables . If yes then how I will do
this ?

*Thanks & Regards*
*Sasmita Panda*
*Network Testing and Software Engineer*
*3CLogic , ph:07827611765*

On Tue, Sep 5, 2017 at 3:24 PM, Răzvan Crainea <razvan at opensips.org> wrote:

> Yes, you need to create the columns in the database.
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Developerwww.opensips-solutions.com
>
> On 09/05/2017 12:43 PM, Sasmita Panda wrote:
>
> Hi All ,
>
>         I am using opensips-1.11 with acc module . Trying to add extra
> columns in it to store some other data which is needed for billing .
>
>         I am trying to add like bellow .
>
> modparam("acc", "db_url", "mysql://root:root@x.x.x.x/opensips_1_11"
> <mysql://root:root@x.x.x.x/opensips_1_11>)
> modparam("acc", "db_flag", 2)
> modparam("acc", "log_flag", 3)
> modparam("acc", "cdr_flag", 1)
> modparam("acc", "db_extra", "from_uri=$fU; to_uri=$tU")
>
>
>  route{
>
>          if (method == "INVITE") {
>                  create_dialog();
>                  setflag(1);
>                  setflag(2); # do accounting ...
>                  record_route();
>                  xlog("INBOUND CALL,$dd,$ru,$ci,$fn,$fu");
>                  route(10);
>                  exit;
>          }
>
>
> When the cdr getting stored , its giving error .
>
>  CRITICAL:db_mysql:wrapper_single_mysql_stmt_prepare: driver error
> (1054): Unknown column 'from_uri' in 'field list'
>  ERROR:db_mysql:db_mysql_do_prepared_query: failed to create new context
>  ERROR:acc:acc_db_cdrs: failed to insert into database
>  ERROR:acc:acc_dlg_callback: Cannot insert into database
>
>
>       What should I do for the above error . Will I need to create the
> columns first in acc table then I can insert extra column or what ?
>
>        Thank you in advance . Any kind of suggestion is appreciated.
>
> *Thanks & Regards*
> *Sasmita Panda*
> *Network Testing and Software Engineer*
> *3CLogic , ph:07827611765*
>
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170906/cf6b94d3/attachment.html>


More information about the Users mailing list