[SR-Users] set empty custom global variable

Daniel-Constantin Mierla miconda at gmail.com
Mon Jun 14 10:04:07 CEST 2021


Have you tried with kamctl, which uses jsonrpc and theoretically you can
pass empty values for parameters?

The binrpc was designed by SER devs during 2005-2008, not sure if there
is any specs for the packet format and whether empty values are
supported or not.

Cheers,
Daniel

On 11.06.21 18:23, Arsen Semenov wrote:
> Then I don’t think it is possible as kamcmd uses kamailio binrpc
> protocol which in turn accepts string or int as an arguments and
> string should be 0 terminated.
>
> I’ve tried to reproduce your use case and execute  kamcmd “cfg.reset
> group” - it should set the value to the default..  but it crushes my
> 5.5.0 
>
> On Fri, 11 Jun 2021 at 8:53 PM, Sergey Safarov <s.safarov at gmail.com
> <mailto:s.safarov at gmail.com>> wrote:
>
>     yes, Arsen, you are correct.
>
>     On Fri, Jun 11, 2021 at 5:20 PM Arsen Semenov <arsperger at gmail.com
>     <mailto:arsperger at gmail.com>> wrote:
>
>         Hello Sergey,
>
>         Am I understanding you right, that you've defined a custom
>         global variable with an empty value in the kamailio.cfg
>         and then want to set a string value to it and then by
>         executing cfg.sets global var_name "" want to clear that value
>         to be blank again? 
>
>         On Fri, Jun 11, 2021 at 4:31 PM Sergey Safarov
>         <s.safarov at gmail.com <mailto:s.safarov at gmail.com>> wrote:
>
>             In Kamailio config I use empty global string variable
>             local.trace_troubleshooting_net = "" descr "trace all SIP
>             messages from given network"
>
>             When I check variable value I get blank string
>             kamcmd cfg.get local trace_troubleshooting_net
>
>             I can set new value
>             [root at host]# kamcmd cfg.sets local
>             trace_troubleshooting_net "2600::/48"
>             [root at host]# kamcmd cfg.get local trace_troubleshooting_net
>             2600::/48
>
>             Now I want to set the empty custom  global variable using
>             a command
>             kamcmd cfg.sets group trace_troubleshooting_net ""
>             But get error
>             error: 400 - error at parameter 2: expected string type
>             but record doesn't match type
>
>             How to properly set empty values?
>
>             __________________________________________________________
>             Kamailio - Users Mailing List - Non Commercial Discussions
>               * sr-users at lists.kamailio.org
>             <mailto:sr-users at lists.kamailio.org>
>             Important: keep the mailing list in the recipients, do not
>             reply only to the sender!
>             Edit mailing list options or unsubscribe:
>               *
>             https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>             <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
>
>
>
>         -- 
>         Arsen Semenov
>
>         __________________________________________________________
>         Kamailio - Users Mailing List - Non Commercial Discussions
>           * sr-users at lists.kamailio.org
>         <mailto:sr-users at lists.kamailio.org>
>         Important: keep the mailing list in the recipients, do not
>         reply only to the sender!
>         Edit mailing list options or unsubscribe:
>           *
>         https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>         <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
>
>     __________________________________________________________
>     Kamailio - Users Mailing List - Non Commercial Discussions
>       * sr-users at lists.kamailio.org <mailto:sr-users at lists.kamailio.org>
>     Important: keep the mailing list in the recipients, do not reply
>     only to the sender!
>     Edit mailing list options or unsubscribe:
>       * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>     <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
>
> -- 
> Sent from Gmail Mobile
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the sender!
> Edit mailing list options or unsubscribe:
>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210614/92555c57/attachment.htm>


More information about the sr-users mailing list