[OpenSIPS-Users] opensips lua

Vlad Patrascu vladp at opensips.org
Tue Jan 14 06:37:22 EST 2020


I still don't think it is AVP_set function's fault for the whitespaces. 
Make sure that the string you produce in lua and want to return to 
opensips doesn't have a newline character at the end. It seems that 
syslog prints a newline as "#012" sometimes (if it's not actually at the 
end of a message).

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com

On 1/13/20 3:26 PM, volga629 via Users wrote:
> Hello Vlad,
> Yes, it still in issue, but we have work around.  #012 it insert white 
> spaces.
>
> $avp(sms-out) = $(avp(formatted-msg){s.trimr});
>
> On Mon, Jan 13, 2020 at 12:26, Vlad Patrascu <vladp at opensips.org> wrote:
>>
>> Hi Volga,
>>
>> Sorry for getting to this so late. Do you still encounter this issue? 
>> I have tried to reproduce this myself but it seems that AVP_set() 
>> does set the value correctly.
>>
>> Regards,
>>
>> Vlad Patrascu
>> OpenSIPS Developer
>> http://www.opensips-solutions.com
>> On 12/14/19 7:12 AM, volga629 via Users wrote:
>>> Hello Everyone,
>>> Having some issue get lua to set proper avp.  When it set in insert 
>>> some extra characters into value of avp
>>> Here are log
>>>
>>>
>>> Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: 
>>> test::wwwww nah.uy/u5bmnc
>>> Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: Tested 
>>> string ~>0
>>> Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: SMS_ROUTE_IN: 
>>> Test string ~> [0#012]
>>>
>>> It insert #012
>>>
>>> Lua script
>>>
>>>                 local cmd_var = handle:read("*all")
>>>                 handle:close()
>>>                 xlog("Tested string ~> " .. cmd_var .. "\n")
>>>                 r eturn AVP_set("test-str", cmd_var)
>>>
>>> Any help thank you
>>>
>>> volga629
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://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/20200114/a7b74150/attachment.html>


More information about the Users mailing list