AMI and updateconfig

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm using the AMI to change configuration using the updateconfig command, for example:
action: updateconfig
reload: yes
srcfilename: test.conf
dstfilename: test.conf
Action-000000: update
Cat-000000: general
Var-000000: maxsecs
Value-000000: 500

Now the problem is, whenever I execute the above action, asterisk includes an extra \n in the file. So changing the same value 10 times gives 10 bytes of "garbage".

I did some reading of the Asterisk source code, and it seems to me there's a bug (or flawed design?) regarding UpdateConfig.

In utils/astman.c, function input_check, get_input is used to read lines from the session. Each line is added to m.headers, but this includes the end-line (\r\n) characters.
After receiving a complete message, process_message is called, which in the end calls main/manager.c function handle_updates for actually performing the config update. In there, ast_variable_update is called to update the value of the variable with the exact header value, which includes \r\n. When looking on disk, the empty rows are \n characters. How to work solve this issue, or work around it?

With regards,
Matthijs ter Woord

_______________________________________________
asterisk-app-dev mailing list
asterisk-app-dev@xxxxxxxxxxxxxxxx
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev

[Index of Archives]     [Asterisk SS7]     [Asterisk Announcements]     [Asterisk Users]     [PJ SIP]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Linux API]

  Powered by Linux