Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: apps/app_chanspy.c
- ===================================================================
- --- apps/app_chanspy.c (revision 347057)
- +++ apps/app_chanspy.c (working copy)
- @@ -168,7 +168,12 @@
- name of the last channel that was spied on will be stored
- in the <variable>SPY_CHANNEL</variable> variable.</para>
- </option>
- - </optionlist>
- + <option name="1">
- + <para>Put ChanSpy in single channel mode. <literal>chanprefix</literal> must be
- + the full name of a channel that exists or ChanSpy will exit immediately. Also
- + causes ChanSpy to exit if the spied channel ends.</para>
- + </option>
- + </optionlist>
- </parameter>
- </syntax>
- <description>
- @@ -367,6 +372,7 @@
- OPTION_DAHDI_SCAN = (1 << 16), /* Scan groups in DAHDIScan mode */
- OPTION_STOP = (1 << 17),
- OPTION_EXITONHANGUP = (1 << 18), /* Hang up when the spied-on channel hangs up. */
- + OPTION_SINGLE_CHANNEL = (1 << 19), /* Single channel mode */
- };
- enum {
- @@ -399,6 +405,7 @@
- AST_APP_OPTION('W', OPTION_PRIVATE),
- AST_APP_OPTION_ARG('x', OPTION_DTMF_EXIT, OPT_ARG_EXIT),
- AST_APP_OPTION('X', OPTION_EXIT),
- + AST_APP_OPTION('1', OPTION_SINGLE_CHANNEL),
- });
- struct chanspy_translation_helper {
- @@ -765,6 +772,9 @@
- ast_channel_unlock(chan);
- }
- + if (ast_test_flag(flags, OPTION_SINGLE_CHANNEL))
- + ast_set_flag(flags, OPTION_EXITONHANGUP);
- +
- if (chan->_state != AST_STATE_UP)
- ast_answer(chan);
- @@ -797,7 +807,9 @@
- /* Set up the iterator we'll be using during this call */
- if (!ast_strlen_zero(spec)) {
- - iter = ast_channel_iterator_by_name_new(spec, strlen(spec));
- + iter = ast_channel_iterator_by_name_new(
- + spec,
- + ast_test_flag(flags, OPTION_SINGLE_CHANNEL) ? 0 : strlen(spec));
- } else if (!ast_strlen_zero(exten)) {
- iter = ast_channel_iterator_by_exten_new(exten, context);
- } else {
Add Comment
Please, Sign In to add comment