[Asterisk-cvs] asterisk/res res_agi.c, 1.10, 1.11 res_features.c,
1.16, 1.17
markster at lists.digium.com
markster at lists.digium.com
Fri Oct 1 20:56:26 CDT 2004
- Previous message: [Asterisk-cvs] asterisk/apps Makefile, 1.77,
1.78 app_alarmreceiver.c, 1.4, 1.5 app_chanisavail.c, 1.8,
1.9 app_db.c, 1.6, 1.7 app_dial.c, 1.94, 1.95 app_directory.c,
1.27, 1.28 app_disa.c, 1.17, 1.18 app_enumlookup.c, 1.10,
1.11 app_groupcount.c, 1.5, 1.6 app_hasnewvoicemail.c, 1.7,
1.8 app_image.c, 1.3, 1.4 app_lookupblacklist.c, 1.5,
1.6 app_lookupcidname.c, 1.3, 1.4 app_macro.c, 1.15,
1.16 app_meetme.c, 1.60, 1.61 app_osplookup.c, 1.2,
1.3 app_parkandannounce.c, 1.8, 1.9 app_privacy.c, 1.6,
1.7 app_queue.c, 1.87, 1.88 app_sendtext.c, 1.2,
1.3 app_setcallerid.c, 1.4, 1.5 app_setcidname.c, 1.4,
1.5 app_setcidnum.c, 1.4, 1.5 app_sms.c, 1.10,
1.11 app_system.c, 1.11, 1.12 app_talkdetect.c, 1.4,
1.5 app_transfer.c, 1.4, 1.5 app_txtcidname.c, 1.7,
1.8 app_url.c, 1.5, 1.6 app_voicemail.c, 1.151,
1.152 app_zapateller.c, 1.5, 1.6
- Next message: [Asterisk-cvs] asterisk/channels chan_agent.c, 1.81,
1.82 chan_iax2.c, 1.189, 1.190 chan_local.c, 1.32,
1.33 chan_mgcp.c, 1.79, 1.80 chan_modem.c, 1.27,
1.28 chan_modem_bestdata.c, 1.12, 1.13 chan_modem_i4l.c, 1.17,
1.18 chan_oss.c, 1.33, 1.34 chan_phone.c, 1.33,
1.34 chan_sip.c, 1.511, 1.512 chan_skinny.c, 1.54,
1.55 chan_zap.c, 1.346, 1.347
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/cvsroot/asterisk/res
In directory mongoose.digium.com:/tmp/cvs-serv31663/res
Modified Files:
res_agi.c res_features.c
Log Message:
Huge callerid rework (might break H.323, others)
Index: res_agi.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_agi.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- res_agi.c 29 Sep 2004 03:32:58 -0000 1.10
+++ res_agi.c 2 Oct 2004 00:58:31 -0000 1.11
@@ -23,6 +23,7 @@
#include <asterisk/pbx.h>
#include <asterisk/module.h>
#include <asterisk/astdb.h>
+#include <asterisk/callerid.h>
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
@@ -296,9 +297,10 @@
fdprintf(fd, "agi_uniqueid: %s\n", chan->uniqueid);
/* ANI/DNIS */
- fdprintf(fd, "agi_callerid: %s\n", chan->callerid ? chan->callerid : "unknown");
- fdprintf(fd, "agi_dnid: %s\n", chan->dnid ? chan->dnid : "unknown");
- fdprintf(fd, "agi_rdnis: %s\n", chan->rdnis ? chan->rdnis : "unknown");
+ fdprintf(fd, "agi_callerid: %s\n", chan->cid.cid_num ? chan->cid.cid_num : "unknown");
+ fdprintf(fd, "agi_calleridname: %s\n", chan->cid.cid_name ? chan->cid.cid_name : "unknown");
+ fdprintf(fd, "agi_dnid: %s\n", chan->cid.cid_dnid ? chan->cid.cid_dnid : "unknown");
+ fdprintf(fd, "agi_rdnis: %s\n", chan->cid.cid_rdnis ? chan->cid.cid_rdnis : "unknown");
/* Context information */
fdprintf(fd, "agi_context: %s\n", chan->context);
@@ -837,8 +839,19 @@
static int handle_setcallerid(struct ast_channel *chan, AGI *agi, int argc, char **argv)
{
- if (argv[2])
- ast_set_callerid(chan, argv[2], 0);
+ char tmp[256]="";
+ char *l = NULL, *n = NULL;
+ if (argv[2]) {
+ strncpy(tmp, argv[2], sizeof(tmp) - 1);
+ ast_callerid_parse(tmp, &n, &l);
+ if (l)
+ ast_shrink_phone_number(l);
+ else
+ l = "";
+ if (!n)
+ n = "";
+ ast_set_callerid(chan, l, n, NULL);
+ }
fdprintf(agi->fd, "200 result=1\n");
return RESULT_SUCCESS;
Index: res_features.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_features.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- res_features.c 26 Sep 2004 20:47:01 -0000 1.16
+++ res_features.c 2 Oct 2004 00:58:31 -0000 1.17
@@ -210,9 +210,11 @@
"From: %s\r\n"
"Timeout: %ld\r\n"
"CallerID: %s\r\n"
+ "CallerIDName: %s\r\n\r\n"
,pu->parkingnum, pu->chan->name, peer->name
,(long)pu->start.tv_sec + (long)(pu->parkingtime/1000) - (long)time(NULL)
- ,(pu->chan->callerid ? pu->chan->callerid : "")
+ ,(pu->chan->cid.cid_num ? pu->chan->cid.cid_num : "")
+ ,(pu->chan->cid.cid_name ? pu->chan->cid.cid_name : "")
);
if (peer) {
@@ -450,7 +452,7 @@
break;
*(ptr++) = res;
if (!ast_matchmore_extension(transferer, transferer_real_context
- , newext, 1, transferer->callerid)) {
+ , newext, 1, transferer->cid.cid_num)) {
break;
}
}
@@ -479,7 +481,7 @@
ast_log(LOG_WARNING, "Unable to park call %s\n", transferee->name);
}
/* XXX Maybe we should have another message here instead of invalid extension XXX */
- } else if (ast_exists_extension(transferee, transferer_real_context, newext, 1, transferer->callerid)) {
+ } else if (ast_exists_extension(transferee, transferer_real_context, newext, 1, transferer->cid.cid_num)) {
ast_moh_stop(transferee);
res=ast_autoservice_stop(transferee);
if (!transferee->pbx) {
@@ -842,11 +844,13 @@
"Channel: %s\r\n"
"Timeout: %ld\r\n"
"CallerID: %s\r\n"
+ "CallerIDName: %s\r\n"
"%s"
"\r\n"
,cur->parkingnum, cur->chan->name
,(long)cur->start.tv_sec + (long)(cur->parkingtime/1000) - (long)time(NULL)
- ,(cur->chan->callerid ? cur->chan->callerid : "")
+ ,(cur->chan->cid.cid_num ? cur->chan->cid.cid_num : "")
+ ,(cur->chan->cid.cid_name ? cur->chan->cid.cid_name : "")
,idText);
ast_mutex_unlock(&s->lock);
- Previous message: [Asterisk-cvs] asterisk/apps Makefile, 1.77,
1.78 app_alarmreceiver.c, 1.4, 1.5 app_chanisavail.c, 1.8,
1.9 app_db.c, 1.6, 1.7 app_dial.c, 1.94, 1.95 app_directory.c,
1.27, 1.28 app_disa.c, 1.17, 1.18 app_enumlookup.c, 1.10,
1.11 app_groupcount.c, 1.5, 1.6 app_hasnewvoicemail.c, 1.7,
1.8 app_image.c, 1.3, 1.4 app_lookupblacklist.c, 1.5,
1.6 app_lookupcidname.c, 1.3, 1.4 app_macro.c, 1.15,
1.16 app_meetme.c, 1.60, 1.61 app_osplookup.c, 1.2,
1.3 app_parkandannounce.c, 1.8, 1.9 app_privacy.c, 1.6,
1.7 app_queue.c, 1.87, 1.88 app_sendtext.c, 1.2,
1.3 app_setcallerid.c, 1.4, 1.5 app_setcidname.c, 1.4,
1.5 app_setcidnum.c, 1.4, 1.5 app_sms.c, 1.10,
1.11 app_system.c, 1.11, 1.12 app_talkdetect.c, 1.4,
1.5 app_transfer.c, 1.4, 1.5 app_txtcidname.c, 1.7,
1.8 app_url.c, 1.5, 1.6 app_voicemail.c, 1.151,
1.152 app_zapateller.c, 1.5, 1.6
- Next message: [Asterisk-cvs] asterisk/channels chan_agent.c, 1.81,
1.82 chan_iax2.c, 1.189, 1.190 chan_local.c, 1.32,
1.33 chan_mgcp.c, 1.79, 1.80 chan_modem.c, 1.27,
1.28 chan_modem_bestdata.c, 1.12, 1.13 chan_modem_i4l.c, 1.17,
1.18 chan_oss.c, 1.33, 1.34 chan_phone.c, 1.33,
1.34 chan_sip.c, 1.511, 1.512 chan_skinny.c, 1.54,
1.55 chan_zap.c, 1.346, 1.347
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the svn-commits
mailing list