[OpenSIPS-Devel] Error in script

Liviu Chircu liviu at opensips.org
Sat Apr 20 04:35:45 EDT 2019


Should be fixed now -- do let me know if those pesky tokens cause any 
more trouble :)

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 19.04.2019 11:49, Liviu Chircu wrote:
> Indeed, this is caused by the preprocessor extension, which adds some 
> extra tokens which are not consumed because they happen to be enclosed 
> within " ", so the STRING lexer rule takes precedence and includes 
> them.  In short, the acc module actually receives this input:
>
> modparam("acc", "extra_fields", "
> __OSSPP_LINE__ 13
>         log:
> __OSSPP_LINE__ 14
>                 username -> User-Name;
> __OSSPP_LINE__ 15
>                 asserted_identity -> Sip-RPid;
> __OSSPP_LINE__ 16
>                 billing_party -> Billing-Party")
>
> Working on a fix -- currently, the script does not work with 
> multi-line strings.
>
> Liviu Chircu
> OpenSIPS Developer
> http://www.opensips-solutions.com
>
> On 19.04.2019 11:27, Dan Pascu wrote:
>> 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
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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



More information about the Devel mailing list