aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-02 00:58:31 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-02 00:58:31 +0000
commit6868babd229a635c5fd89c7b284025a92e0a3f9d (patch)
tree25a4ee6dff29d18acfdfbbc42485333db7aa5311 /include
parentb201da1a3eb1cae654cdd3fe89ef8f9e55dd0b83 (diff)
Huge callerid rework (might break H.323, others)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3874 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rwxr-xr-xinclude/asterisk/callerid.h13
-rwxr-xr-xinclude/asterisk/channel.h50
-rwxr-xr-xinclude/asterisk/pbx.h4
-rwxr-xr-xinclude/asterisk/vmodem.h6
4 files changed, 44 insertions, 29 deletions
diff --git a/include/asterisk/callerid.h b/include/asterisk/callerid.h
index 19a6eeb9d..4008192c8 100755
--- a/include/asterisk/callerid.h
+++ b/include/asterisk/callerid.h
@@ -3,9 +3,9 @@
*
* CallerID (and other GR30) Generation support
*
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999-2004, Digium, Inc.
*
- * Mark Spencer <markster@linux-support.net>
+ * Mark Spencer <markster@digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License.
@@ -118,16 +118,16 @@ extern void callerid_free(struct callerid_state *cid);
*
* Acts like callerid_generate except uses an asterisk format callerid string.
*/
-extern int ast_callerid_generate(unsigned char *buf, char *astcid, int codec);
+extern int ast_callerid_generate(unsigned char *buf, char *name, char *number, int codec);
//! Generate message waiting indicator
extern int vmwi_generate(unsigned char *buf, int active, int mdmf, int codec);
-//! Generate Caller-ID spill from the "callerid" field of asterisk (in e-mail address like format) but in a format suitable for Call Waiting(tm)'s Caller*ID(tm)
+//! Generate Caller-ID spill but in a format suitable for Call Waiting(tm)'s Caller*ID(tm)
/*!
* See ast_callerid_generate for other details
*/
-extern int ast_callerid_callwaiting_generate(unsigned char *buf, char *astcid, int codec);
+extern int ast_callerid_callwaiting_generate(unsigned char *buf, char *name, char *number, int codec);
//! Destructively parse inbuf into name and location (or number)
/*!
@@ -163,6 +163,9 @@ extern void ast_shrink_phone_number(char *n);
*/
extern int ast_isphonenumber(char *n);
+extern int ast_callerid_split(const char *src, char *name, int namelen, char *num, int numlen);
+
+extern char *ast_callerid_merge(char *buf, int bufsiz, const char *name, const char *num);
/*
* Caller*ID and other GR-30 compatible generation
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 75627cda7..9022e1a51 100755
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -48,6 +48,27 @@ struct ast_generator {
int (*generate)(struct ast_channel *chan, void *data, int len, int samples);
};
+struct ast_callerid {
+ /*! Malloc'd Dialed Number Identifier */
+ char *cid_dnid;
+ /*! Malloc'd Caller Number */
+ char *cid_num;
+ /*! Malloc'd Caller Name */
+ char *cid_name;
+ /*! Malloc'd ANI */
+ char *cid_ani;
+ /*! Malloc'd RDNIS */
+ char *cid_rdnis;
+ /*! Callerid presentation/screening */
+ int cid_pres;
+ /*! Callerid ANI 2 (Info digits) */
+ int cid_ani2;
+ /*! Callerid Type of Number */
+ int cid_ton;
+ /*! Callerid Transit Network Select */
+ int cid_tns;
+};
+
//! Main Channel structure associated with a channel.
/*!
* This is the side of it mostly used by the pbx and call management.
@@ -144,21 +165,8 @@ struct ast_channel {
/*! Requested write format */
int writeformat;
-
- /*! Malloc'd Dialed Number Identifier */
- char *dnid;
- /*! Malloc'd Caller ID */
- char *callerid;
- /*! Malloc'd ANI */
- char *ani;
- /*! Malloc'd RDNIS */
- char *rdnis;
- /*! Hide callerid from user */
- int restrictcid;
- /*! Callerid presentation/screening */
- int callingpres;
-
-
+ struct ast_callerid cid;
+
/*! Current extension context */
char context[AST_MAX_EXTENSION];
/*! Current non-macro context */
@@ -288,7 +296,8 @@ struct chanmon;
oh.context = context; \
oh.exten = exten; \
oh.priority = priority; \
- oh.callerid = callerid; \
+ oh.cid_num = cid_num; \
+ oh.cid_name = cid_name; \
oh.variable = variable; \
oh.account = account; \
}
@@ -297,7 +306,8 @@ struct outgoing_helper {
char *context;
char *exten;
int priority;
- char *callerid;
+ char *cid_num;
+ char *cid_name;
char *variable;
char *account;
};
@@ -401,9 +411,9 @@ int ast_device_state(char *device);
* Returns an ast_channel on success or no answer, NULL on failure. Check the value of chan->_state
* to know if the call was answered or not.
*/
-struct ast_channel *ast_request_and_dial(char *type, int format, void *data, int timeout, int *reason, char *callerid);
+struct ast_channel *ast_request_and_dial(char *type, int format, void *data, int timeout, int *reason, char *cidnum, char *cidname);
-struct ast_channel *__ast_request_and_dial(char *type, int format, void *data, int timeout, int *reason, char *callerid, struct outgoing_helper *oh);
+struct ast_channel *__ast_request_and_dial(char *type, int format, void *data, int timeout, int *reason, char *cidnum, char *cidname, struct outgoing_helper *oh);
//! Registers a channel
/*!
@@ -780,7 +790,7 @@ int ast_activate_generator(struct ast_channel *chan, struct ast_generator *gen,
/*! Deactive an active generator */
void ast_deactivate_generator(struct ast_channel *chan);
-void ast_set_callerid(struct ast_channel *chan, char *callerid, int anitoo);
+void ast_set_callerid(struct ast_channel *chan, char *cidnum, char *cidname, char *ani);
/*! Start a tone going */
int ast_tonepair_start(struct ast_channel *chan, int freq1, int freq2, int duration, int vol);
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h
index f127a0e69..5bec931ed 100755
--- a/include/asterisk/pbx.h
+++ b/include/asterisk/pbx.h
@@ -487,11 +487,11 @@ int ast_async_goto_by_name(char *chan, char *context, char *exten, int priority)
/* Synchronously or asynchronously make an outbound call and send it to a
particular extension */
-int ast_pbx_outgoing_exten(char *type, int format, void *data, int timeout, char *context, char *exten, int priority, int *reason, int sync, char *callerid, char *variable, char *account );
+int ast_pbx_outgoing_exten(char *type, int format, void *data, int timeout, char *context, char *exten, int priority, int *reason, int sync, char *cid_num, char *cid_name, char *variable, char *account );
/* Synchronously or asynchronously make an outbound call and send it to a
particular application with given extension */
-int ast_pbx_outgoing_app(char *type, int format, void *data, int timeout, char *app, char *appdata, int *reason, int sync, char *callerid, char *variable, char *account);
+int ast_pbx_outgoing_app(char *type, int format, void *data, int timeout, char *app, char *appdata, int *reason, int sync, char *cid_num, char *cid_name, char *variable, char *account);
/* Functions for returning values from structures */
char *ast_get_context_name(struct ast_context *con);
diff --git a/include/asterisk/vmodem.h b/include/asterisk/vmodem.h
index 69886154b..c4f271d33 100755
--- a/include/asterisk/vmodem.h
+++ b/include/asterisk/vmodem.h
@@ -3,7 +3,7 @@
*
* Voice Modem Definitions
*
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999-2004, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -118,7 +118,9 @@ struct ast_modem_pvt {
/*! Group(s) we belong to if available */
unsigned int group;
/*! Caller ID if available */
- char cid[AST_MAX_EXTENSION];
+ char cid_name[AST_MAX_EXTENSION];
+ /*! Caller ID if available */
+ char cid_num[AST_MAX_EXTENSION];
/*! DTMF-detection mode (i4l/asterisk) */
int dtmfmode;
/*! DTMF-generation mode (i4l (outband) / asterisk (inband) */