[asterisk-commits] bmd: branch group/newcdr r117990 - /team/group/newcdr/channels/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu May 22 16:45:20 CDT 2008
Author: bmd
Date: Thu May 22 16:45:19 2008
New Revision: 117990
URL: http://svn.digium.com/view/asterisk?view=rev&rev=117990
Log:
finish off converting the remaining channels to the new api so that this will compile once again
Modified:
team/group/newcdr/channels/chan_agent.c
team/group/newcdr/channels/chan_alsa.c
team/group/newcdr/channels/chan_console.c
team/group/newcdr/channels/chan_features.c
team/group/newcdr/channels/chan_gtalk.c
team/group/newcdr/channels/chan_h323.c
team/group/newcdr/channels/chan_mgcp.c
team/group/newcdr/channels/chan_misdn.c
team/group/newcdr/channels/chan_nbs.c
team/group/newcdr/channels/chan_oss.c
team/group/newcdr/channels/chan_phone.c
team/group/newcdr/channels/chan_skinny.c
team/group/newcdr/channels/chan_usbradio.c
team/group/newcdr/channels/chan_vpb.cc
Modified: team/group/newcdr/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_agent.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_agent.c (original)
+++ team/group/newcdr/channels/chan_agent.c Thu May 22 16:45:19 2008
@@ -209,7 +209,7 @@
} while(0)
/*--- Forward declarations */
-static struct ast_channel *agent_request(const char *type, int format, void *data, int *cause);
+static struct ast_channel *agent_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause);
static int agent_devicestate(void *data);
static void agent_logoff_maintenance(struct agent_pvt *p, char *loginchan, long logintime, const char *uniqueid, char *logcommand);
static int agent_digit_begin(struct ast_channel *ast, char digit);
@@ -924,7 +924,7 @@
}
/*! \brief Create new agent channel */
-static struct ast_channel *agent_new(struct agent_pvt *p, int state)
+static struct ast_channel *agent_new(struct agent_pvt *p, int state, const char *linkedid)
{
struct ast_channel *tmp;
#if 0
@@ -934,9 +934,9 @@
}
#endif
if (p->pending)
- tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", 0, "Agent/P%s-%d", p->agent, ast_random() & 0xffff);
+ tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", linkedid, 0, "Agent/P%s-%d", p->agent, ast_random() & 0xffff);
else
- tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", 0, "Agent/%s", p->agent);
+ tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", linkedid, 0, "Agent/%s", p->agent);
if (!tmp) {
ast_log(LOG_WARNING, "Unable to allocate agent channel structure\n");
return NULL;
@@ -1188,7 +1188,7 @@
if (!p->abouttograb && p->pending && ((p->group && (newlyavailable->group & p->group)) || !strcmp(p->agent, newlyavailable->agent))) {
ast_debug(1, "Call '%s' looks like a winner for agent '%s'\n", p->owner->name, newlyavailable->agent);
/* We found a pending call, time to merge */
- chan = agent_new(newlyavailable, AST_STATE_DOWN);
+ chan = agent_new(newlyavailable, AST_STATE_DOWN, p->owner ? p->owner->linkedid : NULL);
parent = p->owner;
p->abouttograb = 1;
ast_mutex_unlock(&p->lock);
@@ -1273,7 +1273,7 @@
}
/*! \brief Part of the Asterisk PBX interface */
-static struct ast_channel *agent_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *agent_request(const char *type, int format, const struct ast_channel* requestor, void *data, int *cause)
{
struct agent_pvt *p;
struct ast_channel *chan = NULL;
@@ -1307,7 +1307,7 @@
/* Agent must be registered, but not have any active call, and not be in a waiting state */
if (!p->owner && p->chan) {
/* Fixed agent */
- chan = agent_new(p, AST_STATE_DOWN);
+ chan = agent_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
}
if (chan) {
ast_mutex_unlock(&p->lock);
@@ -1332,12 +1332,12 @@
/* Agent must be registered, but not have any active call, and not be in a waiting state */
if (!p->owner && p->chan) {
/* Could still get a fixed agent */
- chan = agent_new(p, AST_STATE_DOWN);
+ chan = agent_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
} else if (!p->owner && !ast_strlen_zero(p->loginchan)) {
/* Adjustable agent */
- p->chan = ast_request("Local", format, p->loginchan, cause);
+ p->chan = ast_request("Local", format, requestor, p->loginchan, cause);
if (p->chan)
- chan = agent_new(p, AST_STATE_DOWN);
+ chan = agent_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
}
if (chan) {
ast_mutex_unlock(&p->lock);
@@ -1356,7 +1356,7 @@
ast_debug(1, "Creating place holder for '%s'\n", s);
p = add_agent(data, 1);
p->group = groupmatch;
- chan = agent_new(p, AST_STATE_DOWN);
+ chan = agent_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
if (!chan)
ast_log(LOG_WARNING, "Weird... Fix this to drop the unused pending agent\n");
} else {
Modified: team/group/newcdr/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_alsa.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_alsa.c (original)
+++ team/group/newcdr/channels/chan_alsa.c Thu May 22 16:45:19 2008
@@ -129,7 +129,7 @@
static int autoanswer = 1;
-static struct ast_channel *alsa_request(const char *type, int format, void *data, int *cause);
+static struct ast_channel *alsa_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause);
static int alsa_digit(struct ast_channel *c, char digit, unsigned int duration);
static int alsa_text(struct ast_channel *c, const char *text);
static int alsa_hangup(struct ast_channel *c);
@@ -529,11 +529,11 @@
return res;
}
-static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state)
+static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state, const char *linkedid)
{
struct ast_channel *tmp = NULL;
- if (!(tmp = ast_channel_alloc(1, state, 0, 0, "", p->exten, p->context, 0, "ALSA/%s", indevname)))
+ if (!(tmp = ast_channel_alloc(1, state, 0, 0, "", p->exten, p->context, linkedid, 0, "ALSA/%s", indevname)))
return NULL;
tmp->tech = &alsa_tech;
@@ -562,7 +562,7 @@
return tmp;
}
-static struct ast_channel *alsa_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *alsa_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause)
{
int oldformat = format;
struct ast_channel *tmp = NULL;
@@ -577,7 +577,7 @@
if (alsa.owner) {
ast_log(LOG_NOTICE, "Already have a call on the ALSA channel\n");
*cause = AST_CAUSE_BUSY;
- } else if (!(tmp = alsa_new(&alsa, AST_STATE_DOWN))) {
+ } else if (!(tmp = alsa_new(&alsa, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL))) {
ast_log(LOG_WARNING, "Unable to create new ALSA channel\n");
}
@@ -830,7 +830,7 @@
ast_copy_string(alsa.exten, mye, sizeof(alsa.exten));
ast_copy_string(alsa.context, myc, sizeof(alsa.context));
hookstate = 1;
- alsa_new(&alsa, AST_STATE_RINGING);
+ alsa_new(&alsa, AST_STATE_RINGING, NULL);
} else
ast_cli(a->fd, "No such extension '%s' in context '%s'\n", mye, myc);
}
Modified: team/group/newcdr/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_console.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_console.c (original)
+++ team/group/newcdr/channels/chan_console.c Thu May 22 16:45:19 2008
@@ -189,8 +189,8 @@
static struct ast_jb_conf global_jbconf;
/*! Channel Technology Callbacks @{ */
-static struct ast_channel *console_request(const char *type, int format,
- void *data, int *cause);
+static struct ast_channel *console_request(const char *type, int format,
+ const struct ast_channel *requestor, void *data, int *cause);
static int console_digit_begin(struct ast_channel *c, char digit);
static int console_digit_end(struct ast_channel *c, char digit, unsigned int duration);
static int console_text(struct ast_channel *c, const char *text);
@@ -413,12 +413,12 @@
/*!
* \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)
+static struct ast_channel *console_new(struct console_pvt *pvt, const char *ext, const char *ctx, int state, const char *linkedid)
{
struct ast_channel *chan;
if (!(chan = ast_channel_alloc(1, state, pvt->cid_num, pvt->cid_name, NULL,
- ext, ctx, 0, "Console/%s", pvt->name))) {
+ ext, ctx, linkedid, 0, "Console/%s", pvt->name))) {
return NULL;
}
@@ -447,7 +447,7 @@
return chan;
}
-static struct ast_channel *console_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *console_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause)
{
int oldformat = format;
struct ast_channel *chan = NULL;
@@ -471,7 +471,7 @@
}
console_pvt_lock(pvt);
- chan = console_new(pvt, NULL, NULL, AST_STATE_DOWN);
+ chan = console_new(pvt, NULL, NULL, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
console_pvt_unlock(pvt);
if (!chan)
@@ -832,7 +832,7 @@
if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {
console_pvt_lock(pvt);
pvt->hookstate = 1;
- console_new(pvt, mye, myc, AST_STATE_RINGING);
+ console_new(pvt, mye, myc, AST_STATE_RINGING, NULL);
console_pvt_unlock(pvt);
} else
ast_cli(a->fd, "No such extension '%s' in context '%s'\n", mye, myc);
Modified: team/group/newcdr/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_features.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_features.c (original)
+++ team/group/newcdr/channels/chan_features.c Thu May 22 16:45:19 2008
@@ -82,7 +82,7 @@
#define SUB_CALLWAIT 1 /* Call-Waiting call on hold */
#define SUB_THREEWAY 2 /* Three-way call */
-static struct ast_channel *features_request(const char *type, int format, void *data, int *cause);
+static struct ast_channel *features_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause);
static int features_digit_begin(struct ast_channel *ast, char digit);
static int features_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
static int features_call(struct ast_channel *ast, char *dest, int timeout);
@@ -384,7 +384,7 @@
return 0;
}
-static struct feature_pvt *features_alloc(char *data, int format)
+static struct feature_pvt *features_alloc(char *data, int format, const struct ast_channel *requestor)
{
struct feature_pvt *tmp;
char *dest=NULL;
@@ -413,7 +413,7 @@
}
AST_LIST_UNLOCK(&features);
if (!tmp) {
- chan = ast_request(tech, format, dest, &status);
+ chan = ast_request(tech, format, requestor, dest, &status);
if (!chan) {
ast_log(LOG_NOTICE, "Unable to allocate subchannel '%s/%s'\n", tech, dest);
return NULL;
@@ -434,7 +434,7 @@
return tmp;
}
-static struct ast_channel *features_new(struct feature_pvt *p, int state, int index)
+static struct ast_channel *features_new(struct feature_pvt *p, int state, int index, const char *linkedid)
{
struct ast_channel *tmp;
int x,y;
@@ -461,7 +461,7 @@
if (y >= 3)
break;
}
- tmp = ast_channel_alloc(0, state, 0,0, "", "", "", 0, "Feature/%s", b2);
+ tmp = ast_channel_alloc(0, state, 0,0, "", "", "", linkedid, 0, "Feature/%s", b2);
/* free up the name, it was copied into the channel name */
if (b2)
ast_free(b2);
@@ -484,14 +484,14 @@
}
-static struct ast_channel *features_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *features_request(const char *type, int format, const struct ast_channel* requestor, void *data, int *cause)
{
struct feature_pvt *p;
struct ast_channel *chan = NULL;
- p = features_alloc(data, format);
+ p = features_alloc(data, format, requestor);
if (p && !p->subs[SUB_REAL].owner)
- chan = features_new(p, AST_STATE_DOWN, SUB_REAL);
+ chan = features_new(p, AST_STATE_DOWN, SUB_REAL, requestor ? requestor->linkedid : NULL);
if (chan)
update_features(p,SUB_REAL);
return chan;
Modified: team/group/newcdr/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_gtalk.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_gtalk.c (original)
+++ team/group/newcdr/channels/chan_gtalk.c Thu May 22 16:45:19 2008
@@ -164,7 +164,7 @@
AST_MUTEX_DEFINE_STATIC(gtalklock); /*!< Protect the interface list (of gtalk_pvt's) */
/* Forward declarations */
-static struct ast_channel *gtalk_request(const char *type, int format, void *data, int *cause);
+static struct ast_channel *gtalk_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause);
static int gtalk_digit(struct ast_channel *ast, char digit, unsigned int duration);
static int gtalk_digit_begin(struct ast_channel *ast, char digit);
static int gtalk_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
@@ -961,7 +961,7 @@
}
/*! \brief Start new gtalk channel */
-static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i, int state, const char *title)
+static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i, int state, const char *title, const char *linkedid)
{
struct ast_channel *tmp;
int fmt;
@@ -972,7 +972,7 @@
n2 = title;
else
n2 = i->us;
- tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, 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, linkedid, client->accountcode, i->exten, client->context, client->amaflags, "Gtalk/%s-%04lx", n2, ast_random() & 0xffff);
if (!tmp) {
ast_log(LOG_WARNING, "Unable to allocate Gtalk channel structure!\n");
return NULL;
@@ -1148,7 +1148,7 @@
return -1;
}
- chan = gtalk_new(client, p, AST_STATE_DOWN, pak->from->user);
+ chan = gtalk_new(client, p, AST_STATE_DOWN, pak->from->user, NULL);
if (!chan) {
gtalk_free_pvt(client, p);
return -1;
@@ -1583,7 +1583,7 @@
}
/*! \brief Part of PBX interface */
-static struct ast_channel *gtalk_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *gtalk_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause)
{
struct gtalk_pvt *p = NULL;
struct gtalk *client = NULL;
@@ -1610,7 +1610,7 @@
ASTOBJ_WRLOCK(client);
p = gtalk_alloc(client, strchr(sender, '@') ? sender : client->connection->jid->full, strchr(to, '@') ? to : client->user, NULL);
if (p)
- chan = gtalk_new(client, p, AST_STATE_DOWN, to);
+ chan = gtalk_new(client, p, AST_STATE_DOWN, to, requestor ? requestor->linkedid : NULL);
ASTOBJ_UNLOCK(client);
return chan;
Modified: team/group/newcdr/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_h323.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_h323.c (original)
+++ team/group/newcdr/channels/chan_h323.c Thu May 22 16:45:19 2008
@@ -228,7 +228,7 @@
static void delete_aliases(void);
static void prune_peers(void);
-static struct ast_channel *oh323_request(const char *type, int format, void *data, int *cause);
+static struct ast_channel *oh323_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause);
static int oh323_digit_begin(struct ast_channel *c, char digit);
static int oh323_digit_end(struct ast_channel *c, char digit, unsigned int duration);
static int oh323_call(struct ast_channel *c, char *dest, int timeout);
@@ -994,7 +994,7 @@
}
/*! \brief Private structure should be locked on a call */
-static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const char *host)
+static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const char *host, const char *linkedid)
{
struct ast_channel *ch;
char *cid_num, *cid_name;
@@ -1012,7 +1012,7 @@
/* Don't hold a oh323_pvt lock while we allocate a chanel */
ast_mutex_unlock(&pvt->lock);
- ch = ast_channel_alloc(1, state, cid_num, cid_name, pvt->accountcode, pvt->exten, pvt->context, pvt->amaflags, "H323/%s", host);
+ ch = ast_channel_alloc(1, state, cid_num, cid_name, pvt->accountcode, pvt->exten, pvt->context, linkedid, pvt->amaflags, "H323/%s", host);
/* Update usage counter */
ast_module_ref(ast_module_info->self);
ast_mutex_lock(&pvt->lock);
@@ -1711,7 +1711,7 @@
return 0;
}
}
-static struct ast_channel *oh323_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *oh323_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause)
{
int oldformat;
struct oh323_pvt *pvt;
@@ -1787,7 +1787,7 @@
ast_mutex_unlock(&caplock);
ast_mutex_lock(&pvt->lock);
- tmpc = __oh323_new(pvt, AST_STATE_DOWN, tmp1);
+ tmpc = __oh323_new(pvt, AST_STATE_DOWN, tmp1, requestor ? requestor->linkedid : NULL);
ast_mutex_unlock(&pvt->lock);
if (!tmpc) {
oh323_destroy(pvt);
@@ -2281,7 +2281,7 @@
}
/* allocate a channel and tell asterisk about it */
- c = __oh323_new(pvt, AST_STATE_RINGING, pvt->cd.call_token);
+ c = __oh323_new(pvt, AST_STATE_RINGING, pvt->cd.call_token, NULL);
/* And release when done */
ast_mutex_unlock(&pvt->lock);
Modified: team/group/newcdr/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_mgcp.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_mgcp.c (original)
+++ team/group/newcdr/channels/chan_mgcp.c Thu May 22 16:45:19 2008
@@ -416,7 +416,7 @@
static char *mgcp_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
static int reload_config(int reload);
-static struct ast_channel *mgcp_request(const char *type, int format, void *data, int *cause);
+static struct ast_channel *mgcp_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause);
static int mgcp_call(struct ast_channel *ast, char *dest, int timeout);
static int mgcp_hangup(struct ast_channel *ast);
static int mgcp_answer(struct ast_channel *ast);
@@ -1495,13 +1495,13 @@
return res;
}
-static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
+static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state, const char *linkedid)
{
struct ast_channel *tmp;
struct mgcp_endpoint *i = sub->parent;
int fmt;
- tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, i->amaflags, "MGCP/%s@%s-%d", i->name, i->parent->name, sub->id);
+ tmp = 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);
if (tmp) {
tmp->tech = &mgcp_tech;
tmp->nativeformats = i->capability;
@@ -3005,7 +3005,7 @@
#else
transmit_notify_request(sub, "G/rt");
#endif
- c = mgcp_new(sub, AST_STATE_RING);
+ c = mgcp_new(sub, AST_STATE_RING, NULL);
if (!c) {
ast_log(LOG_WARNING, "Unable to start PBX on channel %s@%s\n", p->name, p->parent->name);
transmit_notify_request(sub, "G/cg");
@@ -3017,7 +3017,7 @@
} else {
transmit_notify_request(sub, "L/dl");
}
- c = mgcp_new(sub, AST_STATE_DOWN);
+ c = mgcp_new(sub, AST_STATE_DOWN, NULL);
if (c) {
if (ast_pthread_create_detached(&t, NULL, mgcp_ss, c)) {
ast_log(LOG_WARNING, "Unable to create switch thread: %s\n", strerror(errno));
@@ -3526,7 +3526,7 @@
return 0;
}
-static struct ast_channel *mgcp_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *mgcp_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause)
{
int oldformat;
struct mgcp_subchannel *sub;
@@ -3570,7 +3570,7 @@
ast_mutex_unlock(&sub->lock);
return NULL;
}
- tmpc = mgcp_new(sub->owner ? sub->next : sub, AST_STATE_DOWN);
+ tmpc = mgcp_new(sub->owner ? sub->next : sub, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
ast_mutex_unlock(&sub->lock);
if (!tmpc)
ast_log(LOG_WARNING, "Unable to make channel for '%s'\n", tmp);
Modified: team/group/newcdr/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_misdn.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_misdn.c (original)
+++ team/group/newcdr/channels/chan_misdn.c Thu May 22 16:45:19 2008
@@ -288,7 +288,7 @@
static void chan_misdn_log(int level, int port, char *tmpl, ...)
__attribute__ ((format (printf, 3, 4)));
-static struct ast_channel *misdn_new(struct chan_list *cl, int state, char *exten, char *callerid, int format, int port, int c);
+static struct ast_channel *misdn_new(struct chan_list *cl, int state, char *exten, char *callerid, int format, const char *linkedid, int port, int c);
static void send_digit_to_chan(struct chan_list *cl, char digit );
static void hangup_chan(struct chan_list *ch);
@@ -3191,7 +3191,7 @@
return cl;
}
-static struct ast_channel *misdn_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *misdn_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause)
{
struct ast_channel *tmp = NULL;
char group[BUFFERSIZE + 1] = "";
@@ -3346,7 +3346,7 @@
/* create ast_channel and link all the objects together */
cl->bc = newbc;
- tmp = misdn_new(cl, AST_STATE_RESERVED, ext, NULL, format, port, channel);
+ tmp = misdn_new(cl, AST_STATE_RESERVED, ext, NULL, format, requestor ? requestor->linkedid : NULL, port, channel);
if (!tmp) {
ast_log(LOG_ERROR,"Could not create Asterisk object\n");
return NULL;
@@ -3443,7 +3443,7 @@
}
}
-static struct ast_channel *misdn_new(struct chan_list *chlist, int state, char *exten, char *callerid, int format, int port, int c)
+static struct ast_channel *misdn_new(struct chan_list *chlist, int state, char *exten, char *callerid, int format, const char *linkedid, int port, int c)
{
struct ast_channel *tmp;
char *cid_name = 0, *cid_num = 0;
@@ -3463,7 +3463,7 @@
ast_callerid_parse(callerid, &cid_name, &cid_num);
}
- tmp = ast_channel_alloc(1, state, cid_num, cid_name, "", exten, "", 0, "%s/%s%d-u%d", misdn_type, c ? "" : "tmp", chan_offset + c, glob_channel++);
+ tmp = ast_channel_alloc(1, state, cid_num, cid_name, "", exten, "", linkedid, 0, "%s/%s%d-u%d", misdn_type, c ? "" : "tmp", chan_offset + c, glob_channel++);
if (tmp) {
chan_misdn_log(2, 0, " --> * NEW CHANNEL dad:%s oad:%s\n", exten, callerid);
@@ -4266,7 +4266,7 @@
ch->addr = bc->addr;
ch->originator = ORG_MISDN;
- chan = misdn_new(ch, AST_STATE_RESERVED, bc->dad, bc->oad, AST_FORMAT_ALAW, bc->port, bc->channel);
+ chan = misdn_new(ch, AST_STATE_RESERVED, bc->dad, bc->oad, AST_FORMAT_ALAW, NULL, bc->port, bc->channel);
if (!chan) {
misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
Modified: team/group/newcdr/channels/chan_nbs.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_nbs.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_nbs.c (original)
+++ team/group/newcdr/channels/chan_nbs.c Thu May 22 16:45:19 2008
@@ -66,7 +66,7 @@
struct ast_module_user *u; /*! for holding a reference to this module */
};
-static struct ast_channel *nbs_request(const char *type, int format, void *data, int *cause);
+static struct ast_channel *nbs_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause);
static int nbs_call(struct ast_channel *ast, char *dest, int timeout);
static int nbs_hangup(struct ast_channel *ast);
static struct ast_frame *nbs_xread(struct ast_channel *ast);
@@ -219,10 +219,10 @@
return 0;
}
-static struct ast_channel *nbs_new(struct nbs_pvt *i, int state)
+static struct ast_channel *nbs_new(struct nbs_pvt *i, int state, const char *linkedid)
{
struct ast_channel *tmp;
- tmp = ast_channel_alloc(1, state, 0, 0, "", "s", context, 0, "NBS/%s", i->stream);
+ tmp = ast_channel_alloc(1, state, 0, 0, "", "s", context, linkedid, 0, "NBS/%s", i->stream);
if (tmp) {
tmp->tech = &nbs_tech;
ast_channel_set_fd(tmp, 0, nbs_fd(i->nbs));
@@ -251,7 +251,7 @@
}
-static struct ast_channel *nbs_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *nbs_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause)
{
int oldformat;
struct nbs_pvt *p;
@@ -265,7 +265,7 @@
}
p = nbs_alloc(data);
if (p) {
- tmp = nbs_new(p, AST_STATE_DOWN);
+ tmp = nbs_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
if (!tmp)
nbs_destroy(p);
}
Modified: team/group/newcdr/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_oss.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_oss.c (original)
+++ team/group/newcdr/channels/chan_oss.c Thu May 22 16:45:19 2008
@@ -332,8 +332,8 @@
static int setformat(struct chan_oss_pvt *o, int mode);
-static struct ast_channel *oss_request(const char *type, int format, void *data
-, int *cause);
+static struct ast_channel *oss_request(const char *type, int format, const struct ast_channel *requestor,
+ void *data, int *cause);
static int oss_digit_begin(struct ast_channel *c, char digit);
static int oss_digit_end(struct ast_channel *c, char digit, unsigned int duration);
static int oss_text(struct ast_channel *c, const char *text);
@@ -785,11 +785,11 @@
/*!
* \brief allocate a new channel.
*/
-static struct ast_channel *oss_new(struct chan_oss_pvt *o, char *ext, char *ctx, int state)
+static struct ast_channel *oss_new(struct chan_oss_pvt *o, char *ext, char *ctx, int state, const char *linkedid)
{
struct ast_channel *c;
- c = ast_channel_alloc(1, state, o->cid_num, o->cid_name, "", ext, ctx, 0, "Console/%s", o->device + 5);
+ c = ast_channel_alloc(1, state, o->cid_num, o->cid_name, "", ext, ctx, linkedid, 0, "Console/%s", o->device + 5);
if (c == NULL)
return NULL;
c->tech = &oss_tech;
@@ -829,7 +829,7 @@
return c;
}
-static struct ast_channel *oss_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *oss_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause)
{
struct ast_channel *c;
struct chan_oss_pvt *o;
@@ -857,7 +857,7 @@
*cause = AST_CAUSE_BUSY;
return NULL;
}
- c = oss_new(o, NULL, NULL, AST_STATE_DOWN);
+ c = oss_new(o, NULL, NULL, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
if (c == NULL) {
ast_log(LOG_WARNING, "Unable to create new OSS channel\n");
return NULL;
@@ -1113,7 +1113,7 @@
myc = o->ctx;
if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {
o->hookstate = 1;
- oss_new(o, mye, myc, AST_STATE_RINGING);
+ oss_new(o, mye, myc, AST_STATE_RINGING, NULL);
} else
ast_cli(a->fd, "No such extension '%s' in context '%s'\n", mye, myc);
if (s)
Modified: team/group/newcdr/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_phone.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_phone.c (original)
+++ team/group/newcdr/channels/chan_phone.c Thu May 22 16:45:19 2008
@@ -150,7 +150,7 @@
static char cid_num[AST_MAX_EXTENSION];
static char cid_name[AST_MAX_EXTENSION];
-static struct ast_channel *phone_request(const char *type, int format, void *data, int *cause);
+static struct ast_channel *phone_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause);
static int phone_digit_begin(struct ast_channel *ast, char digit);
static int phone_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
static int phone_call(struct ast_channel *ast, char *dest, int timeout);
@@ -844,11 +844,11 @@
return 0;
}
-static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *context)
+static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *context, const char *linkedid)
{
struct ast_channel *tmp;
struct phone_codec_data codec;
- tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, "", i->ext, i->context, 0, "Phone/%s", i->dev + 5);
+ tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, "", i->ext, i->context, linkedid, 0, "Phone/%s", i->dev + 5);
if (tmp) {
tmp->tech = cur_tech;
ast_channel_set_fd(tmp, 0, i->fd);
@@ -941,14 +941,14 @@
!phonee.bits.dtmf_ready) &&
ast_exists_extension(NULL, i->context, i->ext, 1, i->cid_num)) {
/* It's a valid extension in its context, get moving! */
- phone_new(i, AST_STATE_RING, i->context);
+ phone_new(i, AST_STATE_RING, i->context, NULL);
/* No need to restart monitor, we are the monitor */
} else if (!ast_canmatch_extension(NULL, i->context, i->ext, 1, i->cid_num)) {
/* There is nothing in the specified extension that can match anymore.
Try the default */
if (ast_exists_extension(NULL, "default", i->ext, 1, i->cid_num)) {
/* Check the default, too... */
- phone_new(i, AST_STATE_RING, "default");
+ phone_new(i, AST_STATE_RING, "default", NULL);
/* XXX This should probably be justified better XXX */
} else if (!ast_canmatch_extension(NULL, "default", i->ext, 1, i->cid_num)) {
/* It's not a valid extension, give a busy signal */
@@ -966,7 +966,7 @@
offhook = ioctl(i->fd, PHONE_HOOKSTATE);
if (offhook) {
if (i->mode == MODE_IMMEDIATE) {
- phone_new(i, AST_STATE_RING, i->context);
+ phone_new(i, AST_STATE_RING, i->context, NULL);
} else if (i->mode == MODE_DIALTONE) {
ast_module_ref(ast_module_info->self);
/* Reset the extension */
@@ -1002,7 +1002,7 @@
}
if (phonee.bits.pstn_ring) {
ast_verbose("Unit is ringing\n");
- phone_new(i, AST_STATE_RING, i->context);
+ phone_new(i, AST_STATE_RING, i->context, NULL);
}
if (phonee.bits.caller_id)
ast_verbose("We have caller ID\n");
@@ -1212,7 +1212,7 @@
return tmp;
}
-static struct ast_channel *phone_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *phone_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause)
{
int oldformat;
struct phone_pvt *p;
@@ -1232,7 +1232,7 @@
if (strncmp(name, p->dev + 5, length) == 0 &&
!isalnum(name[length])) {
if (!p->owner) {
- tmp = phone_new(p, AST_STATE_DOWN, p->context);
+ tmp = phone_new(p, AST_STATE_DOWN, p->context, requestor ? requestor->linkedid : NULL);
break;
} else
*cause = AST_CAUSE_BUSY;
Modified: team/group/newcdr/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_skinny.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_skinny.c (original)
+++ team/group/newcdr/channels/chan_skinny.c Thu May 22 16:45:19 2008
@@ -1266,7 +1266,7 @@
struct skinnysession *next;
} *sessions = NULL;
-static struct ast_channel *skinny_request(const char *type, int format, void *data, int *cause);
+static struct ast_channel *skinny_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause);
static int skinny_devicestate(void *data);
static int skinny_call(struct ast_channel *ast, char *dest, int timeout);
static int skinny_hangup(struct ast_channel *ast);
@@ -3774,7 +3774,7 @@
return 0;
}
-static struct ast_channel *skinny_new(struct skinny_line *l, int state)
+static struct ast_channel *skinny_new(struct skinny_line *l, int state, const char *linkedid)
{
struct ast_channel *tmp;
struct skinny_subchannel *sub;
@@ -3782,7 +3782,7 @@
struct ast_variable *v = NULL;
int fmt;
- tmp = ast_channel_alloc(1, state, l->cid_num, l->cid_name, l->accountcode, l->exten, l->context, l->amaflags, "Skinny/%s@%s-%d", l->name, d->name, callnums);
+ tmp = ast_channel_alloc(1, state, l->cid_num, l->cid_name, l->accountcode, l->exten, l->context, linkedid, l->amaflags, "Skinny/%s@%s-%d", l->name, d->name, callnums);
if (!tmp) {
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
return NULL;
@@ -4155,7 +4155,7 @@
break;
}
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
if (!c) {
ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n", l->name, d->name);
} else {
@@ -4192,7 +4192,7 @@
}
if (!sub || !sub->owner)
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
else
c = sub->owner;
@@ -4256,7 +4256,7 @@
ast_verb(1, "Received Stimulus: Voicemail(%d/%d)\n", instance, callreference);
if (!sub || !sub->owner) {
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
} else {
c = sub->owner;
}
@@ -4324,7 +4324,7 @@
ast_verb(1, "Received Stimulus: Forward All(%d/%d)\n", instance, callreference);
if (!sub || !sub->owner) {
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
} else {
c = sub->owner;
}
@@ -4341,7 +4341,7 @@
ast_verb(1, "Received Stimulus: Forward Busy (%d/%d)\n", instance, callreference);
if (!sub || !sub->owner) {
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
} else {
c = sub->owner;
}
@@ -4359,7 +4359,7 @@
#if 0 /* Not sure how to handle this yet */
if (!sub || !sub->owner) {
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
} else {
c = sub->owner;
}
@@ -4410,7 +4410,7 @@
if (sub && sub->owner) {
ast_debug(1, "Current subchannel [%s] already has owner\n", sub->owner->name);
} else {
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
if (c) {
sub = c->tech_pvt;
transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid);
@@ -4489,7 +4489,7 @@
if (sub && sub->owner) {
ast_debug(1, "Current sub [%s] already has owner\n", sub->owner->name);
} else {
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
if (c) {
sub = c->tech_pvt;
transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid);
@@ -4969,7 +4969,7 @@
l = sub->parent;
}
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
if(!c) {
ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n", l->name, d->name);
@@ -5081,7 +5081,7 @@
}
if (!sub || !sub->owner) {
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
} else {
c = sub->owner;
}
@@ -5116,7 +5116,7 @@
ast_verb(1, "Received Softkey Event: New Call(%d/%d)\n", instance, callreference);
if (!sub || !sub->owner) {
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
} else {
c = sub->owner;
}
@@ -5189,7 +5189,7 @@
ast_verb(1, "Received Softkey Event: Forward All(%d/%d)\n", instance, callreference);
if (!sub || !sub->owner) {
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
} else {
c = sub->owner;
}
@@ -5206,7 +5206,7 @@
ast_verb(1, "Received Softkey Event: Forward Busy (%d/%d)\n", instance, callreference);
if (!sub || !sub->owner) {
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
} else {
c = sub->owner;
}
@@ -5224,7 +5224,7 @@
#if 0 /* Not sure how to handle this yet */
if (!sub || !sub->owner) {
- c = skinny_new(l, AST_STATE_DOWN);
+ c = skinny_new(l, AST_STATE_DOWN, NULL);
} else {
c = sub->owner;
}
@@ -5819,7 +5819,7 @@
return get_devicestate(l);
}
-static struct ast_channel *skinny_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *skinny_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause)
{
int oldformat;
@@ -5846,7 +5846,7 @@
return NULL;
}
ast_verb(3, "skinny_request(%s)\n", tmp);
- tmpc = skinny_new(l, AST_STATE_DOWN);
+ tmpc = skinny_new(l, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
if (!tmpc) {
ast_log(LOG_WARNING, "Unable to make channel for '%s'\n", tmp);
}
Modified: team/group/newcdr/channels/chan_usbradio.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/channels/chan_usbradio.c?view=diff&rev=117990&r1=117989&r2=117990
==============================================================================
--- team/group/newcdr/channels/chan_usbradio.c (original)
+++ team/group/newcdr/channels/chan_usbradio.c Thu May 22 16:45:19 2008
@@ -657,8 +657,9 @@
static int setformat(struct chan_usbradio_pvt *o, int mode);
-static struct ast_channel *usbradio_request(const char *type, int format, void *data
-, int *cause);
+static struct ast_channel *usbradio_request(const char *type, int format,
+ const struct ast_channel *requestor,
+ void *data, int *cause);
static int usbradio_digit_begin(struct ast_channel *c, char digit);
static int usbradio_digit_end(struct ast_channel *c, char digit, unsigned int duration);
static int usbradio_text(struct ast_channel *c, const char *text);
@@ -2165,11 +2166,11 @@
/*
* allocate a new channel.
*/
-static struct ast_channel *usbradio_new(struct chan_usbradio_pvt *o, char *ext, char *ctx, int state)
+static struct ast_channel *usbradio_new(struct chan_usbradio_pvt *o, char *ext, char *ctx, int state, const char *linkedid)
{
struct ast_channel *c;
- c = ast_channel_alloc(1, state, o->cid_num, o->cid_name, "", ext, ctx, 0, "Radio/%s", o->name);
+ c = ast_channel_alloc(1, state, o->cid_num, o->cid_name, "", ext, ctx, linkedid, 0, "Radio/%s", o->name);
if (c == NULL)
return NULL;
c->tech = &usbradio_tech;
@@ -2208,7 +2209,7 @@
}
/*
*/
-static struct ast_channel *usbradio_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *usbradio_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause)
{
struct ast_channel *c;
struct chan_usbradio_pvt *o = find_desc(data);
@@ -2233,7 +2234,7 @@
*cause = AST_CAUSE_BUSY;
return NULL;
}
- c = usbradio_new(o, NULL, NULL, AST_STATE_DOWN);
[... 107 lines stripped ...]
More information about the asterisk-commits
mailing list