[OpenSIPS-Devel] Error in script

Dan Pascu dan at ag-projects.com
Fri Apr 19 04:27:16 EDT 2019


On 19 Apr 2019, at 8:38, Liviu Chircu wrote:

> Can you try to skip the backslashes?  Syntactically, it should work without them.

Removing them changes nothing. What fixes it is if I put everything on a single line (remove both backslashes and newlines between items). It used to work with backslashes and multiple lines in 2.4.

>  If that doesn't fix it, please paste your exact global acc settings (loadmodule + modparams) or the whole o.cfg file (if possible), so I can try to reproduce.

Here is a minimalistic configuration that triggers the problem (you'll have to adjust mpath):

-----------------------------

mpath = "/home/dan/work/opensips/test-3.0/opensips/modules"
loadmodule "tm.so"
loadmodule "acc.so"

modparam("acc", "extra_fields", "aaa:
                                 username -> User-Name;
                                 asserted_identity -> Sip-RPid;
                                 billing_party -> Billing-Party")

modparam("acc", "extra_fields", "log:
                                 username -> User-Name;
                                 asserted_identity -> Sip-RPid;
                                 billing_party -> Billing-Party")

route {
    $acc_extra(username) := $Au;
    $acc_extra(asserted_identity) := $avp(asserted_identity);
    $acc_extra(billing_party) := $avp(billing_party);
}

-----------------------------------

> 
> Liviu Chircu
> OpenSIPS Developer
> http://www.opensips-solutions.com
> 
> On 18.04.2019 20:07, Dan Pascu wrote:
>> I get this error reported in script:
>> 
>> Apr 18 20:02:02 [21404] ERROR:acc:pv_parse_acc_extra_name: tag <username> not declared in modparam section!
>> Apr 18 20:02:02 [21404] ERROR:core:pv_parse_spec: pvar "acc_extra" has an invalid name param [username]
>> Apr 18 20:02:02 [21404] ERROR:core:pv_parse_spec: wrong char [)/41] in [$acc_extra(username)] at [19 (5)]
>> Apr 18 20:02:02 [21404] Traceback (last included file at the bottom):
>> Apr 18 20:02:02 [21404]  0. o.cfg
>> Apr 18 20:02:02 [21404] CRITICAL:core:yyerror: parse error in o.cfg:2288:5-25: unknown script variable
>> Apr 18 20:02:02 [21404] #
>> Apr 18 20:02:02 [21404] route[SETUP_ACCOUNTING] {
>> Apr 18 20:02:02 [21404]     $acc_extra(username) := $Au;
>> Apr 18 20:02:02 [21404]     ^~~~~~~~~~~~~~~~~~~~~
>> Apr 18 20:02:02 [21404]     $acc_extra(asserted_identity) := $avp(asserted_identity);
>> Apr 18 20:02:02 [21404]     $acc_extra(billing_party) := $avp(billing_party);
>> Apr 18 20:02:02 [21404] ERROR:acc:pv_parse_acc_extra_name: tag <asserted_identity> not declared in modparam section!
>> Apr 18 20:02:02 [21404] ERROR:core:pv_parse_spec: pvar "acc_extra" has an invalid name param [asserted_identity]
>> Apr 18 20:02:02 [21404] ERROR:core:pv_parse_spec: wrong char [)/41] in [$acc_extra(asserted_identity)] at [28 (5)]
>> Apr 18 20:02:02 [21404] CRITICAL:core:yyerror: parse error in o.cfg:2289:5-34: unknown script variable
>> Apr 18 20:02:02 [21404] ERROR:acc:pv_parse_acc_extra_name: tag <billing_party> not declared in modparam section!
>> Apr 18 20:02:02 [21404] ERROR:core:pv_parse_spec: pvar "acc_extra" has an invalid name param [billing_party]
>> Apr 18 20:02:02 [21404] ERROR:core:pv_parse_spec: wrong char [)/41] in [$acc_extra(billing_party)] at [24 (5)]
>> 
>> 
>> However username is declared in extra fields (this worked fine in 2.4):
>> 
>> modparam("acc", "extra_fields", "aaa: \
>>                                  username -> User-Name; \
>>                                  asserted_identity -> Sip-RPid; \
>>                                  billing_party -> Billing-Party; \
>>                                  ...")
>> 
>> --
>> Dan
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Devel mailing list
>> Devel at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
> 
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


--
Dan







More information about the Devel mailing list