[asterisk-commits] pcadach: branch pcadach/chan_h323-live r42980 - in /team/pcadach/chan_h323-li...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Sep 15 05:33:14 MST 2006


Author: pcadach
Date: Fri Sep 15 07:33:13 2006
New Revision: 42980

URL: http://svn.digium.com/view/asterisk?rev=42980&view=rev
Log:
Handle Caller ID correctly (especially on incoming calls)

Modified:
    team/pcadach/chan_h323-live/channels/chan_h323.c
    team/pcadach/chan_h323-live/channels/h323/chan_h323.h

Modified: team/pcadach/chan_h323-live/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channels/chan_h323.c?rev=42980&r1=42979&r2=42980&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/chan_h323.c (original)
+++ team/pcadach/chan_h323-live/channels/chan_h323.c Fri Sep 15 07:33:13 2006
@@ -169,8 +169,6 @@
 	char exten[AST_MAX_EXTENSION];		/* Requested extension */
 	char context[AST_MAX_CONTEXT];		/* Context where to start */
 	char accountcode[256];				/* Account code */
-	char cid_num[80];					/* Caller*id number, if available */
-	char cid_name[80];					/* Caller*id name, if available */
 	char rdnis[80];						/* Referring DNIS, if available */
 	int amaflags;						/* AMA Flags */
 	struct ast_rtp *rtp;				/* RTP Session */
@@ -1014,14 +1012,17 @@
 		
 		/* Don't use ast_set_callerid() here because it will
 		 * generate a NewCallerID event before the NewChannel event */
-		if (!ast_strlen_zero(pvt->cid_num)) {
-			ch->cid.cid_num = ast_strdup(pvt->cid_num);
-			ch->cid.cid_ani = ast_strdup(pvt->cid_num);
+		if (!ast_strlen_zero(pvt->options.cid_num)) {
+			ch->cid.cid_num = ast_strdup(pvt->options.cid_num);
+			ch->cid.cid_ani = ast_strdup(pvt->options.cid_num);
 		} else {
 			ch->cid.cid_num = ast_strdup(pvt->cd.call_source_e164);
 			ch->cid.cid_ani = ast_strdup(pvt->cd.call_source_e164);
 		}
-		ch->cid.cid_name = ast_strdup(pvt->cid_name);
+		if (!ast_strlen_zero(pvt->options.cid_name))
+			ch->cid.cid_name = ast_strdup(pvt->options.cid_name);
+		else
+			ch->cid.cid_name = ast_strdup(pvt->cd.call_source_name);
 		ch->cid.cid_rdnis = ast_strdup(pvt->rdnis);
 		
 		if (!ast_strlen_zero(pvt->exten) && strcmp(pvt->exten, "s")) {
@@ -1264,6 +1265,8 @@
 		options->progress_alert = tmp;
 	} else if (!strcasecmp(v->name, "progress_audio")) {
 		options->progress_audio = ast_true(v->value);
+	} else if (!strcasecmp(v->name, "callerid")) {
+		ast_callerid_split(v->value, options->cid_name, sizeof(options->cid_name), options->cid_num, sizeof(options->cid_num));
 	} else
 		return 1;
 
@@ -1309,8 +1312,6 @@
 			strncpy(user->context, v->value, sizeof(user->context) - 1);
 		} else if (!strcasecmp(v->name, "secret")) {
 			strncpy(user->secret, v->value, sizeof(user->secret) - 1);
-		} else if (!strcasecmp(v->name, "callerid")) {
-			strncpy(user->callerid, v->value, sizeof(user->callerid) - 1);
 		} else if (!strcasecmp(v->name, "accountcode")) {
 			strncpy(user->accountcode, v->value, sizeof(user->accountcode) - 1);
 		} else if (!strcasecmp(v->name, "host")) {

Modified: team/pcadach/chan_h323-live/channels/h323/chan_h323.h
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channels/h323/chan_h323.h?rev=42980&r1=42979&r2=42980&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/h323/chan_h323.h (original)
+++ team/pcadach/chan_h323-live/channels/h323/chan_h323.h Fri Sep 15 07:33:13 2006
@@ -53,7 +53,6 @@
 //	char name[80];
 	char context[80];
 	char secret[80];
-	char callerid[80];
 	char accountcode[AST_MAX_ACCOUNT_CODE];
 	int amaflags;
 	int host;



More information about the asterisk-commits mailing list