[asterisk-dev] [Code Review] New "dialplan remove context" and modification of "dialplan add include"

corruptor reviewboard at asterisk.org
Fri Jul 13 04:41:04 CDT 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2042/
-----------------------------------------------------------

Review request for Asterisk Developers.


Summary
-------

I've noticed that we can remove particular extension from context with dialplan remove extension command but in order to remove all extensions in the context we should delete them on by one. I've created dialplan remove context command which uses ast_context_destroy to destroy the whole context with all extensions. I've created to functions for in pbx_config.c: handle_cli_dialplan_remove_context which actually removes context and complete_dialplan_remove_context which completes input. They are based on other similar functions and pretty trivial but I can be mistaken somewhere.

I've also modified dialplan add include <context2> into <context1>. I've made it similar dialplan add extension ... command. It creates <context1> if it doesn't exist and I've also modified complete_dialplan_add_include and removed check for existance of <context2> because we can include non-existent context into another one. (I usually include empty (non-existent) contexts in advance). Should we raise warning in this case as it's raised while reading extensions.conf?

I use those functions with AMI. I think manager commands should be created in addition to those CLI commands.


Diffs
-----

  /trunk/pbx/pbx_config.c 370052 

Diff: https://reviewboard.asterisk.org/r/2042/diff


Testing
-------

We've used both functions very often for the last couple of months and they seem to work good.


Thanks,

corruptor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120713/b5a7eb09/attachment.htm>


More information about the asterisk-dev mailing list