[asterisk-commits] mmichelson: branch group/issue8824 r141279 - in /team/group/issue8824: channe...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 5 12:03:42 CDT 2008


Author: mmichelson
Date: Fri Sep  5 12:03:41 2008
New Revision: 141279

URL: http://svn.digium.com/view/asterisk?view=rev&rev=141279
Log:
Change the behavior of the ast_indicate function so that
if the condition is an AST_CONTROL_CONNECTEDLINE, we parse
the data and set the channel's lid structure prior to
calling the channel's indicate callback. This change helps
to streamline the process and make sure that the channel's
lid data is correctly updated.


Modified:
    team/group/issue8824/channels/chan_iax2.c
    team/group/issue8824/channels/chan_misdn.c
    team/group/issue8824/channels/chan_sip.c
    team/group/issue8824/channels/chan_skinny.c
    team/group/issue8824/main/channel.c

Modified: team/group/issue8824/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/chan_iax2.c?view=diff&rev=141279&r1=141278&r2=141279
==============================================================================
--- team/group/issue8824/channels/chan_iax2.c (original)
+++ team/group/issue8824/channels/chan_iax2.c Fri Sep  5 12:03:41 2008
@@ -4109,8 +4109,6 @@
 	unsigned short callno = PTR_TO_CALLNO(c->tech_pvt);
 	struct chan_iax2_pvt *pvt;
 	int res = 0;
-	char cid_num[80], cid_name[80];
-	int cid_pres;
 
 	if (iaxdebug)
 		ast_debug(1, "Indicating condition %d\n", condition);
@@ -4145,9 +4143,6 @@
 		}
 		break;
 	case AST_CONTROL_CONNECTEDLINE:
-		if (ast_parse_connectedline_data((unsigned char *) data, datalen, cid_num, sizeof(cid_num), cid_name, sizeof(cid_name), &cid_pres) == -1)
-			goto done;
-		ast_set_connectedline(c, cid_num, cid_name, cid_pres);
 		if (!ast_test_flag(pvt, IAX_SENDCONNECTEDLINE))
 			goto done;
 		break;

Modified: team/group/issue8824/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/chan_misdn.c?view=diff&rev=141279&r1=141278&r2=141279
==============================================================================
--- team/group/issue8824/channels/chan_misdn.c (original)
+++ team/group/issue8824/channels/chan_misdn.c Fri Sep  5 12:03:41 2008
@@ -2529,14 +2529,9 @@
 	char lid_name[80];
 	int lid_pres;
 
-	if (ast_parse_connectedline_data((unsigned char *) data, datalen, lid_number, sizeof(lid_number), lid_name, sizeof(lid_name), &lid_pres)) {
-		return;
-	}
-
-	ast_set_connectedline(ast, lid_number, lid_name, lid_pres);
-	strcpy(bc->connected.number, lid_number);
-	bc->connected.presentation = ast_pres_to_misdn_pres(lid_pres);
-	bc->connected.screening = ast_screen_to_misdn_screen(lid_pres);
+	strcpy(bc->connected.number, ast->lid.lid_number);
+	bc->connected.presentation = ast_pres_to_misdn_pres(ast->lid.lid_pres);
+	bc->connected.screening = ast_screen_to_misdn_screen(ast->lid.lid_pres);
 }	/* end misdn_update_connectedline() */
 
 

Modified: team/group/issue8824/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/chan_sip.c?view=diff&rev=141279&r1=141278&r2=141279
==============================================================================
--- team/group/issue8824/channels/chan_sip.c (original)
+++ team/group/issue8824/channels/chan_sip.c Fri Sep  5 12:03:41 2008
@@ -9503,13 +9503,7 @@
 /*! \brief Notify peer that the connected line has changed */
 static void update_connectedline(struct sip_pvt *p, const void *data, size_t datalen)
 {
-	char lid_num[80], lid_name[80];
-	int lid_pres;
-
-	if (ast_parse_connectedline_data((unsigned char *) data, datalen, lid_num, sizeof(lid_num), lid_name, sizeof(lid_name), &lid_pres))
-		return;
-	ast_set_connectedline(p->owner, lid_num, lid_name, lid_pres);
-
+	
 	if (!ast_test_flag(&p->flags[0], SIP_SENDRPID))
 		return;
 	if (ast_strlen_zero(p->owner->lid.lid_num))

Modified: team/group/issue8824/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/chan_skinny.c?view=diff&rev=141279&r1=141278&r2=141279
==============================================================================
--- team/group/issue8824/channels/chan_skinny.c (original)
+++ team/group/issue8824/channels/chan_skinny.c Fri Sep  5 12:03:41 2008
@@ -2308,12 +2308,6 @@
 	struct ast_channel *c = sub->owner;
 	struct skinny_line *l = sub->parent;
 	struct skinny_device *d = l->parent;
-	char lid_name[80], lid_num[80];
-	int lid_pres;
-
-	if (ast_parse_connectedline_data((unsigned char *) data, datalen, lid_num, sizeof(lid_num), lid_name, sizeof(lid_name), &lid_pres))
-		return;
-	ast_set_connectedline(c, lid_num, lid_name, lid_pres);
 
 	if (ast_strlen_zero(c->cid.cid_num) || ast_strlen_zero(c->lid.lid_num))
 		return;

Modified: team/group/issue8824/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/main/channel.c?view=diff&rev=141279&r1=141278&r2=141279
==============================================================================
--- team/group/issue8824/main/channel.c (original)
+++ team/group/issue8824/main/channel.c Fri Sep  5 12:03:41 2008
@@ -2800,6 +2800,15 @@
 		ast_channel_unlock(chan);
 		return -1;
 	}
+	if (condition == AST_CONTROL_CONNECTEDLINE) {
+		char lid_num[80], lid_name[80];
+		int lid_pres;
+
+		res = ast_parse_connectedline_data((unsigned char *) data, datalen, lid_num, sizeof(lid_num), lid_name, sizeof(lid_name), &lid_pres);
+
+		if (!res)
+			ast_set_connectedline(chan, lid_num, lid_name, lid_pres);
+	}
 	if (chan->tech->indicate)
 		res = chan->tech->indicate(chan, condition, data, datalen);
 	ast_channel_unlock(chan);
@@ -2841,13 +2850,7 @@
 			} else if (condition == AST_CONTROL_SRCUPDATE) {
 				/* Do nothing... */
 			} else if (condition == AST_CONTROL_CONNECTEDLINE) {
-				char lid_num[80], lid_name[80];
-				int lid_pres;
-
-				res = ast_parse_connectedline_data((unsigned char *) data, datalen, lid_num, sizeof(lid_num), lid_name, sizeof(lid_name), &lid_pres);
-
-				if (!res)
-					ast_set_connectedline(chan, lid_num, lid_name, lid_pres);
+				/* Already handled above... */
 			} else {
 				/* not handled */
 				ast_log(LOG_WARNING, "Unable to handle indication %d for '%s'\n", condition, chan->name);




More information about the asterisk-commits mailing list