[asterisk-commits] rmudgett: branch rmudgett/cid r263723 - in /team/rmudgett/cid: apps/ channels...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon May 17 17:46:30 CDT 2010
Author: rmudgett
Date: Mon May 17 17:46:22 2010
New Revision: 263723
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=263723
Log:
Move ast_channel.cid.cid_dnis to ast_channel.dialed.number.str.
Made use the ast_channel.dialed.number.valid flag.
Modified:
team/rmudgett/cid/apps/app_dial.c
team/rmudgett/cid/apps/app_dumpchan.c
team/rmudgett/cid/apps/app_queue.c
team/rmudgett/cid/channels/chan_dahdi.c
team/rmudgett/cid/channels/chan_gtalk.c
team/rmudgett/cid/channels/chan_h323.c
team/rmudgett/cid/channels/chan_iax2.c
team/rmudgett/cid/channels/chan_jingle.c
team/rmudgett/cid/channels/chan_mgcp.c
team/rmudgett/cid/channels/chan_misdn.c
team/rmudgett/cid/channels/chan_oss.c
team/rmudgett/cid/channels/chan_sip.c
team/rmudgett/cid/channels/chan_usbradio.c
team/rmudgett/cid/channels/sig_pri.c
team/rmudgett/cid/funcs/func_callerid.c
team/rmudgett/cid/include/asterisk/channel.h
team/rmudgett/cid/main/cdr.c
team/rmudgett/cid/main/cel.c
team/rmudgett/cid/main/channel.c
team/rmudgett/cid/main/cli.c
team/rmudgett/cid/res/res_agi.c
team/rmudgett/cid/res/snmp/agent.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=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/apps/app_dial.c (original)
+++ team/rmudgett/cid/apps/app_dial.c Mon May 17 17:46:22 2010
@@ -2029,8 +2029,9 @@
if (ast_strlen_zero(tc->cid.cid_num)) {
if (!ast_strlen_zero(chan->connected.id.number)) {
ast_set_callerid(tc, chan->connected.id.number, chan->connected.id.name, chan->connected.ani);
- } else if (!ast_strlen_zero(chan->cid.cid_dnid)) {
- ast_set_callerid(tc, chan->cid.cid_dnid, NULL, NULL);
+ } else if (chan->dialed.number.valid
+ && !ast_strlen_zero(chan->dialed.number.str)) {
+ ast_set_callerid(tc, chan->dialed.number.str, NULL, NULL);
} else if (!ast_strlen_zero(S_OR(chan->macroexten, chan->exten))) {
ast_set_callerid(tc, S_OR(chan->macroexten, chan->exten), NULL, NULL);
}
Modified: team/rmudgett/cid/apps/app_dumpchan.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/apps/app_dumpchan.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/apps/app_dumpchan.c (original)
+++ team/rmudgett/cid/apps/app_dumpchan.c Mon May 17 17:46:22 2010
@@ -118,7 +118,7 @@
c->uniqueid,
S_OR(c->cid.cid_num, "(N/A)"),
S_OR(c->cid.cid_name, "(N/A)"),
- S_OR(c->cid.cid_dnid, "(N/A)"),
+ S_COR(c->dialed.number.valid, c->dialed.number.str, "(N/A)"),
S_OR(c->redirecting.from.number, "(N/A)"),
c->parkinglot,
c->language,
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=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/apps/app_queue.c (original)
+++ team/rmudgett/cid/apps/app_queue.c Mon May 17 17:46:22 2010
@@ -2865,8 +2865,9 @@
if (!ast_strlen_zero(qe->chan->connected.id.number)) {
ast_set_callerid(tmp->chan, qe->chan->connected.id.number, qe->chan->connected.id.name, qe->chan->connected.ani);
tmp->chan->cid.cid_pres = qe->chan->connected.id.number_presentation;
- } else if (!ast_strlen_zero(qe->chan->cid.cid_dnid)) {
- ast_set_callerid(tmp->chan, qe->chan->cid.cid_dnid, NULL, NULL);
+ } else if (qe->chan->dialed.number.valid
+ && !ast_strlen_zero(qe->chan->dialed.number.str)) {
+ ast_set_callerid(tmp->chan, qe->chan->dialed.number.str, NULL, NULL);
} else if (!ast_strlen_zero(S_OR(qe->chan->macroexten, qe->chan->exten))) {
ast_set_callerid(tmp->chan, S_OR(qe->chan->macroexten, qe->chan->exten), NULL, NULL);
}
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=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/channels/chan_dahdi.c (original)
+++ team/rmudgett/cid/channels/chan_dahdi.c Mon May 17 17:46:22 2010
@@ -9014,8 +9014,10 @@
ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
if (!ast_strlen_zero(i->rdnis))
tmp->redirecting.from.number = ast_strdup(i->rdnis);
- if (!ast_strlen_zero(i->dnid))
- tmp->cid.cid_dnid = ast_strdup(i->dnid);
+ if (!ast_strlen_zero(i->dnid)) {
+ tmp->dialed.number.valid = 1;
+ tmp->dialed.number.str = ast_strdup(i->dnid);
+ }
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
Modified: team/rmudgett/cid/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_gtalk.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/channels/chan_gtalk.c (original)
+++ team/rmudgett/cid/channels/chan_gtalk.c Mon May 17 17:46:22 2010
@@ -1060,8 +1060,10 @@
ast_copy_string(tmp->context, client->context, sizeof(tmp->context));
ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
- if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))
- tmp->cid.cid_dnid = ast_strdup(i->exten);
+ if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s")) {
+ tmp->dialed.number.valid = 1;
+ tmp->dialed.number.str = ast_strdup(i->exten);
+ }
tmp->priority = 1;
if (i->rtp)
ast_jb_configure(tmp, &global_jbconf);
Modified: team/rmudgett/cid/channels/chan_h323.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_h323.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/channels/chan_h323.c (original)
+++ team/rmudgett/cid/channels/chan_h323.c Mon May 17 17:46:22 2010
@@ -1085,7 +1085,8 @@
ch->cid.cid_ton = pvt->cd.type_of_number;
if (!ast_strlen_zero(pvt->exten) && strcmp(pvt->exten, "s")) {
- ch->cid.cid_dnid = ast_strdup(pvt->exten);
+ ch->dialed.number.valid = 1;
+ ch->dialed.number.str = ast_strdup(pvt->exten);
}
if (pvt->cd.transfer_capability >= 0)
ch->transfercapability = pvt->cd.transfer_capability;
Modified: team/rmudgett/cid/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_iax2.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/channels/chan_iax2.c (original)
+++ team/rmudgett/cid/channels/chan_iax2.c Mon May 17 17:46:22 2010
@@ -4950,8 +4950,9 @@
if (!ast_strlen_zero(c->language))
iax_ie_append_str(&ied, IAX_IE_LANGUAGE, c->language);
- if (!ast_strlen_zero(c->cid.cid_dnid))
- iax_ie_append_str(&ied, IAX_IE_DNID, c->cid.cid_dnid);
+ if (c->dialed.number.valid && !ast_strlen_zero(c->dialed.number.str)) {
+ iax_ie_append_str(&ied, IAX_IE_DNID, c->dialed.number.str);
+ }
if (!ast_strlen_zero(c->redirecting.from.number))
iax_ie_append_str(&ied, IAX_IE_RDNIS, c->redirecting.from.number);
@@ -5548,7 +5549,8 @@
tmp->cid.cid_ani = ast_strdup(i->ani);
else
tmp->cid.cid_ani = ast_strdup(i->cid_num);
- tmp->cid.cid_dnid = ast_strdup(i->dnid);
+ tmp->dialed.number.valid = 1;
+ tmp->dialed.number.str = ast_strdup(i->dnid);
tmp->redirecting.from.number = ast_strdup(i->rdnis);
tmp->cid.cid_pres = i->calling_pres;
tmp->cid.cid_ton = i->calling_ton;
Modified: team/rmudgett/cid/channels/chan_jingle.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_jingle.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/channels/chan_jingle.c (original)
+++ team/rmudgett/cid/channels/chan_jingle.c Mon May 17 17:46:22 2010
@@ -860,8 +860,10 @@
/* Don't use ast_set_callerid() here because it will
* generate an unnecessary NewCallerID event */
tmp->cid.cid_ani = ast_strdup(i->cid_num);
- if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))
- tmp->cid.cid_dnid = ast_strdup(i->exten);
+ if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s")) {
+ tmp->dialed.number.valid = 1;
+ tmp->dialed.number.str = ast_strdup(i->exten);
+ }
tmp->priority = 1;
if (i->rtp)
ast_jb_configure(tmp, &global_jbconf);
Modified: team/rmudgett/cid/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_mgcp.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/channels/chan_mgcp.c (original)
+++ team/rmudgett/cid/channels/chan_mgcp.c Mon May 17 17:46:22 2010
@@ -2959,7 +2959,8 @@
/*res = tone_zone_play_tone(p->subs[index].zfd, -1);*/
ast_indicate(chan, -1);
ast_copy_string(chan->exten, p->dtmf_buf, sizeof(chan->exten));
- chan->cid.cid_dnid = ast_strdup(p->dtmf_buf);
+ chan->dialed.number.valid = 1;
+ chan->dialed.number.str = ast_strdup(p->dtmf_buf);
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
ast_set_callerid(chan,
p->hidecallerid ? "" : p->cid_num,
Modified: team/rmudgett/cid/channels/chan_misdn.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_misdn.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/channels/chan_misdn.c (original)
+++ team/rmudgett/cid/channels/chan_misdn.c Mon May 17 17:46:22 2010
@@ -8596,10 +8596,9 @@
return;
}
chan->priority = notify->priority;
- if (chan->cid.cid_dnid) {
- ast_free(chan->cid.cid_dnid);
- }
- chan->cid.cid_dnid = ast_strdup(notify->exten);
+ chan->dialed.number.valid = 1;
+ ast_free(chan->dialed.number.str);
+ chan->dialed.number.str = ast_strdup(notify->exten);
if (ast_pbx_start(chan)) {
ast_log(LOG_WARNING, "Unable to start pbx channel %s!\n", chan->name);
Modified: team/rmudgett/cid/channels/chan_oss.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_oss.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/channels/chan_oss.c (original)
+++ team/rmudgett/cid/channels/chan_oss.c Mon May 17 17:46:22 2010
@@ -602,7 +602,11 @@
AST_NONSTANDARD_APP_ARGS(args, parse, '/');
ast_verbose(" << Call to device '%s' dnid '%s' rdnis '%s' on console from '%s' <%s> >>\n",
- dest, c->cid.cid_dnid, c->redirecting.from.number, c->cid.cid_name, c->cid.cid_num);
+ dest,
+ S_COR(c->dialed.number.valid, c->dialed.number.str, ""),
+ c->redirecting.from.number,
+ c->cid.cid_name,
+ c->cid.cid_num);
if (!ast_strlen_zero(args.flags) && strcasecmp(args.flags, "answer") == 0) {
f.subclass.integer = AST_CONTROL_ANSWER;
ast_queue_frame(c, &f);
@@ -804,8 +808,10 @@
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
c->cid.cid_ani = ast_strdup(o->cid_num);
- if (!ast_strlen_zero(ext))
- c->cid.cid_dnid = ast_strdup(ext);
+ if (!ast_strlen_zero(ext)) {
+ c->dialed.number.valid = 1;
+ c->dialed.number.str = ast_strdup(ext);
+ }
o->owner = c;
ast_module_ref(ast_module_info->self);
Modified: team/rmudgett/cid/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_sip.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/channels/chan_sip.c (original)
+++ team/rmudgett/cid/channels/chan_sip.c Mon May 17 17:46:22 2010
@@ -6408,9 +6408,11 @@
tmp->cid.cid_ani = ast_strdup(i->cid_num);
if (!ast_strlen_zero(i->rdnis))
tmp->redirecting.from.number = ast_strdup(i->rdnis);
-
- if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))
- tmp->cid.cid_dnid = ast_strdup(i->exten);
+
+ if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s")) {
+ tmp->dialed.number.valid = 1;
+ tmp->dialed.number.str = ast_strdup(i->exten);
+ }
tmp->priority = 1;
if (!ast_strlen_zero(i->uri))
Modified: team/rmudgett/cid/channels/chan_usbradio.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_usbradio.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/channels/chan_usbradio.c (original)
+++ team/rmudgett/cid/channels/chan_usbradio.c Mon May 17 17:46:22 2010
@@ -2205,8 +2205,10 @@
c->cid.cid_num = ast_strdup(o->cid_num);
c->cid.cid_ani = ast_strdup(o->cid_num);
c->cid.cid_name = ast_strdup(o->cid_name);
- if (!ast_strlen_zero(ext))
- c->cid.cid_dnid = ast_strdup(ext);
+ if (!ast_strlen_zero(ext)) {
+ c->dialed.number.valid = 1;
+ c->dialed.number.str = ast_strdup(ext);
+ }
o->owner = c;
ast_module_ref(ast_module_info->self);
Modified: team/rmudgett/cid/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/sig_pri.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/channels/sig_pri.c (original)
+++ team/rmudgett/cid/channels/sig_pri.c Mon May 17 17:46:22 2010
@@ -1410,10 +1410,9 @@
exten[0] = 's';
exten[1] = '\0';
} else {
- if (chan->cid.cid_dnid) {
- ast_free(chan->cid.cid_dnid);
- }
- chan->cid.cid_dnid = ast_strdup(exten);
+ chan->dialed.number.valid = 1;
+ ast_free(chan->dialed.number.str);
+ chan->dialed.number.str = ast_strdup(exten);
}
sig_pri_play_tone(p, -1);
if (ast_exists_extension(chan, chan->context, exten, 1, p->cid_num)) {
Modified: team/rmudgett/cid/funcs/func_callerid.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/funcs/func_callerid.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/funcs/func_callerid.c (original)
+++ team/rmudgett/cid/funcs/func_callerid.c Mon May 17 17:46:22 2010
@@ -194,8 +194,8 @@
}
}
} else { /* dnid */
- if (chan->cid.cid_dnid) {
- ast_copy_string(buf, chan->cid.cid_dnid, len);
+ if (chan->dialed.number.valid && chan->dialed.number.str) {
+ ast_copy_string(buf, chan->dialed.number.str, len);
}
}
} else if (!strncasecmp("subaddr", data, 7)) {
@@ -292,10 +292,9 @@
chan->dialed.subaddress.str = ast_strdup(value);
}
} else { /* dnid */
- if (chan->cid.cid_dnid) {
- ast_free(chan->cid.cid_dnid);
- }
- chan->cid.cid_dnid = ast_strdup(value);
+ chan->dialed.number.valid = 1;
+ ast_free(chan->dialed.number.str);
+ chan->dialed.number.str = ast_strdup(value);
}
if (chan->cdr) {
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=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/include/asterisk/channel.h (original)
+++ team/rmudgett/cid/include/asterisk/channel.h Mon May 17 17:46:22 2010
@@ -295,12 +295,6 @@
* BUGBUG to be deleted.
*/
struct ast_callerid {
- /*!
- * \brief Malloc'd Dialed Number Identifier
- * (Field will eventually move to struct ast_channel.dialed.number)
- */
- char *cid_dnid;
-
/*!
* \brief Malloc'd Caller Number
* (Field will eventually move to struct ast_channel.caller.id.number)
Modified: team/rmudgett/cid/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/main/cdr.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/main/cdr.c (original)
+++ team/rmudgett/cid/main/cdr.c Mon May 17 17:46:22 2010
@@ -860,7 +860,7 @@
cdr->clid[0] = '\0';
}
ast_copy_string(cdr->src, S_OR(num, ""), sizeof(cdr->src));
- ast_cdr_setvar(cdr, "dnid", S_OR(c->cid.cid_dnid, ""), 0);
+ ast_cdr_setvar(cdr, "dnid", S_COR(c->dialed.number.valid, c->dialed.number.str, ""), 0);
if (c->cid.subaddress.valid) {
ast_cdr_setvar(cdr, "callingsubaddr", S_OR(c->cid.subaddress.str, ""), 0);
Modified: team/rmudgett/cid/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/main/cel.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/main/cel.c (original)
+++ team/rmudgett/cid/main/cel.c Mon May 17 17:46:22 2010
@@ -441,7 +441,8 @@
tchan->cid.cid_num = ast_strdup(record.caller_id_num);
tchan->cid.cid_ani = ast_strdup(record.caller_id_ani);
tchan->redirecting.from.number = ast_strdup(record.caller_id_rdnis);
- tchan->cid.cid_dnid = ast_strdup(record.caller_id_dnid);
+ tchan->dialed.number.valid = 1;
+ tchan->dialed.number.str = ast_strdup(record.caller_id_dnid);
ast_copy_string(tchan->exten, record.extension, sizeof(tchan->exten));
ast_copy_string(tchan->context, record.context, sizeof(tchan->context));
@@ -526,29 +527,34 @@
ast_channel_lock(chan);
ev = ast_event_new(AST_EVENT_CEL,
- AST_EVENT_IE_CEL_EVENT_TYPE, AST_EVENT_IE_PLTYPE_UINT, event_type,
- AST_EVENT_IE_CEL_EVENT_TIME, AST_EVENT_IE_PLTYPE_UINT, eventtime.tv_sec,
- AST_EVENT_IE_CEL_EVENT_TIME_USEC, AST_EVENT_IE_PLTYPE_UINT, eventtime.tv_usec,
- AST_EVENT_IE_CEL_USEREVENT_NAME, AST_EVENT_IE_PLTYPE_STR, userdefevname,
- AST_EVENT_IE_CEL_CIDNAME, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->cid.cid_name, ""),
- AST_EVENT_IE_CEL_CIDNUM, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->cid.cid_num, ""),
- AST_EVENT_IE_CEL_CIDANI, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->cid.cid_ani, ""),
- AST_EVENT_IE_CEL_CIDRDNIS, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->redirecting.from.number, ""),
- AST_EVENT_IE_CEL_CIDDNID, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->cid.cid_dnid, ""),
- AST_EVENT_IE_CEL_EXTEN, AST_EVENT_IE_PLTYPE_STR, chan->exten,
- AST_EVENT_IE_CEL_CONTEXT, AST_EVENT_IE_PLTYPE_STR, chan->context,
- AST_EVENT_IE_CEL_CHANNAME, AST_EVENT_IE_PLTYPE_STR, chan->name,
- AST_EVENT_IE_CEL_APPNAME, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->appl, ""),
- AST_EVENT_IE_CEL_APPDATA, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->data, ""),
- AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_PLTYPE_UINT, chan->amaflags,
- AST_EVENT_IE_CEL_ACCTCODE, AST_EVENT_IE_PLTYPE_STR, chan->accountcode,
- AST_EVENT_IE_CEL_PEERACCT, AST_EVENT_IE_PLTYPE_STR, chan->peeraccount,
- AST_EVENT_IE_CEL_UNIQUEID, AST_EVENT_IE_PLTYPE_STR, chan->uniqueid,
- AST_EVENT_IE_CEL_LINKEDID, AST_EVENT_IE_PLTYPE_STR, chan->linkedid,
- AST_EVENT_IE_CEL_USERFIELD, AST_EVENT_IE_PLTYPE_STR, chan->userfield,
- AST_EVENT_IE_CEL_EXTRA, AST_EVENT_IE_PLTYPE_STR, extra,
- AST_EVENT_IE_CEL_PEER, AST_EVENT_IE_PLTYPE_STR, peername,
- AST_EVENT_IE_END);
+ AST_EVENT_IE_CEL_EVENT_TYPE, AST_EVENT_IE_PLTYPE_UINT, event_type,
+ AST_EVENT_IE_CEL_EVENT_TIME, AST_EVENT_IE_PLTYPE_UINT, eventtime.tv_sec,
+ AST_EVENT_IE_CEL_EVENT_TIME_USEC, AST_EVENT_IE_PLTYPE_UINT, eventtime.tv_usec,
+ AST_EVENT_IE_CEL_USEREVENT_NAME, AST_EVENT_IE_PLTYPE_STR, userdefevname,
+ AST_EVENT_IE_CEL_CIDNAME, AST_EVENT_IE_PLTYPE_STR,
+ S_OR(chan->cid.cid_name, ""),
+ AST_EVENT_IE_CEL_CIDNUM, AST_EVENT_IE_PLTYPE_STR,
+ S_OR(chan->cid.cid_num, ""),
+ AST_EVENT_IE_CEL_CIDANI, AST_EVENT_IE_PLTYPE_STR,
+ S_OR(chan->cid.cid_ani, ""),
+ AST_EVENT_IE_CEL_CIDRDNIS, AST_EVENT_IE_PLTYPE_STR,
+ S_OR(chan->redirecting.from.number, ""),
+ AST_EVENT_IE_CEL_CIDDNID, AST_EVENT_IE_PLTYPE_STR,
+ S_COR(chan->dialed.number.valid, chan->dialed.number.str, ""),
+ AST_EVENT_IE_CEL_EXTEN, AST_EVENT_IE_PLTYPE_STR, chan->exten,
+ AST_EVENT_IE_CEL_CONTEXT, AST_EVENT_IE_PLTYPE_STR, chan->context,
+ AST_EVENT_IE_CEL_CHANNAME, AST_EVENT_IE_PLTYPE_STR, chan->name,
+ AST_EVENT_IE_CEL_APPNAME, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->appl, ""),
+ AST_EVENT_IE_CEL_APPDATA, AST_EVENT_IE_PLTYPE_STR, S_OR(chan->data, ""),
+ AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_PLTYPE_UINT, chan->amaflags,
+ AST_EVENT_IE_CEL_ACCTCODE, AST_EVENT_IE_PLTYPE_STR, chan->accountcode,
+ AST_EVENT_IE_CEL_PEERACCT, AST_EVENT_IE_PLTYPE_STR, chan->peeraccount,
+ AST_EVENT_IE_CEL_UNIQUEID, AST_EVENT_IE_PLTYPE_STR, chan->uniqueid,
+ AST_EVENT_IE_CEL_LINKEDID, AST_EVENT_IE_PLTYPE_STR, chan->linkedid,
+ AST_EVENT_IE_CEL_USERFIELD, AST_EVENT_IE_PLTYPE_STR, chan->userfield,
+ AST_EVENT_IE_CEL_EXTRA, AST_EVENT_IE_PLTYPE_STR, extra,
+ AST_EVENT_IE_CEL_PEER, AST_EVENT_IE_PLTYPE_STR, peername,
+ AST_EVENT_IE_END);
ast_channel_unlock(chan);
Modified: team/rmudgett/cid/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/main/channel.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/main/channel.c (original)
+++ team/rmudgett/cid/main/channel.c Mon May 17 17:46:22 2010
@@ -1527,12 +1527,13 @@
static void free_cid(struct ast_callerid *cid)
{
- ast_free(cid->cid_dnid);
ast_free(cid->cid_num);
ast_free(cid->cid_name);
ast_free(cid->cid_ani);
ast_free(cid->cid_tag);
- cid->cid_dnid = cid->cid_num = cid->cid_name = cid->cid_ani = NULL;
+ cid->cid_num = NULL;
+ cid->cid_name = NULL;
+ cid->cid_ani = NULL;
ast_party_subaddress_free(&cid->subaddress);
}
Modified: team/rmudgett/cid/main/cli.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/main/cli.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/main/cli.c (original)
+++ team/rmudgett/cid/main/cli.c Mon May 17 17:46:22 2010
@@ -1405,7 +1405,7 @@
c->name, c->tech->type, c->uniqueid, c->linkedid,
S_OR(c->cid.cid_num, "(N/A)"),
S_OR(c->cid.cid_name, "(N/A)"),
- S_OR(c->cid.cid_dnid, "(N/A)"),
+ S_COR(c->dialed.number.valid, c->dialed.number.str, "(N/A)"),
c->language,
ast_state2str(c->_state), c->_state, c->rings,
ast_getformatname_multiple(nf, sizeof(nf), c->nativeformats),
Modified: team/rmudgett/cid/res/res_agi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/res/res_agi.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/res/res_agi.c (original)
+++ team/rmudgett/cid/res/res_agi.c Mon May 17 17:46:22 2010
@@ -1626,14 +1626,18 @@
ast_agi_send(fd, chan, "agi_version: %s\n", ast_get_version());
/* ANI/DNIS */
- ast_agi_send(fd, chan, "agi_callerid: %s\n", S_OR(chan->cid.cid_num, "unknown"));
- ast_agi_send(fd, chan, "agi_calleridname: %s\n", S_OR(chan->cid.cid_name, "unknown"));
+ ast_agi_send(fd, chan, "agi_callerid: %s\n",
+ S_OR(chan->cid.cid_num, "unknown"));
+ ast_agi_send(fd, chan, "agi_calleridname: %s\n",
+ S_OR(chan->cid.cid_name, "unknown"));
ast_agi_send(fd, chan, "agi_callingpres: %d\n", chan->cid.cid_pres);
ast_agi_send(fd, chan, "agi_callingani2: %d\n", chan->cid.cid_ani2);
ast_agi_send(fd, chan, "agi_callington: %d\n", chan->cid.cid_ton);
ast_agi_send(fd, chan, "agi_callingtns: %d\n", chan->dialed.transit_network_select);
- ast_agi_send(fd, chan, "agi_dnid: %s\n", S_OR(chan->cid.cid_dnid, "unknown"));
- ast_agi_send(fd, chan, "agi_rdnis: %s\n", S_OR(chan->redirecting.from.number, "unknown"));
+ ast_agi_send(fd, chan, "agi_dnid: %s\n",
+ S_COR(chan->dialed.number.valid, chan->dialed.number.str, "unknown"));
+ ast_agi_send(fd, chan, "agi_rdnis: %s\n",
+ S_OR(chan->redirecting.from.number, "unknown"));
/* Context information */
ast_agi_send(fd, chan, "agi_context: %s\n", chan->context);
Modified: team/rmudgett/cid/res/snmp/agent.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/res/snmp/agent.c?view=diff&rev=263723&r1=263722&r2=263723
==============================================================================
--- team/rmudgett/cid/res/snmp/agent.c (original)
+++ team/rmudgett/cid/res/snmp/agent.c Mon May 17 17:46:22 2010
@@ -419,8 +419,8 @@
ret = (u_char *)&long_ret;
break;
case ASTCHANCIDDNID:
- if (chan->cid.cid_dnid) {
- strncpy(string_ret, chan->cid.cid_dnid, sizeof(string_ret));
+ if (chan->dialed.number.valid && chan->dialed.number.str) {
+ strncpy(string_ret, chan->dialed.number.str, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
More information about the asterisk-commits
mailing list