[asterisk-commits] sgriepentrog: branch sgriepentrog/12-linkedid r408019 - in /team/sgriepentrog...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Feb 13 14:32:23 CST 2014
Author: sgriepentrog
Date: Thu Feb 13 14:32:10 2014
New Revision: 408019
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=408019
Log:
review corrections
Modified:
team/sgriepentrog/12-linkedid/addons/chan_mobile.c
team/sgriepentrog/12-linkedid/addons/chan_ooh323.c
team/sgriepentrog/12-linkedid/channels/chan_alsa.c
team/sgriepentrog/12-linkedid/channels/chan_console.c
team/sgriepentrog/12-linkedid/channels/chan_gtalk.c
team/sgriepentrog/12-linkedid/channels/chan_iax2.c
team/sgriepentrog/12-linkedid/channels/chan_jingle.c
team/sgriepentrog/12-linkedid/channels/chan_mgcp.c
team/sgriepentrog/12-linkedid/channels/chan_motif.c
team/sgriepentrog/12-linkedid/channels/chan_oss.c
team/sgriepentrog/12-linkedid/channels/chan_phone.c
team/sgriepentrog/12-linkedid/channels/chan_pjsip.c
team/sgriepentrog/12-linkedid/channels/chan_sip.c
team/sgriepentrog/12-linkedid/channels/chan_skinny.c
team/sgriepentrog/12-linkedid/channels/chan_unistim.c
team/sgriepentrog/12-linkedid/include/asterisk/channel.h
team/sgriepentrog/12-linkedid/include/asterisk/channel_internal.h
team/sgriepentrog/12-linkedid/include/asterisk/rtp_engine.h
team/sgriepentrog/12-linkedid/main/bridge_channel.c
team/sgriepentrog/12-linkedid/main/cel.c
team/sgriepentrog/12-linkedid/main/channel.c
team/sgriepentrog/12-linkedid/main/channel_internal_api.c
team/sgriepentrog/12-linkedid/main/core_unreal.c
team/sgriepentrog/12-linkedid/res/ari/resource_channels.c
team/sgriepentrog/12-linkedid/res/res_stasis_snoop.c
team/sgriepentrog/12-linkedid/tests/test_cdr.c
team/sgriepentrog/12-linkedid/tests/test_cel.c
team/sgriepentrog/12-linkedid/tests/test_substitution.c
Modified: team/sgriepentrog/12-linkedid/addons/chan_mobile.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/addons/chan_mobile.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/addons/chan_mobile.c (original)
+++ team/sgriepentrog/12-linkedid/addons/chan_mobile.c Thu Feb 13 14:32:10 2014
@@ -855,7 +855,7 @@
ast_dsp_digitreset(pvt->dsp);
chn = ast_channel_alloc(1, state, cid_num, pvt->id, 0, 0, pvt->context,
- requestor ? ast_channel_linkedid(requestor) : "", 0,
+ requestor ? ast_channel_linkedid(requestor) : NULL, 0,
"Mobile/%s-%04lx", pvt->id, ast_random() & 0xffff);
if (!chn) {
goto e_return;
Modified: team/sgriepentrog/12-linkedid/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/addons/chan_ooh323.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/addons/chan_ooh323.c (original)
+++ team/sgriepentrog/12-linkedid/addons/chan_ooh323.c Thu Feb 13 14:32:10 2014
@@ -360,7 +360,7 @@
static struct ast_channel *ooh323_new(struct ooh323_pvt *i, int state,
- const char *host, struct ast_format_cap *cap, const char *linkedid)
+ const char *host, struct ast_format_cap *cap, const struct ast_channel_id *linkedid)
{
struct ast_channel *ch = NULL;
struct ast_format tmpfmt;
Modified: team/sgriepentrog/12-linkedid/channels/chan_alsa.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_alsa.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_alsa.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_alsa.c Thu Feb 13 14:32:10 2014
@@ -574,7 +574,7 @@
return res;
}
-static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state, const struct ast_channel_uniqueid *linkedid)
+static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state, const struct ast_channel_id *linkedid)
{
struct ast_channel *tmp = NULL;
Modified: team/sgriepentrog/12-linkedid/channels/chan_console.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_console.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_console.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_console.c Thu Feb 13 14:32:10 2014
@@ -419,7 +419,7 @@
/*!
* \note Called with the pvt struct locked
*/
-static struct ast_channel *console_new(struct console_pvt *pvt, const char *ext, const char *ctx, int state, const struct ast_channel_uniqueid *linkedid)
+static struct ast_channel *console_new(struct console_pvt *pvt, const char *ext, const char *ctx, int state, const struct ast_channel_id *linkedid)
{
struct ast_channel *chan;
Modified: team/sgriepentrog/12-linkedid/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_gtalk.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_gtalk.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_gtalk.c Thu Feb 13 14:32:10 2014
@@ -1012,10 +1012,10 @@
{
p->owner = chan;
if (p->rtp) {
- ast_rtp_instance_set_channel_id(p->rtp, chan ? ast_channel_uniqueid(chan) : "");
+ ast_rtp_instance_set_channel_id(p->rtp, chan ? ast_channel_uniqueid(chan)->unique_id : "");
}
if (p->vrtp) {
- ast_rtp_instance_set_channel_id(p->vrtp, chan ? ast_channel_uniqueid(chan) : "");
+ ast_rtp_instance_set_channel_id(p->vrtp, chan ? ast_channel_uniqueid(chan)->unique_id : "");
}
}
@@ -1133,7 +1133,7 @@
}
/*! \brief Start new gtalk channel */
-static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i, int state, const char *title, const char *linkedid)
+static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i, int state, const char *title, const struct ast_channel_id *linkedid)
{
struct ast_channel *tmp;
const char *n2;
@@ -1144,7 +1144,7 @@
n2 = title;
else
n2 = i->us;
- tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, linkedid, client->accountcode, i->exten, client->context, client->amaflags, "Gtalk/%s-%04lx", n2, ast_random() & 0xffff);
+ tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, client->accountcode, i->exten, client->context, linkedid, client->amaflags, "Gtalk/%s-%04lx", n2, ast_random() & 0xffff);
if (!tmp) {
ast_log(LOG_WARNING, "Unable to allocate Gtalk channel structure!\n");
return NULL;
Modified: team/sgriepentrog/12-linkedid/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_iax2.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_iax2.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_iax2.c Thu Feb 13 14:32:10 2014
@@ -5775,7 +5775,7 @@
}
/*! \brief Create new call, interface with the PBX core */
-static struct ast_channel *ast_iax2_new(int callno, int state, iax2_format capability, const struct ast_channel_uniqueid *linkedid, unsigned int cachable)
+static struct ast_channel *ast_iax2_new(int callno, int state, iax2_format capability, const struct ast_channel_id *linkedid, unsigned int cachable)
{
struct ast_channel *tmp;
struct chan_iax2_pvt *i;
Modified: team/sgriepentrog/12-linkedid/channels/chan_jingle.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_jingle.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_jingle.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_jingle.c Thu Feb 13 14:32:10 2014
@@ -839,15 +839,15 @@
{
pvt->owner = chan;
if (pvt->rtp) {
- ast_rtp_instance_set_channel_id(pvt->rtp, pvt->owner ? ast_channel_uniqueid(pvt->owner) : "");
+ ast_rtp_instance_set_channel_id(pvt->rtp, pvt->owner ? ast_channel_uniqueid(pvt->owner)->unique_id : "");
}
if (pvt->vrtp) {
- ast_rtp_instance_set_channel_id(pvt->vrtp, pvt->owner ? ast_channel_uniqueid(pvt->owner) : "");
+ ast_rtp_instance_set_channel_id(pvt->vrtp, pvt->owner ? ast_channel_uniqueid(pvt->owner)->unique_id : "");
}
}
/*! \brief Start new jingle channel */
-static struct ast_channel *jingle_new(struct jingle *client, struct jingle_pvt *i, int state, const char *title, const char *linkedid)
+static struct ast_channel *jingle_new(struct jingle *client, struct jingle_pvt *i, int state, const char *title, const struct ast_channel_id *linkedid)
{
struct ast_channel *tmp;
struct ast_format_cap *what; /* SHALLOW COPY DO NOT DESTROY */
Modified: team/sgriepentrog/12-linkedid/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_mgcp.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_mgcp.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_mgcp.c Thu Feb 13 14:32:10 2014
@@ -1488,25 +1488,13 @@
return res;
}
-static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state, const struct ast_channel_uniqueid *linkedid)
+static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state, const struct ast_channel_id *linkedid)
{
struct ast_channel *tmp;
struct ast_variable *v = NULL;
struct mgcp_endpoint *i = sub->parent;
struct ast_format tmpfmt;
- /*
- * The previous ast_channel_alloc here was (when linkedid was a char *):
- *
- * ast_channel_alloc(1, state, i->cid_num, i->cid_name, linkedid, i->accountcode, i->exten, i->context, i->amaflags, "MGCP/%s@%s-%d", i->name, i->parent->name, sub->id);
- *
- * But: the ast_channel_alloc is defined as:
- *
- * #define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, linkedid, amaflag, ...)
- *
- * So, this has been fixed up to match the correct arguments for creating the channel...
- *
- */
tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, linkedid, i->amaflags, "MGCP/%s@%s-%d", i->name, i->parent->name, sub->id);
if (tmp) {
ast_channel_stage_snapshot(tmp);
Modified: team/sgriepentrog/12-linkedid/channels/chan_motif.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_motif.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_motif.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_motif.c Thu Feb 13 14:32:10 2014
@@ -772,7 +772,7 @@
}
/*! \brief Function called to create a new Jingle Asterisk channel */
-static struct ast_channel *jingle_new(struct jingle_endpoint *endpoint, struct jingle_session *session, int state, const char *title, const struct ast_channel_uniqueid *linkedid, const char *cid_name)
+static struct ast_channel *jingle_new(struct jingle_endpoint *endpoint, struct jingle_session *session, int state, const char *title, const struct ast_channel_id *linkedid, const char *cid_name)
{
struct ast_channel *chan;
const char *str = S_OR(title, session->remote);
Modified: team/sgriepentrog/12-linkedid/channels/chan_oss.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_oss.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_oss.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_oss.c Thu Feb 13 14:32:10 2014
@@ -792,7 +792,7 @@
/*!
* \brief allocate a new channel.
*/
-static struct ast_channel *oss_new(struct chan_oss_pvt *o, char *ext, char *ctx, int state, const struct ast_channel_uniqueid *linkedid)
+static struct ast_channel *oss_new(struct chan_oss_pvt *o, char *ext, char *ctx, int state, const struct ast_channel_id *linkedid)
{
struct ast_channel *c;
Modified: team/sgriepentrog/12-linkedid/channels/chan_phone.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_phone.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_phone.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_phone.c Thu Feb 13 14:32:10 2014
@@ -855,7 +855,7 @@
return 0;
}
-static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *cntx, const struct ast_channel_uniqueid *linkedid)
+static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *cntx, const struct ast_channel_id *linkedid)
{
struct ast_channel *tmp;
struct phone_codec_data queried_codec;
Modified: team/sgriepentrog/12-linkedid/channels/chan_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_pjsip.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_pjsip.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_pjsip.c Thu Feb 13 14:32:10 2014
@@ -340,7 +340,7 @@
};
/*! \brief Function called to create a new PJSIP Asterisk channel */
-static struct ast_channel *chan_pjsip_new(struct ast_sip_session *session, int state, const char *exten, const char *title, const struct ast_channel_uniqueid *linkedid, const char *cid_name)
+static struct ast_channel *chan_pjsip_new(struct ast_sip_session *session, int state, const char *exten, const char *title, const struct ast_channel_id *linkedid, const char *cid_name)
{
struct ast_channel *chan;
struct ast_format fmt;
Modified: team/sgriepentrog/12-linkedid/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_sip.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_sip.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_sip.c Thu Feb 13 14:32:10 2014
@@ -8059,7 +8059,7 @@
*
* \return New ast_channel locked.
*/
-static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *title, const struct ast_channel_uniqueid *linkedid, struct ast_callid *callid)
+static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *title, const struct ast_channel_id *linkedid, struct ast_callid *callid)
{
struct ast_channel *tmp;
struct ast_variable *v = NULL;
Modified: team/sgriepentrog/12-linkedid/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_skinny.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_skinny.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_skinny.c Thu Feb 13 14:32:10 2014
@@ -5397,7 +5397,7 @@
}
}
-static struct ast_channel *skinny_new(struct skinny_line *l, struct skinny_subline *subline, int state, const struct ast_channel_uniqueid *linkedid, int direction)
+static struct ast_channel *skinny_new(struct skinny_line *l, struct skinny_subline *subline, int state, const struct ast_channel_id *linkedid, int direction)
{
struct ast_channel *tmp;
struct skinny_subchannel *sub;
Modified: team/sgriepentrog/12-linkedid/channels/chan_unistim.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/channels/chan_unistim.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/channels/chan_unistim.c (original)
+++ team/sgriepentrog/12-linkedid/channels/chan_unistim.c Thu Feb 13 14:32:10 2014
@@ -669,7 +669,7 @@
static const char channel_type[] = "USTM";
/*! Protos */
-static struct ast_channel *unistim_new(struct unistim_subchannel *sub, int state, const struct ast_channel_uniqueid *linkedid);
+static struct ast_channel *unistim_new(struct unistim_subchannel *sub, int state, const struct ast_channel_id *linkedid);
static int load_module(void);
static int reload(void);
static int unload_module(void);
@@ -5530,7 +5530,7 @@
/*--- unistim_new: Initiate a call in the UNISTIM channel */
/* called from unistim_request (calls from the pbx ) */
-static struct ast_channel *unistim_new(struct unistim_subchannel *sub, int state, const struct ast_channel_uniqueid *linkedid)
+static struct ast_channel *unistim_new(struct unistim_subchannel *sub, int state, const struct ast_channel_id *linkedid)
{
struct ast_channel *tmp;
struct unistim_line *l;
Modified: team/sgriepentrog/12-linkedid/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/include/asterisk/channel.h?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/include/asterisk/channel.h (original)
+++ team/sgriepentrog/12-linkedid/include/asterisk/channel.h Thu Feb 13 14:32:10 2014
@@ -133,7 +133,7 @@
#define AST_MAX_EXTENSION 80 /*!< Max length of an extension */
#define AST_MAX_CONTEXT 80 /*!< Max length of a context */
-#define AST_MAX_UNIQUEID 150 /*!< Max length of a channel uniqueid */
+#define AST_MAX_UNIQUEID 128 /*!< Max length of a channel uniqueid */
/* 150 = 127 (max systemname) + "-" + 10 (epoch
* timestamp) + "." + 10 (monotonically incrementing
* integer) + NULL. Note that if this value is ever
@@ -177,13 +177,12 @@
/*!
* \brief Channel UniqueId structure
- *
* \note channel creation time used for determining LinkedId Propagation
*/
-struct ast_channel_uniqueid {
- char unique_id[AST_MAX_UNIQUEID]; /*!< Unique Identifier - can be set on originate */
+struct ast_channel_id {
time_t creation_time; /*!< Creation time */
int creation_unique; /*!< sub-second unique value */
+ char unique_id[AST_MAX_UNIQUEID]; /*!< Unique Identifier - can be set on originate */
};
enum ast_bridge_result {
@@ -1128,9 +1127,6 @@
*/
struct ast_datastore *ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid);
-
-struct ast_channel_uniqueid;
-
/*!
* \brief Create a channel structure
* \since 1.8
@@ -1147,7 +1143,7 @@
__ast_channel_alloc(int needqueue, int state, const char *cid_num,
const char *cid_name, const char *acctcode,
const char *exten, const char *context,
- const struct ast_channel_uniqueid *linkedid, enum ama_flags amaflag,
+ const struct ast_channel_id *linkedid, enum ama_flags amaflag,
const char *file, int line, const char *function,
const char *name_fmt, ...);
@@ -3810,10 +3806,6 @@
DECLARE_STRINGFIELD_SETTERS_FOR(peeraccount);
DECLARE_STRINGFIELD_SETTERS_FOR(userfield);
DECLARE_STRINGFIELD_SETTERS_FOR(call_forward);
-/*
-DECLARE_STRINGFIELD_SETTERS_FOR(uniqueid);
-DECLARE_STRINGFIELD_SETTERS_FOR(linkedid);
-*/
DECLARE_STRINGFIELD_SETTERS_FOR(parkinglot);
DECLARE_STRINGFIELD_SETTERS_FOR(hangupsource);
DECLARE_STRINGFIELD_SETTERS_FOR(dialcontext);
@@ -3856,10 +3848,10 @@
enum ama_flags ast_channel_amaflags(const struct ast_channel *chan);
-const struct ast_channel_uniqueid *ast_channel_uniqueid(const struct ast_channel *chan);
-const struct ast_channel_uniqueid *ast_channel_linkedid(const struct ast_channel *chan);
-void ast_channel_uniqueid_set(struct ast_channel *chan, const struct ast_channel_uniqueid *uniqueid);
-void ast_channel_linkedid_set(struct ast_channel *chan, const struct ast_channel_uniqueid *uniqueid);
+const struct ast_channel_id *ast_channel_uniqueid(const struct ast_channel *chan);
+const struct ast_channel_id *ast_channel_linkedid(const struct ast_channel *chan);
+void ast_channel_uniqueid_set(struct ast_channel *chan, const struct ast_channel_id *uniqueid);
+void ast_channel_linkedid_set(struct ast_channel *chan, const struct ast_channel_id *uniqueid);
/*!
* \pre chan is locked
@@ -4332,9 +4324,9 @@
/*!
* \brief Return the oldest linkedid between two channels.
*
- * A channel uniqueid is struct containing both the string unique id of a channel and
- * time values that specify it's creation time. When not provided, the unique_id
- * string wil be created in a format liks this:
+ * A channel uniqueid is a struct containing both the string unique id of a channel and
+ * time values that specify it's creation time. When not provided at the time the
+ * channel is created, the unique_id string will be created in a format liks this:
* [systemname-]ctime.seq
*
* The channel linkedid is copied from another channel when bridged and the other channel
@@ -4351,7 +4343,7 @@
* \retval The oldest linkedid value
* \since 12.0.0
*/
-const struct ast_channel_uniqueid *ast_channel_oldest_linkedid(const struct ast_channel_uniqueid *a, const struct ast_channel_uniqueid *b);
+const struct ast_channel_id *ast_channel_oldest_linkedid(const struct ast_channel_id *a, const struct ast_channel_id *b);
/*!
* \brief Check if the channel has active audiohooks, active framehooks, or a monitor.
Modified: team/sgriepentrog/12-linkedid/include/asterisk/channel_internal.h
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/include/asterisk/channel_internal.h?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/include/asterisk/channel_internal.h (original)
+++ team/sgriepentrog/12-linkedid/include/asterisk/channel_internal.h Thu Feb 13 14:32:10 2014
@@ -19,7 +19,7 @@
*/
#define ast_channel_internal_alloc(destructor, linkedid) __ast_channel_internal_alloc(destructor, linkedid, __FILE__, __LINE__, __PRETTY_FUNCTION__)
-struct ast_channel *__ast_channel_internal_alloc(void (*destructor)(void *obj), const struct ast_channel_uniqueid *linkedid, const char *file, int line, const char *function);
+struct ast_channel *__ast_channel_internal_alloc(void (*destructor)(void *obj), const struct ast_channel_id *linkedid, const char *file, int line, const char *function);
void ast_channel_internal_finalize(struct ast_channel *chan);
int ast_channel_internal_is_finalized(struct ast_channel *chan);
void ast_channel_internal_cleanup(struct ast_channel *chan);
Modified: team/sgriepentrog/12-linkedid/include/asterisk/rtp_engine.h
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/include/asterisk/rtp_engine.h?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/include/asterisk/rtp_engine.h (original)
+++ team/sgriepentrog/12-linkedid/include/asterisk/rtp_engine.h Thu Feb 13 14:32:10 2014
@@ -90,7 +90,7 @@
* Note that we don't use that defined value directly here to avoid a hard dependency
* on channel.h
*/
-#define MAX_CHANNEL_ID 150
+#define MAX_CHANNEL_ID 128
struct ast_rtp_instance;
struct ast_rtp_glue;
Modified: team/sgriepentrog/12-linkedid/main/bridge_channel.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/main/bridge_channel.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/main/bridge_channel.c (original)
+++ team/sgriepentrog/12-linkedid/main/bridge_channel.c Thu Feb 13 14:32:10 2014
@@ -222,7 +222,7 @@
{
struct ast_bridge_channel *other = NULL;
struct ast_bridge *bridge = bridge_channel->bridge;
- const struct ast_channel_uniqueid *oldest_linkedid = ast_channel_linkedid(bridge_channel->chan);
+ const struct ast_channel_id *oldest_linkedid = ast_channel_linkedid(bridge_channel->chan);
AST_LIST_TRAVERSE(&bridge->channels, other, entry) {
if (other == swap) {
Modified: team/sgriepentrog/12-linkedid/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/main/cel.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/main/cel.c (original)
+++ team/sgriepentrog/12-linkedid/main/cel.c Thu Feb 13 14:32:10 2014
@@ -767,7 +767,7 @@
};
struct ast_datastore *datastore;
char *app_data;
- struct ast_channel_uniqueid tmp_uniqueid;
+ struct ast_channel_id channelid;
RAII_VAR(struct cel_config *, cfg, ao2_global_obj_ref(cel_configs), ao2_cleanup);
if (!cfg || !cfg->general) {
@@ -831,13 +831,13 @@
ast_channel_context_set(tchan, record.context);
ast_channel_name_set(tchan, record.channel_name);
- memset(&tmp_uniqueid, 0, sizeof(tmp_uniqueid));
- strncpy(tmp_uniqueid.unique_id, record.unique_id, AST_MAX_UNIQUEID);
- ast_channel_uniqueid_set(tchan, &tmp_uniqueid);
-
- memset(&tmp_uniqueid, 0, sizeof(tmp_uniqueid));
- strncpy(tmp_uniqueid.unique_id, record.linked_id, AST_MAX_UNIQUEID);
- ast_channel_linkedid_set(tchan, &tmp_uniqueid);
+ memset(&channelid, 0, sizeof(channelid));
+ ast_copy_string(channelid.unique_id, record.unique_id, AST_MAX_UNIQUEID);
+ ast_channel_uniqueid_set(tchan, &channelid);
+
+ memset(&channelid, 0, sizeof(channelid));
+ ast_copy_string(channelid.unique_id, record.linked_id, AST_MAX_UNIQUEID);
+ ast_channel_linkedid_set(tchan, &channelid);
ast_channel_accountcode_set(tchan, record.account_code);
ast_channel_peeraccount_set(tchan, record.peer_account);
Modified: team/sgriepentrog/12-linkedid/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/main/channel.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/main/channel.c (original)
+++ team/sgriepentrog/12-linkedid/main/channel.c Thu Feb 13 14:32:10 2014
@@ -858,7 +858,7 @@
static struct ast_channel * attribute_malloc __attribute__((format(printf, 13, 0)))
__ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char *cid_name,
const char *acctcode, const char *exten, const char *context,
- const struct ast_channel_uniqueid *linkedid, enum ama_flags amaflag, const char *file, int line,
+ const struct ast_channel_id *linkedid, enum ama_flags amaflag, const char *file, int line,
const char *function, const char *name_fmt, va_list ap)
{
struct ast_channel *tmp;
@@ -1040,7 +1040,7 @@
struct ast_channel *__ast_channel_alloc(int needqueue, int state, const char *cid_num,
const char *cid_name, const char *acctcode,
const char *exten, const char *context,
- const struct ast_channel_uniqueid *linkedid, enum ama_flags amaflag,
+ const struct ast_channel_id *linkedid, enum ama_flags amaflag,
const char *file, int line, const char *function,
const char *name_fmt, ...)
{
@@ -6330,7 +6330,7 @@
}
}
-const struct ast_channel_uniqueid *ast_channel_oldest_linkedid(const struct ast_channel_uniqueid *a, const struct ast_channel_uniqueid *b)
+const struct ast_channel_id *ast_channel_oldest_linkedid(const struct ast_channel_id *a, const struct ast_channel_id *b)
{
ast_assert(a->creation_time != 0);
ast_assert(b->creation_time != 0);
@@ -6388,7 +6388,7 @@
struct ast_format wformat;
struct ast_format tmp_format;
char tmp_name[AST_CHANNEL_NAME];
- struct ast_channel_uniqueid tmp_id;
+ struct ast_channel_id tmp_id;
char clone_sending_dtmf_digit;
struct timeval clone_sending_dtmf_tv;
@@ -10161,9 +10161,9 @@
char *accountcode;
char *exten;
char *context;
- struct ast_channel_uniqueid linkedid;
char *name;
int amaflags;
+ struct ast_channel_id linkedid;
struct ast_format readformat;
struct ast_format writeformat;
} my_vars = { 0, };
Modified: team/sgriepentrog/12-linkedid/main/channel_internal_api.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/main/channel_internal_api.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/main/channel_internal_api.c (original)
+++ team/sgriepentrog/12-linkedid/main/channel_internal_api.c Thu Feb 13 14:32:10 2014
@@ -106,8 +106,8 @@
AST_STRING_FIELD(dialcontext); /*!< Dial: Extension context that we were called from */
);
- struct ast_channel_uniqueid uniqueid; /*!< Unique Channel Identifier */
- struct ast_channel_uniqueid linkedid; /*!< Linked Channel Identifier -- gets propagated by linkage */
+ struct ast_channel_id uniqueid; /*!< Unique Channel Identifier */
+ struct ast_channel_id linkedid; /*!< Linked Channel Identifier -- gets propagated by linkage */
struct timeval whentohangup; /*!< Non-zero, set to actual time when channel is to be hung up */
pthread_t blocker; /*!< If anyone is blocking, this is them */
@@ -474,29 +474,29 @@
DEFINE_STRINGFIELD_GETTER_FOR(dialcontext);
-const struct ast_channel_uniqueid *ast_channel_linkedid(const struct ast_channel *chan)
+const struct ast_channel_id *ast_channel_linkedid(const struct ast_channel *chan)
{
ast_assert(chan->linkedid.unique_id[0]!='\0');
- return &(chan->linkedid);
-}
-
-const struct ast_channel_uniqueid *ast_channel_uniqueid(const struct ast_channel *chan)
+ return &chan->linkedid;
+}
+
+const struct ast_channel_id *ast_channel_uniqueid(const struct ast_channel *chan)
{
ast_assert(chan->uniqueid.unique_id[0]!='\0');
- return &(chan->uniqueid);
-}
-
-
-void ast_channel_linkedid_set(struct ast_channel *chan, const struct ast_channel_uniqueid *uniqueid)
-{
+ return &chan->uniqueid;
+}
+
+
+void ast_channel_linkedid_set(struct ast_channel *chan, const struct ast_channel_id *uniqueid)
+{
+ ast_assert(uniqueid->unique_id[0]!='\0');
chan->linkedid = *uniqueid;
- ast_assert(chan->linkedid.unique_id[0]!='\0');
-}
-
-void ast_channel_uniqueid_set(struct ast_channel *chan, const struct ast_channel_uniqueid *uniqueid)
-{
+}
+
+void ast_channel_uniqueid_set(struct ast_channel *chan, const struct ast_channel_id *uniqueid)
+{
+ ast_assert(uniqueid->unique_id[0]!='\0');
chan->uniqueid = *uniqueid;
- ast_assert(chan->uniqueid.unique_id[0]!='\0');
}
const char *ast_channel_appl(const struct ast_channel *chan)
@@ -1403,7 +1403,7 @@
#define DIALED_CAUSES_BUCKETS 37
-struct ast_channel *__ast_channel_internal_alloc(void (*destructor)(void *obj), const struct ast_channel_uniqueid *linkedid, const char *file, int line, const char *function)
+struct ast_channel *__ast_channel_internal_alloc(void (*destructor)(void *obj), const struct ast_channel_id *linkedid, const char *file, int line, const char *function)
{
struct ast_channel *tmp;
#if defined(REF_DEBUG)
@@ -1428,11 +1428,13 @@
tmp->uniqueid.creation_unique = ast_atomic_fetchadd_int(&uniqueint, 1);
if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) {
- sprintf(tmp->uniqueid.unique_id, "%li.%d",
+ snprintf(tmp->uniqueid.unique_id, sizeof(tmp->uniqueid.unique_id),
+ "%li.%d",
(long)(tmp->uniqueid.creation_time),
tmp->uniqueid.creation_unique);
} else {
- sprintf(tmp->uniqueid.unique_id, "%s-%li.%d",
+ snprintf(tmp->uniqueid.unique_id, sizeof(tmp->uniqueid.unique_id),
+ "%s-%li.%d",
ast_config_AST_SYSTEM_NAME,
(long)(tmp->uniqueid.creation_time),
tmp->uniqueid.creation_unique);
Modified: team/sgriepentrog/12-linkedid/main/core_unreal.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/main/core_unreal.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/main/core_unreal.c (original)
+++ team/sgriepentrog/12-linkedid/main/core_unreal.c Thu Feb 13 14:32:10 2014
@@ -893,7 +893,7 @@
{
struct ast_channel *owner;
struct ast_channel *chan;
- const struct ast_channel_uniqueid *linkedid = requestor ? ast_channel_linkedid(requestor) : NULL;
+ const struct ast_channel_id *linkedid = requestor ? ast_channel_linkedid(requestor) : NULL;
struct ast_format fmt;
int generated_seqno = ast_atomic_fetchadd_int((int *) &name_sequence, +1);
Modified: team/sgriepentrog/12-linkedid/res/ari/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/res/ari/resource_channels.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/res/ari/resource_channels.c (original)
+++ team/sgriepentrog/12-linkedid/res/ari/resource_channels.c Thu Feb 13 14:32:10 2014
@@ -829,7 +829,7 @@
char uri[9 + strlen(ast_channel_uniqueid(chan)->unique_id)];
const char *uris[1] = { uri, };
- sprintf(uri, "channel:%s", ast_channel_uniqueid(chan)->unique_id);
+ sprintf(uri, "channel:%s", ast_channel_uniqueid(chan)->unique_id); /* safe */
stasis_app_subscribe(args->app, uris, 1, NULL);
}
Modified: team/sgriepentrog/12-linkedid/res/res_stasis_snoop.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/res/res_stasis_snoop.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/res/res_stasis_snoop.c (original)
+++ team/sgriepentrog/12-linkedid/res/res_stasis_snoop.c Thu Feb 13 14:32:10 2014
@@ -323,13 +323,15 @@
snoop_determine_format(chan, snoop);
/* Allocate a Snoop channel and set up various parameters */
- snoop->chan = ast_channel_alloc(1, AST_STATE_UP, "", "", "", "", "", ast_channel_linkedid(chan), 0, "Snoop/%s-%08x",
- ast_channel_uniqueid(chan)->unique_id, ast_atomic_fetchadd_int((int *)&chan_idx, +1));
+ snoop->chan = ast_channel_alloc(1, AST_STATE_UP, "", "", "", "", "",
+ /* should not inherit linkedid */ NULL, 0, "Snoop/%s-%08x",
+ ast_channel_uniqueid(chan)->unique_id,
+ ast_atomic_fetchadd_int((int *)&chan_idx, +1));
if (!snoop->chan) {
return NULL;
}
- strcpy(snoop->uniqueid, ast_channel_uniqueid(chan)->unique_id);
+ strcpy(snoop->uniqueid, ast_channel_uniqueid(chan)->unique_id); /* safe */
/* To keep the channel valid on the Snoop structure until it is destroyed we bump the ref up here */
ast_channel_ref(snoop->chan);
Modified: team/sgriepentrog/12-linkedid/tests/test_cdr.c
URL: http://svnview.digium.com/svn/asterisk/team/sgriepentrog/12-linkedid/tests/test_cdr.c?view=diff&rev=408019&r1=408018&r2=408019
==============================================================================
--- team/sgriepentrog/12-linkedid/tests/test_cdr.c (original)
+++ team/sgriepentrog/12-linkedid/tests/test_cdr.c Thu Feb 13 14:32:10 2014
@@ -227,8 +227,8 @@
/*! \brief Copy the linkedid and uniqueid from a channel to an expected CDR */
#define COPY_IDS(channel_var, expected_record) do { \
- ast_copy_string((expected_record)->uniqueid, ast_channel_uniqueid((channel_var)), sizeof((expected_record)->uniqueid)); \
- ast_copy_string((expected_record)->linkedid, ast_channel_linkedid((channel_var)), sizeof((expected_record)->linkedid)); \
+ ast_copy_string((expected_record)->uniqueid, ast_channel_uniqueid((channel_var))->unique_id, sizeof((expected_record)->uniqueid)); \
+ ast_copy_string((expected_record)->linkedid, ast_channel_linkedid((channel_var))->unique_id, sizeof((expected_record)->linkedid)); \
} while (0)
/*! \brief Create a \ref test_cdr_chan_tech for Alice, and set the expected
@@ -236,8 +236,8 @@
#define CREATE_ALICE_CHANNEL(channel_var, caller_id, expected_record) do { \
(channel_var) = ast_channel_alloc(0, AST_STATE_DOWN, "100", "Alice", "100", "100", "default", NULL, 0, CHANNEL_TECH_NAME "/Alice"); \
ast_channel_set_caller((channel_var), (caller_id), NULL); \
- ast_copy_string((expected_record)->uniqueid, ast_channel_uniqueid((channel_var)), sizeof((expected_record)->uniqueid)); \
- ast_copy_string((expected_record)->linkedid, ast_channel_linkedid((channel_var)), sizeof((expected_record)->linkedid)); \
+ ast_copy_string((expected_record)->uniqueid, ast_channel_uniqueid((channel_var))->unique_id, sizeof((expected_record)->uniqueid)); \
+ ast_copy_string((expected_record)->linkedid, ast_channel_linkedid((channel_var))->unique_id, sizeof((expected_record)->linkedid)); \
ast_channel_unlock((channel_var)); \
} while (0)
@@ -246,8 +246,8 @@
#define CREATE_BOB_CHANNEL(channel_var, caller_id, expected_record) do { \
(channel_var) = ast_channel_alloc(0, AST_STATE_DOWN, "200", "Bob", "200", "200", "default", NULL, 0, CHANNEL_TECH_NAME "/Bob"); \
ast_channel_set_caller((channel_var), (caller_id), NULL); \
- ast_copy_string((expected_record)->uniqueid, ast_channel_uniqueid((channel_var)), sizeof((expected_record)->uniqueid)); \
- ast_copy_string((expected_record)->linkedid, ast_channel_linkedid((channel_var)), sizeof((expected_record)->linkedid)); \
+ ast_copy_string((expected_record)->uniqueid, ast_channel_uniqueid((channel_var))->unique_id, sizeof((expected_record)->uniqueid)); \
+ ast_copy_string((expected_record)->linkedid, ast_channel_linkedid((channel_var))->unique_id, sizeof((expected_record)->linkedid)); \
ast_channel_unlock((channel_var)); \
} while (0)
@@ -256,8 +256,8 @@
#define CREATE_CHARLIE_CHANNEL(channel_var, caller_id, expected_record) do { \
(channel_var) = ast_channel_alloc(0, AST_STATE_DOWN, "300", "Charlie", "300", "300", "default", NULL, 0, CHANNEL_TECH_NAME "/Charlie"); \
ast_channel_set_caller((channel_var), (caller_id), NULL); \
- ast_copy_string((expected_record)->uniqueid, ast_channel_uniqueid((channel_var)), sizeof((expected_record)->uniqueid)); \
- ast_copy_string((expected_record)->linkedid, ast_channel_linkedid((channel_var)), sizeof((expected_record)->linkedid)); \
+ ast_copy_string((expected_record)->uniqueid, ast_channel_uniqueid((channel_var))->unique_id, sizeof((expected_record)->uniqueid)); \
+ ast_copy_string((expected_record)->linkedid, ast_channel_linkedid((channel_var))->unique_id, sizeof((expected_record)->linkedid)); \
ast_channel_unlock((channel_var)); \
} while (0)
@@ -266,8 +266,8 @@
#define CREATE_DAVID_CHANNEL(channel_var, caller_id, expected_record) do { \
(channel_var) = ast_channel_alloc(0, AST_STATE_DOWN, "400", "David", "400", "400", "default", NULL, 0, CHANNEL_TECH_NAME "/David"); \
ast_channel_set_caller((channel_var), (caller_id), NULL); \
- ast_copy_string((expected_record)->uniqueid, ast_channel_uniqueid((channel_var)), sizeof((expected_record)->uniqueid)); \
- ast_copy_string((expected_record)->linkedid, ast_channel_linkedid((channel_var)), sizeof((expected_record)->linkedid)); \
+ ast_copy_string((expected_record)->uniqueid, ast_channel_uniqueid((channel_var))->unique_id, sizeof((expected_record)->uniqueid)); \
+ ast_copy_string((expected_record)->linkedid, ast_channel_linkedid((channel_var))->unique_id, sizeof((expected_record)->linkedid)); \
ast_channel_unlock((channel_var)); \
} while (0)
@@ -584,8 +584,8 @@
chan_bob = ast_channel_alloc(0, AST_STATE_DOWN, NULL, NULL, "200", NULL, NULL, ast_channel_linkedid(chan_alice), 0, CHANNEL_TECH_NAME "/Bob");
ast_channel_unlock(chan_bob);
- ast_copy_string(bob_expected.linkedid, ast_channel_linkedid(chan_bob), sizeof(bob_expected.linkedid));
- ast_copy_string(bob_expected.uniqueid, ast_channel_uniqueid(chan_bob), sizeof(bob_expected.uniqueid));
+ ast_copy_string(bob_expected.linkedid, ast_channel_linkedid(chan_bob)->unique_id, sizeof(bob_expected.linkedid));
[... 138 lines stripped ...]
More information about the asterisk-commits
mailing list