[Asterisk-cvs] asterisk/include/asterisk callerid.h, 1.7, 1.8 channel.h, 1.55, 1.56 pbx.h, 1.25, 1.26 vmodem.h, 1.11, 1.12

markster at lists.digium.com markster at lists.digium.com
Fri Oct 1 20:56:26 CDT 2004


Update of /usr/cvsroot/asterisk/include/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv31663/include/asterisk

Modified Files:
	callerid.h channel.h pbx.h vmodem.h 
Log Message:
Huge callerid rework (might break H.323, others)


Index: callerid.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/callerid.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- callerid.h	19 Sep 2004 16:17:18 -0000	1.7
+++ callerid.h	2 Oct 2004 00:58:31 -0000	1.8
@@ -3,9 +3,9 @@
  *
  * CallerID (and other GR30) Generation support 
  * 
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999-2004, Digium, Inc.
  *
- * Mark Spencer <markster at linux-support.net>
+ * Mark Spencer <markster at digium.com>
  *
  * This program is free software, distributed under the terms of
  * the GNU General Public License.
@@ -118,16 +118,16 @@
  *
  * 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 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

Index: channel.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/channel.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- channel.h	19 Sep 2004 16:17:18 -0000	1.55
+++ channel.h	2 Oct 2004 00:58:31 -0000	1.56
@@ -48,6 +48,27 @@
 	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 @@
 	/*! 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 @@
 	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 @@
 	char *context;
 	char *exten;
 	int priority;
-	char *callerid;
+	char *cid_num;
+	char *cid_name;
 	char *variable;
 	char *account;
 };
@@ -401,9 +411,9 @@
  * 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 @@
 /*! 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);

Index: pbx.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/pbx.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- pbx.h	21 Aug 2004 18:55:39 -0000	1.25
+++ pbx.h	2 Oct 2004 00:58:31 -0000	1.26
@@ -487,11 +487,11 @@
 
 /* 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);

Index: vmodem.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/vmodem.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- vmodem.h	22 Jun 2004 17:42:14 -0000	1.11
+++ vmodem.h	2 Oct 2004 00:58:31 -0000	1.12
@@ -3,7 +3,7 @@
  *
  * Voice Modem Definitions
  * 
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999-2004, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
  *
@@ -118,7 +118,9 @@
 	/*! 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) */




More information about the svn-commits mailing list