Sat Apr 26 2014 22:02:51

Asterisk developer's documentation


func_channel.c File Reference

Channel info dialplan functions. More...

#include "asterisk.h"
#include <regex.h>
#include <ctype.h>
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
#include "asterisk/app.h"
#include "asterisk/indications.h"
#include "asterisk/stringfields.h"
#include "asterisk/global_datastores.h"
Include dependency graph for func_channel.c:

Go to the source code of this file.

Defines

#define locked_copy_string(chan, dest, source, len)
#define locked_string_field_set(chan, field, source)

Functions

static void __reg_module (void)
static void __unreg_module (void)
static int func_channel_read (struct ast_channel *chan, const char *function, char *data, char *buf, size_t len)
static int func_channel_write (struct ast_channel *chan, const char *function, char *data, const char *value)
static int func_channel_write_real (struct ast_channel *chan, const char *function, char *data, const char *value)
static int func_channels_read (struct ast_channel *chan, const char *function, char *data, char *buf, size_t maxlen)
static int func_mchan_read (struct ast_channel *chan, const char *function, char *data, struct ast_str **buf, ssize_t len)
static int func_mchan_write (struct ast_channel *chan, const char *function, char *data, const char *value)
static int load_module (void)
static int unload_module (void)

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Channel information dialplan functions" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, }
static struct ast_module_infoast_module_info = &__mod_info
static struct ast_custom_function channel_function
static struct ast_custom_function channels_function
static struct ast_custom_function mchan_function
static const char *const transfercapability_table [0x20]

Detailed Description

Channel info dialplan functions.

Author:
Kevin P. Fleming <kpfleming@digium.com>
Ben Winslow

Definition in file func_channel.c.


Define Documentation

#define locked_copy_string (   chan,
  dest,
  source,
  len 
)
Value:
do { \
      ast_channel_lock(chan); \
      ast_copy_string(dest, source, len); \
      ast_channel_unlock(chan); \
   } while (0)

Definition at line 383 of file func_channel.c.

Referenced by func_channel_read().

#define locked_string_field_set (   chan,
  field,
  source 
)
Value:
do { \
      ast_channel_lock(chan); \
      ast_channel_##field##_set(chan, source); \
      ast_channel_unlock(chan); \
   } while (0)

Definition at line 389 of file func_channel.c.

Referenced by func_channel_write_real().


Function Documentation

static void __reg_module ( void  ) [static]

Definition at line 852 of file func_channel.c.

static void __unreg_module ( void  ) [static]

Definition at line 852 of file func_channel.c.

static int func_channel_read ( struct ast_channel chan,
const char *  function,
char *  data,
char *  buf,
size_t  len 
) [static]

Definition at line 402 of file func_channel.c.

References ast_bridged_channel(), ast_channel_accountcode(), ast_channel_amaflags(), ast_channel_appl(), ast_channel_callgroup(), ast_channel_cdr(), ast_channel_context(), ast_channel_data(), ast_channel_datastore_find(), ast_channel_exten(), ast_channel_hangupsource(), ast_channel_language(), ast_channel_linkedid(), ast_channel_lock, ast_channel_musicclass(), ast_channel_name(), ast_channel_named_callgroups(), ast_channel_named_pickupgroups(), ast_channel_nativeformats(), ast_channel_parkinglot(), ast_channel_peeraccount(), ast_channel_pickupgroup(), ast_channel_readformat(), ast_channel_tech(), ast_channel_transfercapability(), ast_channel_uniqueid(), ast_channel_unlock, ast_channel_userfield(), ast_channel_writeformat(), ast_channel_zone(), ast_check_hangup(), ast_copy_string(), ast_format_cap_destroy(), ast_format_cap_get_type(), AST_FORMAT_TYPE_AUDIO, AST_FORMAT_TYPE_VIDEO, ast_getformatname(), ast_getformatname_multiple(), ast_log(), ast_print_group(), ast_print_namedgroups(), ast_state2str(), ast_str_alloca, ast_strlen_zero(), country, ast_datastore::data, locked_copy_string, LOG_WARNING, ast_secure_call_store::media, pbx_builtin_getvar_helper(), secure_call_info, ast_secure_call_store::signaling, and type.

{
   int ret = 0;
   struct ast_format_cap *tmpcap;

   if (!chan) {
      ast_log(LOG_WARNING, "No channel was provided to %s function.\n", function);
      return -1;
   }

   if (!strcasecmp(data, "audionativeformat")) {
      char tmp[512];

      if ((tmpcap = ast_format_cap_get_type(ast_channel_nativeformats(chan), AST_FORMAT_TYPE_AUDIO))) {
         ast_copy_string(buf, ast_getformatname_multiple(tmp, sizeof(tmp), tmpcap), len);
         tmpcap = ast_format_cap_destroy(tmpcap);
      }
   } else if (!strcasecmp(data, "videonativeformat")) {
      char tmp[512];

      if ((tmpcap = ast_format_cap_get_type(ast_channel_nativeformats(chan), AST_FORMAT_TYPE_VIDEO))) {
         ast_copy_string(buf, ast_getformatname_multiple(tmp, sizeof(tmp), tmpcap), len);
         tmpcap = ast_format_cap_destroy(tmpcap);
      }
   } else if (!strcasecmp(data, "audioreadformat")) {
      ast_copy_string(buf, ast_getformatname(ast_channel_readformat(chan)), len);
   } else if (!strcasecmp(data, "audiowriteformat")) {
      ast_copy_string(buf, ast_getformatname(ast_channel_writeformat(chan)), len);
#ifdef CHANNEL_TRACE
   } else if (!strcasecmp(data, "trace")) {
      ast_channel_lock(chan);
      ast_copy_string(buf, ast_channel_trace_is_enabled(chan) ? "1" : "0", len);
      ast_channel_unlock(chan);
#endif
   } else if (!strcasecmp(data, "tonezone") && ast_channel_zone(chan))
      locked_copy_string(chan, buf, ast_channel_zone(chan)->country, len);
   else if (!strcasecmp(data, "language"))
      locked_copy_string(chan, buf, ast_channel_language(chan), len);
   else if (!strcasecmp(data, "musicclass"))
      locked_copy_string(chan, buf, ast_channel_musicclass(chan), len);
   else if (!strcasecmp(data, "name")) {
      locked_copy_string(chan, buf, ast_channel_name(chan), len);
   } else if (!strcasecmp(data, "parkinglot"))
      locked_copy_string(chan, buf, ast_channel_parkinglot(chan), len);
   else if (!strcasecmp(data, "state"))
      locked_copy_string(chan, buf, ast_state2str(ast_channel_state(chan)), len);
   else if (!strcasecmp(data, "channeltype"))
      locked_copy_string(chan, buf, ast_channel_tech(chan)->type, len);
   else if (!strcasecmp(data, "accountcode"))
      locked_copy_string(chan, buf, ast_channel_accountcode(chan), len);
   else if (!strcasecmp(data, "checkhangup")) {
      ast_channel_lock(chan);
      ast_copy_string(buf, ast_check_hangup(chan) ? "1" : "0", len);
      ast_channel_unlock(chan);
   } else if (!strcasecmp(data, "peeraccount"))
      locked_copy_string(chan, buf, ast_channel_peeraccount(chan), len);
   else if (!strcasecmp(data, "hangupsource"))
      locked_copy_string(chan, buf, ast_channel_hangupsource(chan), len);
   else if (!strcasecmp(data, "appname") && ast_channel_appl(chan))
      locked_copy_string(chan, buf, ast_channel_appl(chan), len);
   else if (!strcasecmp(data, "appdata") && ast_channel_data(chan))
      locked_copy_string(chan, buf, ast_channel_data(chan), len);
   else if (!strcasecmp(data, "exten") && ast_channel_data(chan))
      locked_copy_string(chan, buf, ast_channel_exten(chan), len);
   else if (!strcasecmp(data, "context") && ast_channel_data(chan))
      locked_copy_string(chan, buf, ast_channel_context(chan), len);
   else if (!strcasecmp(data, "userfield") && ast_channel_data(chan))
      locked_copy_string(chan, buf, ast_channel_userfield(chan), len);
   else if (!strcasecmp(data, "channame") && ast_channel_data(chan))
      locked_copy_string(chan, buf, ast_channel_name(chan), len);
   else if (!strcasecmp(data, "linkedid")) {
      ast_channel_lock(chan);
      if (ast_strlen_zero(ast_channel_linkedid(chan))) {
         /* fall back on the channel's uniqueid if linkedid is unset */
         ast_copy_string(buf, ast_channel_uniqueid(chan), len);
      }
      else {
         ast_copy_string(buf, ast_channel_linkedid(chan), len);
      }
      ast_channel_unlock(chan);
   } else if (!strcasecmp(data, "peer")) {
      struct ast_channel *p;

      ast_channel_lock(chan);
      p = ast_bridged_channel(chan);
      if (p || ast_channel_tech(chan) || ast_channel_cdr(chan)) /* dummy channel? if so, we hid the peer name in the language */
         ast_copy_string(buf, (p ? ast_channel_name(p) : ""), len);
      else {
         /* a dummy channel can still pass along bridged peer info via
                           the BRIDGEPEER variable */
         const char *pname = pbx_builtin_getvar_helper(chan, "BRIDGEPEER");
         if (!ast_strlen_zero(pname))
            ast_copy_string(buf, pname, len); /* a horrible kludge, but... how else? */
         else
            buf[0] = 0;
      }
      ast_channel_unlock(chan);
   } else if (!strcasecmp(data, "uniqueid")) {
      locked_copy_string(chan, buf, ast_channel_uniqueid(chan), len);
   } else if (!strcasecmp(data, "transfercapability")) {
      locked_copy_string(chan, buf, transfercapability_table[ast_channel_transfercapability(chan) & 0x1f], len);
   } else if (!strcasecmp(data, "callgroup")) {
      char groupbuf[256];

      locked_copy_string(chan, buf,  ast_print_group(groupbuf, sizeof(groupbuf), ast_channel_callgroup(chan)), len);
   } else if (!strcasecmp(data, "pickupgroup")) {
      char groupbuf[256];

      locked_copy_string(chan, buf,  ast_print_group(groupbuf, sizeof(groupbuf), ast_channel_pickupgroup(chan)), len);
   } else if (!strcasecmp(data, "namedcallgroup")) {
      struct ast_str *tmp_str = ast_str_alloca(1024);

      locked_copy_string(chan, buf,  ast_print_namedgroups(&tmp_str, ast_channel_named_callgroups(chan)), len);
   } else if (!strcasecmp(data, "namedpickupgroup")) {
      struct ast_str *tmp_str = ast_str_alloca(1024);

      locked_copy_string(chan, buf,  ast_print_namedgroups(&tmp_str, ast_channel_named_pickupgroups(chan)), len);
   } else if (!strcasecmp(data, "amaflags")) {
      ast_channel_lock(chan);
      snprintf(buf, len, "%d", ast_channel_amaflags(chan));
      ast_channel_unlock(chan);
   } else if (!strncasecmp(data, "secure_bridge_", 14)) {
      struct ast_datastore *ds;

      ast_channel_lock(chan);
      if ((ds = ast_channel_datastore_find(chan, &secure_call_info, NULL))) {
         struct ast_secure_call_store *encrypt = ds->data;
         if (!strcasecmp(data, "secure_bridge_signaling")) {
            snprintf(buf, len, "%s", encrypt->signaling ? "1" : "");
         } else if (!strcasecmp(data, "secure_bridge_media")) {
            snprintf(buf, len, "%s", encrypt->media ? "1" : "");
         }
      }
      ast_channel_unlock(chan);
   } else if (!ast_channel_tech(chan) || !ast_channel_tech(chan)->func_channel_read || ast_channel_tech(chan)->func_channel_read(chan, function, data, buf, len)) {
      ast_log(LOG_WARNING, "Unknown or unavailable item requested: '%s'\n", data);
      ret = -1;
   }

   return ret;
}
static int func_channel_write ( struct ast_channel chan,
const char *  function,
char *  data,
const char *  value 
) [static]

Definition at line 699 of file func_channel.c.

References AST_CHAN_WRITE_INFO_T_VERSION, ast_channel_setoption(), ast_log(), AST_OPTION_CHANNEL_WRITE, ast_channel::data, func_channel_write_real(), LOG_WARNING, value, and ast_chan_write_info_t::version.

Referenced by func_channel_write_real().

{
   int res;
   ast_chan_write_info_t write_info = {
      .version = AST_CHAN_WRITE_INFO_T_VERSION,
      .write_fn = func_channel_write_real,
      .chan = chan,
      .function = function,
      .data = data,
      .value = value,
   };

   if (!chan) {
      ast_log(LOG_WARNING, "No channel was provided to %s function.\n", function);
      return -1;
   }

   res = func_channel_write_real(chan, function, data, value);
   ast_channel_setoption(chan, AST_OPTION_CHANNEL_WRITE, &write_info, sizeof(write_info), 0);

   return res;
}
static int func_channel_write_real ( struct ast_channel chan,
const char *  function,
char *  data,
const char *  value 
) [static]

Definition at line 545 of file func_channel.c.

References accountcode, amaflags, ast_calloc, ast_channel_amaflags_set(), ast_channel_callgroup_set(), ast_channel_datastore_add(), ast_channel_datastore_find(), ast_channel_lock, ast_channel_named_callgroups_set(), ast_channel_named_pickupgroups_set(), ast_channel_pickupgroup_set(), ast_channel_setoption(), ast_channel_tech(), ast_channel_transfercapability_set(), ast_channel_unlock, ast_channel_zone(), ast_channel_zone_set(), ast_datastore_alloc(), ast_false(), ast_free, ast_get_group(), ast_get_indication_zone(), ast_get_namedgroups(), ast_log(), AST_OPTION_RXGAIN, AST_OPTION_TXGAIN, ast_pbx_hangup_handler_pop(), ast_pbx_hangup_handler_push(), ast_set_hangupsource(), ast_tone_zone_ref(), ast_tone_zone_unref(), ast_true(), ast_unref_namedgroups(), ast_datastore::data, func_channel_write(), language, locked_string_field_set, LOG_ERROR, LOG_WARNING, ast_secure_call_store::media, musicclass, parkinglot, secure_call_info, and ast_secure_call_store::signaling.

Referenced by func_channel_write().

{
   int ret = 0;
   signed char gainset;

   if (!strcasecmp(data, "language"))
      locked_string_field_set(chan, language, value);
   else if (!strcasecmp(data, "parkinglot"))
      locked_string_field_set(chan, parkinglot, value);
   else if (!strcasecmp(data, "musicclass"))
      locked_string_field_set(chan, musicclass, value);
   else if (!strcasecmp(data, "accountcode"))
      locked_string_field_set(chan, accountcode, value);
   else if (!strcasecmp(data, "userfield"))
      locked_string_field_set(chan, userfield, value);
   else if (!strcasecmp(data, "amaflags")) {
      ast_channel_lock(chan);
      if(isdigit(*value)) {
         int amaflags;
         sscanf(value, "%30d", &amaflags);
         ast_channel_amaflags_set(chan, amaflags);
      } else if (!strcasecmp(value,"OMIT")){
         ast_channel_amaflags_set(chan, 1);
      } else if (!strcasecmp(value,"BILLING")){
         ast_channel_amaflags_set(chan, 2);
      } else if (!strcasecmp(value,"DOCUMENTATION")){
         ast_channel_amaflags_set(chan, 3);
      }
      ast_channel_unlock(chan);
   } else if (!strcasecmp(data, "peeraccount"))
      locked_string_field_set(chan, peeraccount, value);
   else if (!strcasecmp(data, "hangupsource"))
      /* XXX - should we be forcing this here? */
      ast_set_hangupsource(chan, value, 0);
#ifdef CHANNEL_TRACE
   else if (!strcasecmp(data, "trace")) {
      ast_channel_lock(chan);
      if (ast_true(value))
         ret = ast_channel_trace_enable(chan);
      else if (ast_false(value))
         ret = ast_channel_trace_disable(chan);
      else {
         ret = -1;
         ast_log(LOG_WARNING, "Invalid value for CHANNEL(trace).\n");
      }
      ast_channel_unlock(chan);
   }
#endif
   else if (!strcasecmp(data, "tonezone")) {
      struct ast_tone_zone *new_zone;
      if (!(new_zone = ast_get_indication_zone(value))) {
         ast_log(LOG_ERROR, "Unknown country code '%s' for tonezone. Check indications.conf for available country codes.\n", value);
         ret = -1;
      } else {
         ast_channel_lock(chan);
         if (ast_channel_zone(chan)) {
            ast_channel_zone_set(chan, ast_tone_zone_unref(ast_channel_zone(chan)));
         }
         ast_channel_zone_set(chan, ast_tone_zone_ref(new_zone));
         ast_channel_unlock(chan);
         new_zone = ast_tone_zone_unref(new_zone);
      }
   } else if (!strcasecmp(data, "callgroup")) {
      ast_channel_lock(chan);
      ast_channel_callgroup_set(chan, ast_get_group(value));
      ast_channel_unlock(chan);
   } else if (!strcasecmp(data, "pickupgroup")) {
      ast_channel_lock(chan);
      ast_channel_pickupgroup_set(chan, ast_get_group(value));
      ast_channel_unlock(chan);
   } else if (!strcasecmp(data, "namedcallgroup")) {
      struct ast_namedgroups *groups = ast_get_namedgroups(value);

      ast_channel_lock(chan);
      ast_channel_named_callgroups_set(chan, groups);
      ast_channel_unlock(chan);
      ast_unref_namedgroups(groups);
   } else if (!strcasecmp(data, "namedpickupgroup")) {
      struct ast_namedgroups *groups = ast_get_namedgroups(value);

      ast_channel_lock(chan);
      ast_channel_named_pickupgroups_set(chan, groups);
      ast_channel_unlock(chan);
      ast_unref_namedgroups(groups);
   } else if (!strcasecmp(data, "txgain")) {
      sscanf(value, "%4hhd", &gainset);
      ast_channel_setoption(chan, AST_OPTION_TXGAIN, &gainset, sizeof(gainset), 0);
   } else if (!strcasecmp(data, "rxgain")) {
      sscanf(value, "%4hhd", &gainset);
      ast_channel_setoption(chan, AST_OPTION_RXGAIN, &gainset, sizeof(gainset), 0);
   } else if (!strcasecmp(data, "transfercapability")) {
      unsigned short i;

      ast_channel_lock(chan);
      for (i = 0; i < 0x20; i++) {
         if (!strcasecmp(transfercapability_table[i], value) && strcmp(value, "UNK")) {
            ast_channel_transfercapability_set(chan, i);
            break;
         }
      }
      ast_channel_unlock(chan);
   } else if (!strcasecmp(data, "hangup_handler_pop")) {
      /* Pop one hangup handler before pushing the new handler. */
      ast_pbx_hangup_handler_pop(chan);
      ast_pbx_hangup_handler_push(chan, value);
   } else if (!strcasecmp(data, "hangup_handler_push")) {
      ast_pbx_hangup_handler_push(chan, value);
   } else if (!strcasecmp(data, "hangup_handler_wipe")) {
      /* Pop all hangup handlers before pushing the new handler. */
      while (ast_pbx_hangup_handler_pop(chan)) {
      }
      ast_pbx_hangup_handler_push(chan, value);
   } else if (!strncasecmp(data, "secure_bridge_", 14)) {
      struct ast_datastore *ds;
      struct ast_secure_call_store *store;

      if (!chan || !value) {
         return -1;
      }

      ast_channel_lock(chan);
      if (!(ds = ast_channel_datastore_find(chan, &secure_call_info, NULL))) {
         if (!(ds = ast_datastore_alloc(&secure_call_info, NULL))) {
            ast_channel_unlock(chan);
            return -1;
         }
         if (!(store = ast_calloc(1, sizeof(*store)))) {
            ast_channel_unlock(chan);
            ast_free(ds);
            return -1;
         }
         ds->data = store;
         ast_channel_datastore_add(chan, ds);
      } else {
         store = ds->data;
      }

      if (!strcasecmp(data, "secure_bridge_signaling")) {
         store->signaling = ast_true(value) ? 1 : 0;
      } else if (!strcasecmp(data, "secure_bridge_media")) {
         store->media = ast_true(value) ? 1 : 0;
      }
      ast_channel_unlock(chan);
   } else if (!ast_channel_tech(chan)->func_channel_write
       || ast_channel_tech(chan)->func_channel_write(chan, function, data, value)) {
      ast_log(LOG_WARNING, "Unknown or unavailable item requested: '%s'\n",
            data);
      ret = -1;
   }

   return ret;
}
static int func_channels_read ( struct ast_channel chan,
const char *  function,
char *  data,
char *  buf,
size_t  maxlen 
) [static]

Definition at line 728 of file func_channel.c.

References ast_channel_iterator_all_new(), ast_channel_iterator_destroy(), ast_channel_iterator_next(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_channel_unref, ast_log(), ast_strlen_zero(), and LOG_WARNING.

{
   struct ast_channel *c = NULL;
   regex_t re;
   int res;
   size_t buflen = 0;
   struct ast_channel_iterator *iter;

   buf[0] = '\0';

   if (!ast_strlen_zero(data)) {
      if ((res = regcomp(&re, data, REG_EXTENDED | REG_ICASE | REG_NOSUB))) {
         regerror(res, &re, buf, maxlen);
         ast_log(LOG_WARNING, "Error compiling regular expression for %s(%s): %s\n", function, data, buf);
         return -1;
      }
   }

   if (!(iter = ast_channel_iterator_all_new())) {
      if (!ast_strlen_zero(data)) {
         regfree(&re);
      }
      return -1;
   }

   while ((c = ast_channel_iterator_next(iter))) {
      ast_channel_lock(c);
      if (ast_strlen_zero(data) || regexec(&re, ast_channel_name(c), 0, NULL, 0) == 0) {
         size_t namelen = strlen(ast_channel_name(c));
         if (buflen + namelen + (ast_strlen_zero(buf) ? 0 : 1) + 1 < maxlen) {
            if (!ast_strlen_zero(buf)) {
               strcat(buf, " ");
               buflen++;
            }
            strcat(buf, ast_channel_name(c));
            buflen += namelen;
         } else {
            ast_log(LOG_WARNING, "Number of channels exceeds the available buffer space.  Output will be truncated!\n");
         }
      }
      ast_channel_unlock(c);
      c = ast_channel_unref(c);
   }

   ast_channel_iterator_destroy(iter);

   if (!ast_strlen_zero(data)) {
      regfree(&re);
   }

   return 0;
}
static int func_mchan_read ( struct ast_channel chan,
const char *  function,
char *  data,
struct ast_str **  buf,
ssize_t  len 
) [static]

Definition at line 786 of file func_channel.c.

References ast_alloca, ast_channel_get_by_name(), ast_channel_linkedid(), ast_channel_unref, ast_log(), ast_str_substitute_variables(), and LOG_WARNING.

{
   struct ast_channel *mchan;
   char *template = ast_alloca(4 + strlen(data));

   if (!chan) {
      ast_log(LOG_WARNING, "No channel was provided to %s function.\n", function);
      return -1;
   }

   mchan = ast_channel_get_by_name(ast_channel_linkedid(chan));
   sprintf(template, "${%s}", data); /* SAFE */
   ast_str_substitute_variables(buf, len, mchan ? mchan : chan, template);
   if (mchan) {
      ast_channel_unref(mchan);
   }
   return 0;
}
static int func_mchan_write ( struct ast_channel chan,
const char *  function,
char *  data,
const char *  value 
) [static]

Definition at line 806 of file func_channel.c.

References ast_channel_get_by_name(), ast_channel_linkedid(), ast_channel_unref, ast_log(), LOG_WARNING, and pbx_builtin_setvar_helper().

{
   struct ast_channel *mchan;

   if (!chan) {
      ast_log(LOG_WARNING, "No channel was provided to %s function.\n", function);
      return -1;
   }

   mchan = ast_channel_get_by_name(ast_channel_linkedid(chan));
   pbx_builtin_setvar_helper(mchan ? mchan : chan, data, value);
   if (mchan) {
      ast_channel_unref(mchan);
   }
   return 0;
}
static int load_module ( void  ) [static]
static int unload_module ( void  ) [static]

Variable Documentation

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Channel information dialplan functions" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } [static]

Definition at line 852 of file func_channel.c.

Definition at line 852 of file func_channel.c.

Initial value:
 {
   .name = "CHANNEL",
   .read = func_channel_read,
   .write = func_channel_write,
}

Definition at line 722 of file func_channel.c.

Initial value:
 {
   .name = "CHANNELS",
   .read = func_channels_read,
}

Definition at line 781 of file func_channel.c.

Initial value:
 {
   .name = "MASTER_CHANNEL",
   .read2 = func_mchan_read,
   .write = func_mchan_write,
}

Definition at line 824 of file func_channel.c.

const char* const transfercapability_table[0x20] [static]
Initial value:
 {
   "SPEECH", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK",
   "DIGITAL", "RESTRICTED_DIGITAL", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK",
   "3K1AUDIO", "DIGITAL_W_TONES", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK",
   "VIDEO", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", }

Definition at line 396 of file func_channel.c.