[asterisk-commits] rmudgett: branch rmudgett/cid r263725 - in /team/rmudgett/cid: apps/ channels...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon May 17 18:58:43 CDT 2010
Author: rmudgett
Date: Mon May 17 18:58:38 2010
New Revision: 263725
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=263725
Log:
Convert users of ast_callerid to use ast_party_caller instead.
Modified:
team/rmudgett/cid/apps/app_dial.c
team/rmudgett/cid/apps/app_directed_pickup.c
team/rmudgett/cid/apps/app_queue.c
team/rmudgett/cid/channels/chan_dahdi.c
team/rmudgett/cid/channels/chan_local.c
team/rmudgett/cid/channels/sig_analog.c
team/rmudgett/cid/channels/sig_analog.h
team/rmudgett/cid/include/asterisk/channel.h
team/rmudgett/cid/main/channel.c
team/rmudgett/cid/main/dial.c
team/rmudgett/cid/main/features.c
Modified: team/rmudgett/cid/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/apps/app_dial.c?view=diff&rev=263725&r1=263724&r2=263725
==============================================================================
--- team/rmudgett/cid/apps/app_dial.c (original)
+++ team/rmudgett/cid/apps/app_dial.c Mon May 17 18:58:38 2010
@@ -875,7 +875,7 @@
S_REPLACE(c->cid.cid_name, NULL);
ast_string_field_set(c, accountcode, c->accountcode);
} else {
- ast_party_caller_copy(&c->cid, &in->cid);
+ ast_party_caller_copy(&c->caller, &in->caller);
ast_string_field_set(c, accountcode, in->accountcode);
}
ast_party_connected_line_copy(&c->connected, &original->connected);
@@ -978,7 +978,7 @@
if (!ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE) && !ast_test_flag64(outgoing, DIAL_NOCONNECTEDLINE)) {
ast_channel_lock(outgoing->chan);
- ast_connected_line_copy_from_caller(&connected_caller, &outgoing->chan->cid);
+ ast_connected_line_copy_from_caller(&connected_caller, &outgoing->chan->caller);
ast_channel_unlock(outgoing->chan);
connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
ast_channel_update_connected_line(in, &connected_caller);
@@ -1042,7 +1042,7 @@
}
} else if (!ast_test_flag64(o, DIAL_NOCONNECTEDLINE)) {
ast_channel_lock(c);
- ast_connected_line_copy_from_caller(&connected_caller, &c->cid);
+ ast_connected_line_copy_from_caller(&connected_caller, &c->caller);
ast_channel_unlock(c);
connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
ast_channel_update_connected_line(in, &connected_caller);
@@ -1104,7 +1104,7 @@
}
} else if (!ast_test_flag64(o, DIAL_NOCONNECTEDLINE)) {
ast_channel_lock(c);
- ast_connected_line_copy_from_caller(&connected_caller, &c->cid);
+ ast_connected_line_copy_from_caller(&connected_caller, &c->caller);
ast_channel_unlock(c);
connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
ast_channel_update_connected_line(in, &connected_caller);
@@ -2056,7 +2056,7 @@
}
ast_channel_set_connected_line(tmp->chan, &connected);
} else {
- ast_connected_line_copy_from_caller(&tc->connected, &chan->cid);
+ ast_connected_line_copy_from_caller(&tc->connected, &chan->caller);
}
ast_party_redirecting_copy(&tc->redirecting, &chan->redirecting);
Modified: team/rmudgett/cid/apps/app_directed_pickup.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/apps/app_directed_pickup.c?view=diff&rev=263725&r1=263724&r2=263725
==============================================================================
--- team/rmudgett/cid/apps/app_directed_pickup.c (original)
+++ team/rmudgett/cid/apps/app_directed_pickup.c Mon May 17 18:58:38 2010
@@ -116,7 +116,7 @@
ast_party_connected_line_free(&connected_caller);
ast_channel_lock(chan);
- ast_connected_line_copy_from_caller(&connected_caller, &chan->cid);
+ ast_connected_line_copy_from_caller(&connected_caller, &chan->caller);
ast_channel_unlock(chan);
connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
ast_channel_queue_connected_line_update(chan, &connected_caller);
Modified: team/rmudgett/cid/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/apps/app_queue.c?view=diff&rev=263725&r1=263724&r2=263725
==============================================================================
--- team/rmudgett/cid/apps/app_queue.c (original)
+++ team/rmudgett/cid/apps/app_queue.c Mon May 17 18:58:38 2010
@@ -2878,7 +2878,7 @@
tmp->chan->dialed.transit_network_select = qe->chan->dialed.transit_network_select;
- ast_connected_line_copy_from_caller(&tmp->chan->connected, &qe->chan->cid);
+ ast_connected_line_copy_from_caller(&tmp->chan->connected, &qe->chan->caller);
/* Inherit specially named variables from parent channel */
ast_channel_inherit_variables(qe->chan, tmp->chan);
@@ -3303,7 +3303,7 @@
}
} else if (o->update_connectedline) {
ast_channel_lock(o->chan);
- ast_connected_line_copy_from_caller(&connected_caller, &o->chan->cid);
+ ast_connected_line_copy_from_caller(&connected_caller, &o->chan->caller);
ast_channel_unlock(o->chan);
connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
ast_channel_update_connected_line(in, &connected_caller);
@@ -3372,7 +3372,7 @@
o->chan->dialed.transit_network_select = in->dialed.transit_network_select;
- ast_party_caller_copy(&o->chan->cid, &in->cid);
+ ast_party_caller_copy(&o->chan->caller, &in->caller);
ast_party_connected_line_copy(&o->chan->connected, &original->connected);
/*
@@ -3422,7 +3422,7 @@
}
} else if (o->update_connectedline) {
ast_channel_lock(o->chan);
- ast_connected_line_copy_from_caller(&connected_caller, &o->chan->cid);
+ ast_connected_line_copy_from_caller(&connected_caller, &o->chan->caller);
ast_channel_unlock(o->chan);
connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
ast_channel_update_connected_line(in, &connected_caller);
Modified: team/rmudgett/cid/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_dahdi.c?view=diff&rev=263725&r1=263724&r2=263725
==============================================================================
--- team/rmudgett/cid/channels/chan_dahdi.c (original)
+++ team/rmudgett/cid/channels/chan_dahdi.c Mon May 17 18:58:38 2010
@@ -1884,7 +1884,7 @@
return 0;
}
-static int my_send_callerid(void *pvt, int cwcid, struct ast_callerid *cid)
+static int my_send_callerid(void *pvt, int cwcid, struct ast_party_caller *caller)
{
struct dahdi_pvt *p = pvt;
@@ -1897,11 +1897,17 @@
if ((p->cidspill = ast_malloc(MAX_CALLERID_SIZE))) {
if (cwcid == 0) {
- p->cidlen = ast_callerid_generate(p->cidspill, cid->cid_name, cid->cid_num, AST_LAW(p));
+ p->cidlen = ast_callerid_generate(p->cidspill,
+ caller->id.XXX_name.str,
+ caller->id.XXX_number.str,
+ AST_LAW(p));
} else {
p->callwaitcas = 0;
p->cidcwexpire = 0;
- p->cidlen = ast_callerid_callwaiting_generate(p->cidspill, cid->cid_name, cid->cid_num, AST_LAW(p));
+ p->cidlen = ast_callerid_callwaiting_generate(p->cidspill,
+ caller->id.XXX_name.str,
+ caller->id.XXX_number.str,
+ AST_LAW(p));
p->cidlen += READ_SIZE * 4;
}
p->cidpos = 0;
Modified: team/rmudgett/cid/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_local.c?view=diff&rev=263725&r1=263724&r2=263725
==============================================================================
--- team/rmudgett/cid/channels/chan_local.c (original)
+++ team/rmudgett/cid/channels/chan_local.c Mon May 17 18:58:38 2010
@@ -434,7 +434,7 @@
unsigned char frame_data[1024];
if (condition == AST_CONTROL_CONNECTED_LINE) {
if (isoutbound) {
- ast_connected_line_copy_to_caller(&the_other_channel->cid, &this_channel->connected);
+ ast_connected_line_copy_to_caller(&the_other_channel->caller, &this_channel->connected);
}
f.datalen = ast_connected_line_build_data(frame_data, sizeof(frame_data), &this_channel->connected);
} else {
@@ -583,8 +583,8 @@
ast_party_dialed_copy(&p->chan->dialed, &p->owner->dialed);
- ast_connected_line_copy_to_caller(&p->chan->cid, &p->owner->connected);
- ast_connected_line_copy_from_caller(&p->chan->connected, &p->owner->cid);
+ ast_connected_line_copy_to_caller(&p->chan->caller, &p->owner->connected);
+ ast_connected_line_copy_from_caller(&p->chan->connected, &p->owner->caller);
ast_string_field_set(p->chan, language, p->owner->language);
ast_string_field_set(p->chan, accountcode, p->owner->accountcode);
Modified: team/rmudgett/cid/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/sig_analog.c?view=diff&rev=263725&r1=263724&r2=263725
==============================================================================
--- team/rmudgett/cid/channels/sig_analog.c (original)
+++ team/rmudgett/cid/channels/sig_analog.c Mon May 17 18:58:38 2010
@@ -351,16 +351,18 @@
return 0;
}
-static int analog_send_callerid(struct analog_pvt *p, int cwcid, struct ast_callerid *cid)
-{
- ast_debug(1, "Sending callerid. CID_NAME: '%s' CID_NUM: '%s'\n", cid->cid_name, cid->cid_num);
+static int analog_send_callerid(struct analog_pvt *p, int cwcid, struct ast_party_caller *caller)
+{
+ ast_debug(1, "Sending callerid. CID_NAME: '%s' CID_NUM: '%s'\n",
+ caller->id.XXX_name.str,
+ caller->id.XXX_number.str);
if (cwcid) {
p->callwaitcas = 0;
}
if (p->calls->send_callerid) {
- return p->calls->send_callerid(p->chan_pvt, cwcid, cid);
+ return p->calls->send_callerid(p->chan_pvt, cwcid, caller);
}
return 0;
}
@@ -950,8 +952,8 @@
if (p->use_callerid) {
p->callwaitcas = 0;
- p->cid.cid_name = p->lastcid_name;
- p->cid.cid_num = p->lastcid_num;
+ p->caller.id.XXX_name.str = p->lastcid_name;
+ p->caller.id.XXX_number.str = p->lastcid_num;
}
ast_setstate(ast, AST_STATE_RINGING);
@@ -1407,9 +1409,9 @@
if (p->callwaitcas) {
if ((f->subclass.integer == 'A') || (f->subclass.integer == 'D')) {
ast_log(LOG_ERROR, "Got some DTMF, but it's for the CAS\n");
- p->cid.cid_name = p->callwait_name;
- p->cid.cid_num = p->callwait_num;
- analog_send_callerid(p, 1, &p->cid);
+ p->caller.id.XXX_name.str = p->callwait_name;
+ p->caller.id.XXX_number.str = p->callwait_num;
+ analog_send_callerid(p, 1, &p->caller);
}
if (analog_handles_digit(f))
p->callwaitcas = 0;
@@ -2798,7 +2800,7 @@
if (p->inalarm) break;
ast->rings++;
if (ast->rings == p->cidrings) {
- analog_send_callerid(p, 0, &p->cid);
+ analog_send_callerid(p, 0, &p->caller);
}
if (ast->rings > p->cidrings) {
Modified: team/rmudgett/cid/channels/sig_analog.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/sig_analog.h?view=diff&rev=263725&r1=263724&r2=263725
==============================================================================
--- team/rmudgett/cid/channels/sig_analog.h (original)
+++ team/rmudgett/cid/channels/sig_analog.h Mon May 17 18:58:38 2010
@@ -156,7 +156,7 @@
int (* const train_echocanceller)(void *pvt);
int (* const dsp_set_digitmode)(void *pvt, enum analog_dsp_digitmode mode);
int (* const dsp_reset_and_flush_digits)(void *pvt);
- int (* const send_callerid)(void *pvt, int cwcid, struct ast_callerid *cid);
+ int (* const send_callerid)(void *pvt, int cwcid, struct ast_party_caller *caller);
/* Returns 0 if CID received. Returns 1 if event received, and -1 if error. name and num are size ANALOG_MAX_CID */
int (* const get_callerid)(void *pvt, char *name, char *num, enum analog_event *ev, size_t timeout);
/* Start CID detection */
@@ -298,7 +298,7 @@
char callwait_name[AST_MAX_EXTENSION];
char lastcid_num[AST_MAX_EXTENSION];
char lastcid_name[AST_MAX_EXTENSION];
- struct ast_callerid cid;
+ struct ast_party_caller caller;
int cidrings; /*!< Which ring to deliver CID on */
char echorest[20];
int polarity;
Modified: team/rmudgett/cid/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/include/asterisk/channel.h?view=diff&rev=263725&r1=263724&r2=263725
==============================================================================
--- team/rmudgett/cid/include/asterisk/channel.h (original)
+++ team/rmudgett/cid/include/asterisk/channel.h Mon May 17 18:58:38 2010
@@ -2584,7 +2584,7 @@
*
* \return Nothing
*/
-void ast_party_caller_copy(struct ast_callerid *dest, const struct ast_callerid *src);
+void ast_party_caller_copy(struct ast_party_caller *dest, const struct ast_party_caller *src);
/*!
* \since 1.8
@@ -2645,7 +2645,7 @@
* \brief Collect the caller party information into a connected line structure.
*
* \param connected Collected caller information for the connected line
- * \param cid Caller information.
+ * \param caller Caller information.
*
* \return Nothing
*
@@ -2653,7 +2653,7 @@
* \warning DO NOT call ast_party_connected_line_free() on the filled in
* connected line structure!
*/
-void ast_party_connected_line_collect_caller(struct ast_party_connected_line *connected, struct ast_callerid *cid);
+void ast_party_connected_line_collect_caller(struct ast_party_connected_line *connected, struct ast_party_caller *caller);
/*!
* \since 1.8
@@ -2716,7 +2716,7 @@
*
* \note Assumes locks are already acquired
*/
-void ast_connected_line_copy_from_caller(struct ast_party_connected_line *dest, const struct ast_callerid *src);
+void ast_connected_line_copy_from_caller(struct ast_party_connected_line *dest, const struct ast_party_caller *src);
/*!
* \since 1.8
@@ -2729,7 +2729,7 @@
*
* \note Assumes locks are already acquired
*/
-void ast_connected_line_copy_to_caller(struct ast_callerid *dest, const struct ast_party_connected_line *src);
+void ast_connected_line_copy_to_caller(struct ast_party_caller *dest, const struct ast_party_connected_line *src);
/*!
* \since 1.8
Modified: team/rmudgett/cid/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/main/channel.c?view=diff&rev=263725&r1=263724&r2=263725
==============================================================================
--- team/rmudgett/cid/main/channel.c (original)
+++ team/rmudgett/cid/main/channel.c Mon May 17 18:58:38 2010
@@ -1525,18 +1525,6 @@
return ast_safe_sleep_conditional(chan, ms, NULL, NULL);
}
-static void free_cid(struct ast_callerid *cid)
-{
- ast_free(cid->cid_num);
- ast_free(cid->cid_name);
- ast_free(cid->cid_ani);
- ast_free(cid->cid_tag);
- cid->cid_num = NULL;
- cid->cid_name = NULL;
- cid->cid_ani = NULL;
- ast_party_subaddress_free(&cid->subaddress);
-}
-
struct ast_channel *ast_channel_release(struct ast_channel *chan)
{
/* Safe, even if already unlinked. */
@@ -2077,47 +2065,19 @@
init->ani2 = 0;
}
-void ast_party_caller_copy(struct ast_callerid *dest, const struct ast_callerid *src)
+void ast_party_caller_copy(struct ast_party_caller *dest, const struct ast_party_caller *src)
{
if (dest == src) {
/* Don't copy to self */
return;
}
-#if 1
- /* Copy caller-id specific information ONLY from struct ast_callerid */
- ast_free(dest->cid_num);
- dest->cid_num = ast_strdup(src->cid_num);
-
- ast_free(dest->cid_name);
- dest->cid_name = ast_strdup(src->cid_name);
-
- ast_free(dest->cid_tag);
- dest->cid_tag = ast_strdup(src->cid_tag);
-
- dest->cid_ton = src->cid_ton;
- dest->cid_pres = src->cid_pres;
-
-
- ast_free(dest->cid_ani);
- dest->cid_ani = ast_strdup(src->cid_ani);
-
- dest->cid_ani2 = src->cid_ani2;
-
- ast_party_subaddress_copy(&dest->subaddress, &src->subaddress);
-
-#else
-
- /* The src and dest parameter types will become struct ast_party_caller ptrs. */
- /* This is future code */
-
ast_party_id_copy(&dest->id, &src->id);
ast_free(dest->ani);
dest->ani = ast_strdup(src->ani);
dest->ani2 = src->ani2;
-#endif
}
/*!
@@ -2182,17 +2142,11 @@
dest->source = src->source;
}
-void ast_party_connected_line_collect_caller(struct ast_party_connected_line *connected, struct ast_callerid *cid)
-{
- connected->id.number = cid->cid_num;
- connected->id.name = cid->cid_name;
- connected->id.number_type = cid->cid_ton;
- connected->id.number_presentation = cid->cid_pres;
- connected->id.tag = cid->cid_tag;
- connected->id.subaddress = cid->subaddress;
-
- connected->ani = cid->cid_ani;
- connected->ani2 = cid->cid_ani2;
+void ast_party_connected_line_collect_caller(struct ast_party_connected_line *connected, struct ast_party_caller *caller)
+{
+ connected->id = caller->id;
+ connected->ani = caller->ani;
+ connected->ani2 = caller->ani2;
connected->source = AST_CONNECTED_LINE_UPDATE_SOURCE_UNKNOWN;
}
@@ -2308,7 +2262,6 @@
if (chan->pbx)
ast_log(LOG_WARNING, "PBX may not have been terminated properly on '%s'\n", chan->name);
- free_cid(&chan->cid);
ast_party_dialed_free(&chan->dialed);
ast_party_caller_free(&chan->caller);
ast_party_connected_line_free(&chan->connected);
@@ -2369,7 +2322,10 @@
headp = &chan->varshead;
- free_cid(&chan->cid);
+ ast_party_dialed_free(&chan->dialed);
+ ast_party_caller_free(&chan->caller);
+ ast_party_connected_line_free(&chan->connected);
+ ast_party_redirecting_free(&chan->redirecting);
/* loop over the variables list, freeing all data and deleting list items */
/* no need to lock the list, as the channel is already locked */
@@ -4838,7 +4794,7 @@
}
ast_copy_flags(new->cdr, orig->cdr, AST_CDR_FLAG_ORIGINATED);
ast_string_field_set(new, accountcode, orig->accountcode);
- ast_party_caller_copy(&new->cid, &orig->cid);
+ ast_party_caller_copy(&new->caller, &orig->caller);
ast_party_connected_line_copy(&new->connected, &orig->connected);
ast_channel_unlock(new);
ast_channel_unlock(orig);
@@ -5608,18 +5564,18 @@
static void report_new_callerid(struct ast_channel *chan)
{
ast_manager_event(chan, EVENT_FLAG_CALL, "NewCallerid",
- "Channel: %s\r\n"
- "CallerIDNum: %s\r\n"
- "CallerIDName: %s\r\n"
- "Uniqueid: %s\r\n"
- "CID-CallingPres: %d (%s)\r\n",
- chan->name,
- S_OR(chan->cid.cid_num, ""),
- S_OR(chan->cid.cid_name, ""),
- chan->uniqueid,
- chan->cid.cid_pres,
- ast_describe_caller_presentation(chan->cid.cid_pres)
- );
+ "Channel: %s\r\n"
+ "CallerIDNum: %s\r\n"
+ "CallerIDName: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "CID-CallingPres: %d (%s)\r\n",
+ chan->name,
+ S_OR(chan->cid.cid_num, ""),
+ S_OR(chan->cid.cid_name, ""),
+ chan->uniqueid,
+ chan->cid.cid_pres,
+ ast_describe_caller_presentation(chan->cid.cid_pres)
+ );
}
/*!
@@ -5639,7 +5595,8 @@
const struct ast_channel_tech *t;
void *t_pvt;
union {
- struct ast_callerid cid;
+ struct ast_party_dialed dialed;
+ struct ast_party_caller caller;
struct ast_party_connected_line connected;
struct ast_party_redirecting redirecting;
} exchange;
@@ -5866,17 +5823,23 @@
* Just swap the whole structures, nevermind the allocations,
* they'll work themselves out.
*/
- exchange.cid = original->cid;
- original->cid = clonechan->cid;
- clonechan->cid = exchange.cid;
- report_new_callerid(original);
+ exchange.dialed = original->dialed;
+ original->dialed = clonechan->dialed;
+ clonechan->dialed = exchange.dialed;
+
+ exchange.caller = original->caller;
+ original->caller = clonechan->caller;
+ clonechan->caller = exchange.caller;
exchange.connected = original->connected;
original->connected = clonechan->connected;
clonechan->connected = exchange.connected;
+
exchange.redirecting = original->redirecting;
original->redirecting = clonechan->redirecting;
clonechan->redirecting = exchange.redirecting;
+
+ report_new_callerid(original);
/* Restore original timing file descriptor */
ast_channel_set_fd(original, AST_TIMING_FD, original->timingfd);
@@ -7169,78 +7132,24 @@
return ast_say_digit_str_full(chan, buf, ints, lang, audiofd, ctrlfd);
}
-void ast_connected_line_copy_from_caller(struct ast_party_connected_line *dest, const struct ast_callerid *src)
-{
-#if 1
- /* Must manually fill in struct ast_party_id until struct ast_callerid goes away */
- ast_free(dest->id.number);
- dest->id.number = ast_strdup(src->cid_num);
-
- ast_free(dest->id.name);
- dest->id.name = ast_strdup(src->cid_name);
-
- ast_free(dest->id.tag);
- dest->id.tag = ast_strdup(src->cid_tag);
-
- dest->id.number_type = src->cid_ton;
- dest->id.number_presentation = src->cid_pres;
-
-
- ast_free(dest->ani);
- dest->ani = ast_strdup(src->cid_ani);
-
- dest->ani2 = src->cid_ani2;
- ast_party_subaddress_copy(&dest->id.subaddress, &src->subaddress);
-
-#else
-
- /* The src parameter type will become a struct ast_party_caller ptr. */
- /* This is future code */
-
+void ast_connected_line_copy_from_caller(struct ast_party_connected_line *dest, const struct ast_party_caller *src)
+{
ast_party_id_copy(&dest->id, &src->id);
ast_free(dest->ani);
dest->ani = ast_strdup(src->ani);
dest->ani2 = src->ani2;
-#endif
-}
-
-void ast_connected_line_copy_to_caller(struct ast_callerid *dest, const struct ast_party_connected_line *src)
-{
-#if 1
- /* Must manually extract from struct ast_party_id until struct ast_callerid goes away */
- ast_free(dest->cid_num);
- dest->cid_num = ast_strdup(src->id.number);
-
- ast_free(dest->cid_name);
- dest->cid_name = ast_strdup(src->id.name);
-
- ast_free(dest->cid_tag);
- dest->cid_tag = ast_strdup(src->id.tag);
-
- dest->cid_ton = src->id.number_type;
- dest->cid_pres = src->id.number_presentation;
-
-
- ast_free(dest->cid_ani);
- dest->cid_ani = ast_strdup(src->ani);
-
- dest->cid_ani2 = src->ani2;
- ast_party_subaddress_copy(&dest->subaddress, &src->id.subaddress);
-
-#else
-
- /* The dest parameter type will become a struct ast_party_caller ptr. */
- /* This is future code */
-
+}
+
+void ast_connected_line_copy_to_caller(struct ast_party_caller *dest, const struct ast_party_connected_line *src)
+{
ast_party_id_copy(&dest->id, &src->id);
ast_free(dest->ani);
dest->ani = ast_strdup(src->ani);
dest->ani2 = src->ani2;
-#endif
}
void ast_channel_set_connected_line(struct ast_channel *chan, const struct ast_party_connected_line *connected)
Modified: team/rmudgett/cid/main/dial.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/main/dial.c?view=diff&rev=263725&r1=263724&r2=263725
==============================================================================
--- team/rmudgett/cid/main/dial.c (original)
+++ team/rmudgett/cid/main/dial.c Mon May 17 18:58:38 2010
@@ -270,7 +270,7 @@
channel->owner->dialed.transit_network_select = chan->dialed.transit_network_select;
- ast_connected_line_copy_from_caller(&channel->owner->connected, &chan->cid);
+ ast_connected_line_copy_from_caller(&channel->owner->connected, &chan->caller);
ast_string_field_set(channel->owner, language, chan->language);
ast_string_field_set(channel->owner, accountcode, chan->accountcode);
Modified: team/rmudgett/cid/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/main/features.c?view=diff&rev=263725&r1=263724&r2=263725
==============================================================================
--- team/rmudgett/cid/main/features.c (original)
+++ team/rmudgett/cid/main/features.c Mon May 17 18:58:38 2010
@@ -1982,7 +1982,7 @@
ast_channel_update_connected_line(xferchan, &connected_line);
}
ast_channel_lock(xferchan);
- ast_connected_line_copy_from_caller(&connected_line, &xferchan->cid);
+ ast_connected_line_copy_from_caller(&connected_line, &xferchan->caller);
ast_channel_unlock(xferchan);
connected_line.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
if (ast_channel_connected_line_macro(xferchan, newchan, &connected_line, 0, 0)) {
@@ -2094,14 +2094,14 @@
}
ast_channel_lock(newchan);
- ast_connected_line_copy_from_caller(&connected_line, &newchan->cid);
+ ast_connected_line_copy_from_caller(&connected_line, &newchan->caller);
ast_channel_unlock(newchan);
connected_line.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
if (ast_channel_connected_line_macro(newchan, xferchan, &connected_line, 1, 0)) {
ast_channel_update_connected_line(xferchan, &connected_line);
}
ast_channel_lock(xferchan);
- ast_connected_line_copy_from_caller(&connected_line, &xferchan->cid);
+ ast_connected_line_copy_from_caller(&connected_line, &xferchan->caller);
ast_channel_unlock(xferchan);
connected_line.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
if (ast_channel_connected_line_macro(xferchan, newchan, &connected_line, 0, 0)) {
@@ -2646,7 +2646,7 @@
pbx_builtin_setvar_helper(chan, "TRANSFERERNAME", caller->name);
ast_channel_lock(chan);
- ast_connected_line_copy_from_caller(&chan->connected, &caller->cid);
+ ast_connected_line_copy_from_caller(&chan->connected, &caller->caller);
ast_channel_unlock(chan);
if (ast_call(chan, data, timeout)) {
@@ -5091,7 +5091,7 @@
ast_channel_update_connected_line(chan, &connected_caller);
}
- ast_party_connected_line_collect_caller(&connected_caller, &chan->cid);
+ ast_party_connected_line_collect_caller(&connected_caller, &chan->caller);
connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
ast_channel_queue_connected_line_update(chan, &connected_caller);
More information about the asterisk-commits
mailing list