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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Sep 17 12:44:15 MST 2006


Author: pcadach
Date: Sun Sep 17 14:44:15 2006
New Revision: 43097

URL: http://svn.digium.com/view/asterisk?rev=43097&view=rev
Log:
Formatting and typo

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

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=43097&r1=43096&r2=43097&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/chan_h323.c (original)
+++ team/pcadach/chan_h323-live/channels/chan_h323.c Sun Sep 17 14:44:15 2006
@@ -163,7 +163,7 @@
 	call_details_t cd;					/* Call details */
 	struct ast_channel *owner;			/* Who owns us */
 	struct sockaddr_in sa;				/* Our peer */
-	struct sockaddr_in redirip; 		/* Where our RTP should be going if not to us */
+	struct sockaddr_in redirip;			/* Where our RTP should be going if not to us */
 	int nonCodecCapability;				/* non-audio capability */
 	int outgoing;						/* Outgoing or incoming call? */
 	char exten[AST_MAX_EXTENSION];		/* Requested extension */
@@ -453,11 +453,11 @@
 		ast_sched_del(sched, pvt->DTMFsched);
 		pvt->DTMFsched = -1;
 	}
-	
+
 	if (pvt->rtp) {
 		ast_rtp_destroy(pvt->rtp);
 	}
-	
+
 	/* Free dsp used for in-band DTMF detection */
 	if (pvt->vad) {
 		ast_dsp_free(pvt->vad);
@@ -624,7 +624,7 @@
 	if (c->cid.cid_rdnis) {
 		strncpy(pvt->options.cid_rdnis, c->cid.cid_rdnis, sizeof(pvt->options.cid_rdnis));
 	}
-	
+
 	if ((addr = pbx_builtin_getvar_helper(c, "PRIREDIRECTREASON"))) {
 		if (!strcasecmp(addr, "UNKNOWN"))
 			pvt->options.redirect_reason = 0;
@@ -698,7 +698,7 @@
 		ast_mutex_unlock(&pvt->lock);
 		return 0;
 	}
-	
+
 	pvt->owner = NULL;
 	c->tech_pvt = NULL;
 
@@ -775,7 +775,7 @@
 				ast_set_read_format(pvt->owner, pvt->owner->readformat);
 				ast_set_write_format(pvt->owner, pvt->owner->writeformat);
 				ast_channel_unlock(pvt->owner);
-			}	
+			}
 			/* Do in-band DTMF detection */
 			if ((pvt->options.dtmfmode & H323_DTMF_INBAND) && pvt->vad) {
 				if ((pvt->nativeformats & (AST_FORMAT_SLINEAR | AST_FORMAT_ALAW | AST_FORMAT_ULAW))) {
@@ -869,10 +869,10 @@
 	case AST_CONTROL_RINGING:
 		if (c->_state == AST_STATE_RING || c->_state == AST_STATE_RINGING) {
 			h323_send_alerting(token);
- 			break;
- 		}
- 		if (token)
- 			free(token);
+			break;
+		}
+		if (token)
+			free(token);
 		return -1;
 	case AST_CONTROL_PROGRESS:
 		if (c->_state != AST_STATE_UP) {
@@ -888,7 +888,7 @@
 			ast_mutex_lock(&pvt->lock);
 			pvt->alreadygone = 1;
 			ast_mutex_unlock(&pvt->lock);
-			ast_softhangup_nolock(c, AST_SOFTHANGUP_DEV);			
+			ast_softhangup_nolock(c, AST_SOFTHANGUP_DEV);
 			break;
 		}
 		if (token)
@@ -998,7 +998,7 @@
 {
 	struct ast_channel *ch;
 	int fmt;
-	
+
 	/* Don't hold a oh323_pvt lock while we allocate a chanel */
 	ast_mutex_unlock(&pvt->lock);
 	ch = ast_channel_alloc(1);
@@ -1044,9 +1044,9 @@
 		ch->tech_pvt = pvt;
 		/* Set the owner of this channel */
 		pvt->owner = ch;
-		
+
 		strncpy(ch->context, pvt->context, sizeof(ch->context) - 1);
-		strncpy(ch->exten, pvt->exten, sizeof(ch->exten) - 1);		
+		strncpy(ch->exten, pvt->exten, sizeof(ch->exten) - 1);
 		ch->priority = 1;
 		if (!ast_strlen_zero(pvt->accountcode)) {
 			ast_string_field_set(ch, accountcode, pvt->accountcode);
@@ -1054,7 +1054,7 @@
 		if (pvt->amaflags) {
 			ch->amaflags = pvt->amaflags;
 		}
-		
+
 		/* Don't use ast_set_callerid() here because it will
 		 * generate a NewCallerID event before the NewChannel event */
 		if (!ast_strlen_zero(pvt->options.cid_num)) {
@@ -1072,7 +1072,7 @@
 			ch->cid.cid_rdnis = ast_strdup(pvt->cd.redirect_number);
 			pbx_builtin_setvar_helper(ch, "PRIREDIRECTREASON", redirectingreason2str(pvt->cd.redirect_reason));
 		}
-		
+
 		if (!ast_strlen_zero(pvt->exten) && strcmp(pvt->exten, "s")) {
 			ch->cid.cid_dnid = strdup(pvt->exten);
 		}
@@ -1219,7 +1219,7 @@
 		} else if (!strcasecmp(v->name, "secret")) {
 			strncpy(alias->secret, v->value, sizeof(alias->secret) - 1);
 		} else {
-			if (strcasecmp(v->value, "h323")) { 	
+			if (strcasecmp(v->value, "h323")) {
 				ast_log(LOG_WARNING, "Keyword %s does not make sense in type=h323\n", v->name);
 			}
 		}
@@ -1276,7 +1276,7 @@
 	} else if (!strcasecmp(v->name, "dtmfcodec")) {
 		tmp = atoi(v->value);
 		if (tmp < 96)
-			ast_log(LOG_WARNING, "Invalid global dtmfcodec value %s\n", v->value);
+			ast_log(LOG_WARNING, "Invalid %s value %s at line %d\n", v->name, v->value, v->lineno);
 		else
 			options->dtmfcodec = tmp;
 	} else if (!strcasecmp(v->name, "bridge")) {
@@ -1301,14 +1301,14 @@
 	} else if (!strcasecmp(v->name, "progress_setup")) {
 		tmp = atoi(v->value);
 		if ((tmp != 0) && (tmp != 1) && (tmp != 3) && (tmp != 8)) {
-			ast_log(LOG_WARNING, "Invalid value %d for progress_setup at line %d, assuming 0\n", tmp, v->lineno);
+			ast_log(LOG_WARNING, "Invalid value %d for %s at line %d, assuming 0\n", v->value, v->name, v->lineno);
 			tmp = 0;
 		}
 		options->progress_setup = tmp;
 	} else if (!strcasecmp(v->name, "progress_alert")) {
 		tmp = atoi(v->value);
 		if ((tmp != 0) && (tmp != 1) && (tmp != 8)) {
-			ast_log(LOG_WARNING, "Invalud value %d for progress_alert at line %d, assuming 0\n", tmp, v->lineno);
+			ast_log(LOG_WARNING, "Invalid value %s for %s at line %d, assuming 0\n", v->value, v->name, v->lineno);
 			tmp = 0;
 		}
 		options->progress_alert = tmp;
@@ -1436,7 +1436,7 @@
 	}
 
 	user = build_user(username, var, NULL, 1);
-	
+
 	ast_variables_destroy(var);
 
 	return user;
@@ -1558,7 +1558,7 @@
 		u = ASTOBJ_CONTAINER_FIND(&userl, cd->call_source_aliases);
 	else
 		u = ASTOBJ_CONTAINER_FIND_FULL(&userl, cd->sourceIp, addr.sin_addr, 0, 0, oh323_addrcmp_str);
-	
+
 	if (!u && realtime)
 		u = realtime_user(cd);
 
@@ -1636,8 +1636,8 @@
 			}
 		}
 		if (p->addr.sin_addr.s_addr) {
-			pvt->sa.sin_addr = p->addr.sin_addr;	
-			pvt->sa.sin_port = p->addr.sin_port;	
+			pvt->sa.sin_addr = p->addr.sin_addr;
+			pvt->sa.sin_port = p->addr.sin_port;
 		}
 		ASTOBJ_UNREF(p, oh323_destroy_peer);
 	}
@@ -1647,7 +1647,7 @@
 			portno = atoi(port);
 		} else {
 			portno = h323_signalling_port;
-		}		
+		}
 		hp = ast_gethostbyname(hostn, &ahp);
 		if (hp) {
 			memcpy(&pvt->sa.sin_addr, hp->h_addr, sizeof(pvt->sa.sin_addr));
@@ -1673,14 +1673,14 @@
 					pvt->nonCodecCapability &= ~AST_RTP_DTMF;
 				}
 			}
-			return 0;	
+			return 0;
 		} else {
 			ast_log(LOG_WARNING, "No such host: %s\n", peer);
 			return -1;
 		}
 	} else if (!found) {
 		return -1;
-	} else {	
+	} else {
 		return 0;
 	}
 }
@@ -1694,14 +1694,14 @@
 	char *h323id = NULL;
 	char tmp[256], tmp1[256];
 
-	if (h323debug)	
+	if (h323debug)
 		ast_log(LOG_DEBUG, "type=%s, format=%d, data=%s.\n", type, format, (char *)data);
 
 	pvt = oh323_alloc(0);
 	if (!pvt) {
 		ast_log(LOG_WARNING, "Unable to build pvt data for '%s'\n", (char *)data);
 		return NULL;
-	}	
+	}
 	oldformat = format;
 	format &= ((AST_FORMAT_MAX_AUDIO << 1) - 1);
 	if (!format) {
@@ -1711,7 +1711,7 @@
 			*cause = AST_CAUSE_INCOMPATIBLE_DESTINATION;
 		return NULL;
 	}
-	strncpy(tmp, dest, sizeof(tmp) - 1);	
+	strncpy(tmp, dest, sizeof(tmp) - 1);
 	host = strchr(tmp, '@');
 	if (host) {
 		*host = '\0';
@@ -1858,7 +1858,7 @@
   * Returns the local RTP information
   */
 static struct rtp_info *external_rtp_create(unsigned call_reference, const char * token)
-{	
+{
 	struct oh323_pvt *pvt;
 	struct sockaddr_in us;
 	struct rtp_info *info;
@@ -1928,7 +1928,7 @@
 		ast_mutex_unlock(&pvt->lock);
 		return;
 	}
-	
+
 	if (!pvt->rtp)
 		__oh323_rtp_create(pvt);
 
@@ -2305,12 +2305,12 @@
   * Returns nothing,
   */
 static void cleanup_connection(unsigned call_reference, const char *call_token)
-{	
+{
 	struct oh323_pvt *pvt;
 
 	if (h323debug)
 		ast_log(LOG_DEBUG, "Cleaning connection to %s\n", call_token);
-	
+
 	while (1) {
 		pvt = find_call_locked(call_reference, call_token);
 		if (!pvt) {
@@ -2342,7 +2342,7 @@
 	}
 	cleanup_call_details(&pvt->cd);
 	pvt->alreadygone = 1;
-	/* Send hangup */	
+	/* Send hangup */
 	if (pvt->owner) {
 		pvt->owner->_softhangup |= AST_SOFTHANGUP_DEV;
 		ast_queue_hangup(pvt->owner);
@@ -2351,7 +2351,7 @@
 	ast_mutex_unlock(&pvt->lock);
 	if (h323debug)
 		ast_log(LOG_DEBUG, "Connection to %s cleaned\n", call_token);
-	return;	
+	return;
 }
 
 static void hangup_connection(unsigned int call_reference, const char *token, int cause)
@@ -2361,7 +2361,7 @@
 	if (h323debug) {
 		ast_log(LOG_DEBUG, "Hanging up connection to %s with cause %d\n", token, cause);
 	}
-	
+
 	pvt = find_call_locked(call_reference, token);
 	if (!pvt) {
 		if (h323debug) {
@@ -2447,7 +2447,7 @@
 	int res;
 	int reloading;
 	struct oh323_pvt *oh323 = NULL;
-	
+
 	for(;;) {
 		/* Check for a reload request */
 		ast_mutex_lock(&h323_reload_lock);
@@ -2475,7 +2475,7 @@
 			}
 		} while (/*oh323*/ 0);
 #else
-restartsearch:		
+restartsearch:
 		oh323 = iflist;
 		while(oh323) {
 			if (!ast_mutex_trylock(&oh323->lock)) {
@@ -2530,7 +2530,7 @@
 	if (monitor_thread && (monitor_thread != AST_PTHREADT_NULL)) {
 		/* Wake up the thread */
 		pthread_kill(monitor_thread, SIGURG);
-	} else {	
+	} else {
 		pthread_attr_init(&attr);
 		pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 		/* Start a new monitor */
@@ -2589,9 +2589,9 @@
 {
 	if (argc != 3) {
 		return RESULT_SHOWUSAGE;
-	}	
+	}
 	h323_gk_urq();
-	
+
 	/* Possibly register with a GK */
 	if (!gatekeeper_disable) {
 		if (h323_set_gk(gatekeeper_discover, gatekeeper, secret)) {
@@ -2673,7 +2673,7 @@
 };
 
 static int reload_config(int is_reload)
-{	
+{
 	int format;
 	struct ast_config *cfg, *ucfg;
 	struct ast_variable *v;
@@ -2694,7 +2694,7 @@
 		ast_log(LOG_NOTICE, "Unable to load config %s, H.323 disabled\n", config);
 		return 1;
 	}
-	
+
 	/* fire up the H.323 Endpoint */
 	if (!h323_end_point_exist()) {
 		h323_end_point_create();
@@ -2791,7 +2791,7 @@
 			gkroute = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "context")) {
 			strncpy(default_context, v->value, sizeof(default_context) - 1);
-			ast_verbose(VERBOSE_PREFIX_2 "Setting default context to %s\n", default_context);	
+			ast_verbose(VERBOSE_PREFIX_2 "Setting default context to %s\n", default_context);
 		} else if (!strcasecmp(v->name, "UserByAlias")) {
 			userbyalias = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "AcceptAnonymous")) {
@@ -2800,7 +2800,7 @@
 			/* dummy */
 		}
 	}
-	
+
 	for (cat = ast_category_browse(cfg, NULL); cat; cat = ast_category_browse(cfg, cat)) {
 		if (strcasecmp(cat, "general")) {
 			utype = ast_variable_retrieve(cfg, cat, "type");
@@ -2883,7 +2883,7 @@
 static void delete_users(void)
 {
 	int pruned = 0;
-	
+
 	/* Delete all users */
 	ASTOBJ_CONTAINER_WRLOCK(&userl);
 	ASTOBJ_CONTAINER_TRAVERSE(&userl, 1, do {
@@ -2896,7 +2896,7 @@
 		ASTOBJ_CONTAINER_PRUNE_MARKED(&userl, oh323_destroy_user);
 	}
 	ASTOBJ_CONTAINER_UNLOCK(&userl);
-	
+
 	ASTOBJ_CONTAINER_WRLOCK(&peerl);
 	ASTOBJ_CONTAINER_TRAVERSE(&peerl, 1, do {
 		ASTOBJ_RDLOCK(iterator);
@@ -2909,7 +2909,7 @@
 static void delete_aliases(void)
 {
 	int pruned = 0;
-		
+
 	/* Delete all aliases */
 	ASTOBJ_CONTAINER_WRLOCK(&aliasl);
 	ASTOBJ_CONTAINER_TRAVERSE(&aliasl, 1, do {
@@ -3026,7 +3026,7 @@
 		ast_log(LOG_ERROR, "No Private Structure, this is bad\n");
 		return -1;
 	}
-	ast_rtp_get_peer(rtp, &them);	
+	ast_rtp_get_peer(rtp, &them);
 	ast_rtp_get_us(rtp, &us);
 #if 0	/* Native bridge still isn't ready */
 	h323_native_bridge(pvt->cd.call_token, ast_inet_ntoa(them.sin_addr), mode);
@@ -3143,7 +3143,7 @@
 
 	ast_channel_unregister(&oh323_tech);
 	ast_rtp_proto_unregister(&oh323_rtp);
-		
+
 	if (!ast_mutex_lock(&iflock)) {
 		/* hangup all interfaces if they have an owner */
 		p = iflist;

Modified: team/pcadach/chan_h323-live/channels/h323/ast_h323.cpp
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channels/h323/ast_h323.cpp?rev=43097&r1=43096&r2=43097&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/h323/ast_h323.cpp (original)
+++ team/pcadach/chan_h323-live/channels/h323/ast_h323.cpp Sun Sep 17 14:44:15 2006
@@ -191,7 +191,7 @@
 {
 	PTrace::Initialise(PTrace::GetLevel(), NULL, traceOptions);
 	PTrace::SetStream(logstream);
-	
+
 	cout << "  == Creating H.323 Endpoint" << endl;
 	if (endPoint) {
 		cout << "  == ENDPOINT ALREADY CREATED" << endl;
@@ -460,7 +460,7 @@
 		cout << "\t-- Call reference is " << *callReference << endl;
 		cout << "\t-- DTMF Payload is " << connection->dtmfCodec << endl;
 	}
-	connection->Unlock(); 	
+	connection->Unlock();
 	return 0;
 }
 
@@ -512,7 +512,7 @@
 void MyH323EndPoint::SendUserTone(const PString &token, char tone)
 {
 	H323Connection *connection = NULL;
-		
+
 	connection = FindConnectionWithLock(token);
 	if (connection != NULL) {
 		connection->SendUserInputTone(tone, 500);
@@ -530,22 +530,22 @@
 }
 
 BOOL MyH323EndPoint::OnConnectionForwarded(H323Connection & connection,
- 		const PString & forwardParty,
- 		const H323SignalPDU & pdu)
- {
- 	if (h323debug) {
-	 	cout << "\t-- Call Forwarded to " << forwardParty << endl;
- 	}
+		const PString & forwardParty,
+		const H323SignalPDU & pdu)
+{
+	if (h323debug) {
+		cout << "\t-- Call Forwarded to " << forwardParty << endl;
+	}
 	return FALSE;
- }
+}
 
 BOOL MyH323EndPoint::ForwardConnection(H323Connection & connection,
- 		const PString & forwardParty,
- 		const H323SignalPDU & pdu)
-{
- 	if (h323debug) {
- 		cout << "\t-- Forwarding call to " << forwardParty << endl;
- 	}
+		const PString & forwardParty,
+		const H323SignalPDU & pdu)
+{
+	if (h323debug) {
+		cout << "\t-- Forwarding call to " << forwardParty << endl;
+	}
 	return H323EndPoint::ForwardConnection(connection, forwardParty, pdu);
 }
 
@@ -665,7 +665,7 @@
 		if (h323debug) {
 			cout << "\t-- Call duration " << setprecision(0) << setw(5) << (PTime() - connection.GetConnectionStartTime()) << endl;
 		}
-	}	
+	}
 	/* Invoke the PBX application registered callback */
 	on_connection_cleared(connection.GetCallReference(), clearedCallToken);
 	return;
@@ -746,7 +746,7 @@
 	if (h323debug) {
 		cout << "\t- Progress Indicator: " << pi << endl;
 	}
-	
+
 	switch(pi) {
 	case Q931::ProgressNotEndToEndISDN:
 	case Q931::ProgressInbandInformationAvailable:
@@ -823,7 +823,7 @@
 		if (h323debug) {
 			cout << "\t\t- Progress Indicator: " << alertingPI << endl;
 		}
-		
+
 		switch(alertingPI) {
 		case Q931::ProgressNotEndToEndISDN:
 		case Q931::ProgressInbandInformationAvailable:
@@ -894,7 +894,7 @@
 		cd->call_source_name = strdup((const char *)sourceName);
 
 		GetSignallingChannel()->GetRemoteAddress().GetIpAndPort(Ip, sourcePort);
-	 	cd->sourceIp = strdup((const char *)Ip.AsString());
+		cd->sourceIp = strdup((const char *)Ip.AsString());
 
 		if(setupPDU.GetQ931().GetRedirectingNumber(redirect_number, NULL, NULL, NULL, NULL, &redirect_reason, 0, 0, 0)) {
 			cd->redirect_number = strdup((const char *)redirect_number);
@@ -916,8 +916,8 @@
 
 	destAliases = setupPDU.GetDestinationAlias();
 	s1 = strdup((const char *)destAliases);
- 	if ((s = strchr(s1, ' ')) != NULL)
- 		*s = '\0';
+	if ((s = strchr(s1, ' ')) != NULL)
+		*s = '\0';
 	if ((s = strchr(s1, '\t')) != NULL)
 		*s = '\0';
 	cd->call_dest_alias = s1;
@@ -1065,11 +1065,11 @@
 		ns.m_t35CountryCode = 181;
 		ns.m_t35Extension = 0;
 		ns.m_manufacturerCode = 18;
-		
+
 		CISCO_H225_H323_UU_NonStdInfo c;
 		c.IncludeOptionalField(CISCO_H225_H323_UU_NonStdInfo::e_version);
 		c.m_version = 0;
-		
+
 		if (notRedirOnly) {
 			c.IncludeOptionalField(CISCO_H225_H323_UU_NonStdInfo::e_protoParam);
 			CISCO_H225_QsigNonStdInfo &qsigInfo = c.m_protoParam.m_qsigNonStdInfo;
@@ -1165,9 +1165,9 @@
 
 	Q931 &q931 = pdu.GetQ931();
 	PBYTEArray message;
-	
+
 	q931.Encode(message);
-	
+
 	/* Remove non-standard IEs */
 	for(unsigned i = 0; i < (sizeof(codes) / sizeof(codes[0])); ++i) {
 		if (q931.HasIE(codes[i])) {
@@ -1302,7 +1302,7 @@
 
 	if (progressSetup)
 		setupPDU.GetQ931().SetProgressIndicator(progressSetup);
-	
+
 	if (redirect_reason >= 0) {
 		setupPDU.GetQ931().SetRedirectingNumber(rdnis, 0, 0, 0, 0, redirect_reason);
 		/* OpenH323 incorrectly fills number IE when redirecting reason is specified - fix it */
@@ -1311,7 +1311,7 @@
 		IE[1] = IE[1] & 0x7f;
 		setupPDU.GetQ931().SetIE(Q931::RedirectingNumberIE, IE);
 	}
-	
+
 	SetCallDetails(&cd, setupPDU, FALSE);
 
 	int res = on_outgoing_call(&cd);
@@ -1348,7 +1348,7 @@
 {
 	if (h323debug) {
 		cout << "\t-- Received Facility message... " << endl;
-	}	
+	}
 	return H323Connection::OnReceivedFacility(pdu);
 }
 
@@ -1514,7 +1514,7 @@
 					}
 					if ((subType != H245_VideoCapability::e_genericVideoCapability) ||
 							(vcodecs[x].oid && ((const H323GenericVideoCapability &)remoteCapabilities[i]).IsGenericMatch((const H245_GenericCapability)y))) {
-					    if (h323debug) {
+						if (h323debug) {
 							cout << "Found peer video capability " << remoteCapabilities[i] << ", Asterisk code is " << vcodecs[x].asterisk_codec << endl;
 						}
 						peer_capabilities |= vcodecs[x].asterisk_codec;
@@ -1538,11 +1538,11 @@
 #endif
 	if (on_setpeercapabilities)
 		on_setpeercapabilities(GetCallReference(), (const char *)callToken, peer_capabilities);
-	
+
 	return TRUE;
 }
 
-H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capability & capability,	
+H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capability & capability,
 									H323Channel::Directions dir,
 									unsigned sessionID,
 									const H245_H2250LogicalChannelParameters * /*param*/,
@@ -1578,10 +1578,10 @@
 	int x, y;
 	char caps_str[1024];
 	struct ast_codec_pref *prefs = (struct ast_codec_pref *)_prefs;
-	
+
 	localCapabilities.RemoveAll();
 
-	if (h323debug) {	
+	if (h323debug) {
 		cout << "Setting capabilities to " << ast_getformatname_multiple(caps_str, sizeof(caps_str), cap) << endl;
 		ast_codec_pref_string(prefs, caps_str, sizeof(caps_str));
 		cout << "Capabilities in preference order is " << caps_str << endl;
@@ -1648,7 +1648,7 @@
 			break;
 		}
 	}
-	
+
 	lastcap++;
 	lastcap = localCapabilities.SetCapability(0, lastcap, new H323_UserInputCapability(H323_UserInputCapability::HookFlashH245));
 
@@ -1814,7 +1814,7 @@
 {
 	channelsOpen = 0;
 	logstream = new PAsteriskLog();
-	localProcess = new MyProcess();	
+	localProcess = new MyProcess();
 	localProcess->Main();
 }
 
@@ -1823,7 +1823,7 @@
 	if (!h323_end_point_exist()) {
 		cout << " ERROR: [h323_gk_urq] No Endpoint, this is bad" << endl;
 		return;
-	}	
+	}
 	endPoint->RemoveGatekeeper();
 }
 
@@ -1835,22 +1835,22 @@
 		PTrace:: SetLevel(0);
 	}
 }
-	
+
 /** Installs the callback functions on behalf of the PBX application */
 void h323_callback_register(setup_incoming_cb		ifunc,
-						    setup_outbound_cb		sfunc,
-			 			    on_rtp_cb				rtpfunc,
-						    start_rtp_cb			lfunc,
-			 			    clear_con_cb			clfunc,
-			 			    chan_ringing_cb			rfunc,
-						    con_established_cb		efunc,
-			 			    receive_digit_cb		dfunc,
-			 			    answer_call_cb			acfunc,
-						    progress_cb				pgfunc,
-						    rfc2833_cb				dtmffunc,
-						    hangup_cb				hangupfunc,
-						    setcapabilities_cb		capabilityfunc,
-						    setpeercapabilities_cb	peercapabilityfunc)
+							setup_outbound_cb		sfunc,
+							on_rtp_cb				rtpfunc,
+							start_rtp_cb			lfunc,
+							clear_con_cb			clfunc,
+							chan_ringing_cb			rfunc,
+							con_established_cb		efunc,
+							receive_digit_cb		dfunc,
+							answer_call_cb			acfunc,
+							progress_cb				pgfunc,
+							rfc2833_cb				dtmffunc,
+							hangup_cb				hangupfunc,
+							setcapabilities_cb		capabilityfunc,
+							setpeercapabilities_cb	peercapabilityfunc)
 {
 	on_incoming_call = ifunc;
 	on_outgoing_call = sfunc;
@@ -1899,12 +1899,12 @@
 /** Start the H.323 listener */
 int h323_start_listener(int listenPort, struct sockaddr_in bindaddr)
 {
-	
+
 	if (!h323_end_point_exist()) {
 		cout << "ERROR: [h323_start_listener] No Endpoint, this is bad!" << endl;
 		return 1;
 	}
-	
+
 	PIPSocket::Address interfaceAddress(bindaddr.sin_addr);
 	if (!listenPort) {
 		listenPort = 1720;
@@ -1916,7 +1916,6 @@
 		cout << "ERROR: Could not open H.323 listener port on " << ((H323ListenerTCP *) tcpListener)->GetListenerPort() << endl;
 		delete tcpListener;
 		return 1;
-		
 	}
 	cout << "  == H.323 listener started" << endl;
 	return 0;
@@ -1929,14 +1928,14 @@
 	PString h323id(alias->name);
 	PString e164(alias->e164);
 	char *prefix;
-	
+
 	if (!h323_end_point_exist()) {
 		cout << "ERROR: [h323_set_alias] No Endpoint, this is bad!" << endl;
 		return 1;
 	}
 
 	cout << "== Adding alias \"" << h323id << "\" to endpoint" << endl;
-	endPoint->AddAliasName(h323id);	
+	endPoint->AddAliasName(h323id);
 	endPoint->RemoveAliasName(localProcess->GetUserName());
 
 	if (!e164.IsEmpty()) {
@@ -2000,7 +1999,7 @@
 		} else {
 			cout << "Warning: Could not find a gatekeeper." << endl;
 			return 1;
-		}	
+		}
 	} else {
 		rasChannel = new MyH323TransportUDP(*endPoint);
 
@@ -2109,15 +2108,15 @@
 	return 0;
 }
 
-/** This function tells the h.323 stack to either 
+/** This function tells the h.323 stack to either
     answer or deny an incoming call */
-int h323_answering_call(const char *token, int busy) 
+int h323_answering_call(const char *token, int busy)
 {
 	const PString currentToken(token);
 	H323Connection * connection;
-	
+
 	connection = endPoint->FindConnectionWithLock(currentToken);
-	
+
 	if (!connection) {
 		cout << "No connection found for " << token << endl;
 		return -1;
@@ -2141,8 +2140,8 @@
 {
 	PString token(data);
 	BOOL result;
-	cout << "Soft hangup" << endl;	
-	result = endPoint->ClearCall(token);	
+	cout << "Soft hangup" << endl;
+	result = endPoint->ClearCall(token);
 	return result;
 }
 
@@ -2151,7 +2150,7 @@
 {
 	H323Channel *channel;
 	MyH323Connection *connection = (MyH323Connection *)endPoint->FindConnectionWithLock(token);
-	
+
 	if (!connection) {
 		cout << "ERROR: No connection found, this is bad" << endl;
 		return;
@@ -2162,7 +2161,7 @@
 	channel = connection->FindChannel(connection->sessionId, TRUE);
 	connection->bridging = TRUE;
 	connection->CloseLogicalChannelNumber(channel->GetNumber());
-	
+
 	connection->Unlock();
 	return;
 

Modified: team/pcadach/chan_h323-live/channels/h323/ast_h323.h
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channels/h323/ast_h323.h?rev=43097&r1=43096&r2=43097&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/h323/ast_h323.h (original)
+++ team/pcadach/chan_h323-live/channels/h323/ast_h323.h Sun Sep 17 14:44:15 2006
@@ -33,7 +33,7 @@
 
 #if 0
 /**  These need to be redefined here because the C++
-	 side of this driver is blind to the asterisk headers */	
+     side of this driver is blind to the asterisk headers */
 /*! G.723.1 compression */
 #define AST_FORMAT_G723_1	(1 << 0)
 /*! GSM compression */
@@ -180,7 +180,7 @@
 	BOOL ForwardConnection(H323Connection &, const PString &, const H323SignalPDU &);
 	void SetEndpointTypeInfo( H225_EndpointType & info ) const;
 	void SetGateway(void);
-	PStringArray SupportedPrefixes;	
+	PStringArray SupportedPrefixes;
 };
 
 class MyH323Connection : public H323Connection
@@ -192,7 +192,7 @@
 	~MyH323Connection();
 	H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
 			H323Channel::Directions,
-	 		unsigned,
+			unsigned,
 			const H245_H2250LogicalChannelParameters *,
 			RTP_QOS *);
 	H323Connection::AnswerCallResponse OnAnswerCall(const PString &,
@@ -205,7 +205,7 @@
 	BOOL OnReceivedFacility(const H323SignalPDU &);
 	BOOL OnSendSignalSetup(H323SignalPDU &);
 	BOOL OnStartLogicalChannel(H323Channel &);
-	BOOL OnClosingLogicalChannel(H323Channel &);	
+	BOOL OnClosingLogicalChannel(H323Channel &);
 	virtual void SendUserInputTone(char tone, unsigned duration = 0, unsigned logicalChannel = 0, unsigned rtpTimestamp = 0);
 	virtual void OnUserInputTone(char, unsigned, unsigned, unsigned);
 	virtual void OnUserInputString(const PString &value);

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=43097&r1=43096&r2=43097&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/h323/chan_h323.h (original)
+++ team/pcadach/chan_h323-live/channels/h323/chan_h323.h Sun Sep 17 14:44:15 2006
@@ -4,7 +4,7 @@
  * OpenH323 Channel Driver for ASTERISK PBX.
  *			By Jeremy McNamara
  * 			For The NuFone Network
- *	
+ *
  * This code has been derived from code created by
  *		Michael Manousos and Mark Spencer
  *
@@ -79,7 +79,6 @@
    All peers are registered to a GK if there is one */
 struct oh323_peer {
 	ASTOBJ_COMPONENTS(struct oh323_peer);
-//	char name[80];
 	char mailbox[80];
 	int delme;
 	struct sockaddr_in addr;
@@ -91,20 +90,18 @@
    the H.323 endpoint and gatekeeper */
 struct oh323_alias {
 	ASTOBJ_COMPONENTS(struct oh323_alias);
-//	char name[80];
 	char e164[20];				/* tells a GK to route this E.164 to this alias */
 	char prefix[500];			/* tells a GK this alias supports these prefixes */
 	char secret[20];			/* the H.235 password to send to the GK for authentication */
 	char context[80];
-//	struct oh323_alias *next;	
 };
 
 /** call_details struct call detail records
 	to asterisk for processing and used for matching up
 	asterisk channels to acutal h.323 connections */
-typedef struct call_details {	
+typedef struct call_details {
 	unsigned int call_reference;
-	char *call_token;				
+	char *call_token;
 	char *call_source_aliases;
 	char *call_dest_alias;
 	char *call_source_name;
@@ -210,19 +207,19 @@
 
 	/* callback function handler*/
 	void h323_callback_register(setup_incoming_cb,
-				    setup_outbound_cb,
- 				    on_rtp_cb,
-				    start_rtp_cb,
- 				    clear_con_cb,
- 				    chan_ringing_cb,
-				    con_established_cb,
- 				    receive_digit_cb,
- 				    answer_call_cb,
-				    progress_cb,
-				    rfc2833_cb,
-				    hangup_cb,
-				    setcapabilities_cb,
-				    setpeercapabilities_cb);
+					setup_outbound_cb,
+					on_rtp_cb,
+					start_rtp_cb,
+					clear_con_cb,
+					chan_ringing_cb,
+					con_established_cb,
+					receive_digit_cb,
+					answer_call_cb,
+					progress_cb,
+					rfc2833_cb,
+					hangup_cb,
+					setcapabilities_cb,
+					setpeercapabilities_cb);
 	int h323_set_capabilities(const char *, int, int, struct ast_codec_pref *, int);
 	int h323_set_alias(struct oh323_alias *);
 	int h323_set_gk(int, char *, char *);
@@ -240,12 +237,12 @@
 	/* H323 create and destroy sessions */
 	int h323_make_call(char *dest, call_details_t *cd, call_options_t *);
 	int h323_clear_call(const char *, int cause);
-	
+
 	/* H.323 alerting and progress */
 	int h323_send_alerting(const char *token);
 	int h323_send_progress(const char *token);
 	int h323_answering_call(const char *token, int);
-	int h323_soft_hangup(const char *data);	
+	int h323_soft_hangup(const char *data);
 	int h323_show_codec(int fd, int argc, char *argv[]);
 
 #ifdef __cplusplus

Modified: team/pcadach/chan_h323-live/channels/h323/compat_h323.cpp
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channels/h323/compat_h323.cpp?rev=43097&r1=43096&r2=43097&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/h323/compat_h323.cpp (original)
+++ team/pcadach/chan_h323-live/channels/h323/compat_h323.cpp Sun Sep 17 14:44:15 2006
@@ -125,7 +125,7 @@
 	/* Cleanup/delete thread */
 	thd->WaitForTermination();
 	delete thd;
-	
+
 	return discoverResult;
 }
 



More information about the asterisk-commits mailing list