aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-27 17:41:57 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-27 17:41:57 +0000
commit697a761b028acc974f0eacfd72bba5e861ac08ee (patch)
treee7a981a169b4a3bf82aa42b8192050b6dbac3af0
parentc7e57134d9212f54e556b967a10bc3672e731230 (diff)
Merged revisions 243482 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r243482 | russell | 2010-01-27 11:32:07 -0600 (Wed, 27 Jan 2010) | 13 lines Fix the ability to specify an OSP token for an outbound IAX2 call. When this patch was originally submitted, the code allowed for the token to be set via a channel variable. I decided that a cleaner approach would be to integrate it into the CHANNEL() function. Unfortunately, that is not a suitable approach. It's not possible to get the value set on the channel soon enough using that method. So, go back to the simple channel variable method. (closes issue #16711) Reported by: homesick Patches: iax-svn.diff uploaded by homesick (license 91) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@243485 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_iax2.c34
-rw-r--r--funcs/func_channel.c3
2 files changed, 2 insertions, 35 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index ef17173e5..325433597 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -1145,7 +1145,6 @@ static void prune_users(void);
static void iax2_free_variable_datastore(void *);
static int acf_channel_read(struct ast_channel *chan, const char *funcname, char *preparse, char *buf, size_t buflen);
-static int acf_channel_write(struct ast_channel *chan, const char *function, char *data, const char *value);
static int decode_frame(ast_aes_decrypt_key *dcx, struct ast_iax2_full_hdr *fh, struct ast_frame *f, int *datalen);
static int encrypt_frame(ast_aes_encrypt_key *ecx, struct ast_iax2_full_hdr *fh, unsigned char *poo, int *datalen);
static void build_ecx_key(const unsigned char *digest, struct chan_iax2_pvt *pvt);
@@ -1178,7 +1177,6 @@ static const struct ast_channel_tech iax2_tech = {
.transfer = iax2_transfer,
.fixup = iax2_fixup,
.func_channel_read = acf_channel_read,
- .func_channel_write = acf_channel_write,
};
static void mwi_event_cb(const struct ast_event *event, void *userdata)
@@ -4918,8 +4916,8 @@ static int iax2_call(struct ast_channel *c, char *dest, int timeout)
iaxs[callno]->initid = iax2_sched_add(sched, autokill * 2, auto_congest, CALLNO_TO_PTR(callno));
}
- /* Check if there is an OSP token set by IAXCHANINFO function */
- osp_token_ptr = iaxs[callno]->osptoken;
+ /* Check if there is an OSP token */
+ osp_token_ptr = pbx_builtin_getvar_helper(c, "IAX2OSPTOKEN");
if (!ast_strlen_zero(osp_token_ptr)) {
if ((osp_token_length = strlen(osp_token_ptr)) <= IAX_MAX_OSPTOKEN_SIZE) {
osp_block_index = 0;
@@ -13389,34 +13387,6 @@ struct ast_custom_function iaxpeer_function = {
.read = function_iaxpeer,
};
-static int acf_channel_write(struct ast_channel *chan, const char *function, char *args, const char *value)
-{
- struct chan_iax2_pvt *pvt;
- unsigned int callno;
- int res = 0;
-
- if (!chan || chan->tech != &iax2_tech) {
- ast_log(LOG_ERROR, "This function requires a valid IAX2 channel\n");
- return -1;
- }
-
- callno = PTR_TO_CALLNO(chan->tech_pvt);
- ast_mutex_lock(&iaxsl[callno]);
- if (!(pvt = iaxs[callno])) {
- ast_mutex_unlock(&iaxsl[callno]);
- return -1;
- }
-
- if (!strcasecmp(args, "osptoken"))
- ast_string_field_set(pvt, osptoken, value);
- else
- res = -1;
-
- ast_mutex_unlock(&iaxsl[callno]);
-
- return res;
-}
-
static int acf_channel_read(struct ast_channel *chan, const char *funcname, char *args, char *buf, size_t buflen)
{
struct chan_iax2_pvt *pvt;
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index 62bd0d0f8..02e7208c6 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -191,9 +191,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
</enumlist>
<para><emphasis>chan_iax2</emphasis> provides the following additional options:</para>
<enumlist>
- <enum name="osptoken">
- <para>R/W Get or set the OSP token information for a call.</para>
- </enum>
<enum name="peerip">
<para>R/O Get the peer's ip address.</para>
</enum>