[Asterisk-cvs] asterisk/channels/h323 ast_h323.cpp, 1.60, 1.61 chan_h323.h, 1.28, 1.29

jeremy at lists.digium.com jeremy at lists.digium.com
Mon Oct 4 06:16:27 CDT 2004


Update of /usr/cvsroot/asterisk/channels/h323
In directory mongoose.digium.com:/tmp/cvs-serv28407/h323

Modified Files:
	ast_h323.cpp chan_h323.h 
Log Message:
a major rework - type=peer support, code cleanup, and optimization. Still not ready to use

Index: ast_h323.cpp
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/ast_h323.cpp,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- ast_h323.cpp	30 Sep 2004 19:30:49 -0000	1.60
+++ ast_h323.cpp	4 Oct 2004 10:18:06 -0000	1.61
@@ -262,8 +262,9 @@
 	if (callername) {
                 localAliasNames.RemoveAll();
 		connection->SetLocalPartyName(PString(callername));
-	        if (callerid)
-                  localAliasNames.AppendString(PString(callerid));
+	        if (callerid) {
+                	localAliasNames.AppendString(PString(callerid));
+		}
         } else if (callerid) {
                 localAliasNames.RemoveAll();
                 connection->SetLocalPartyName(PString(callerid));
@@ -469,20 +470,28 @@
 }
 
 
-H323Connection * MyH323EndPoint::CreateConnection(unsigned callReference, void *outbound)
+H323Connection * MyH323EndPoint::CreateConnection(unsigned callReference, void *o)
 {
 	unsigned options = 0;
+	call_options_t *opts = (call_options_t *)o;
 
-	if (noFastStart)
+	if (opts->noFastStart) {
 		options |= H323Connection::FastStartOptionDisable;
-	else
+	} else {
 		options |= H323Connection::FastStartOptionEnable;
-
-	if (noH245Tunneling)
+	}
+	if (opts->noH245Tunneling) {
 		options |= H323Connection::H245TunnelingOptionDisable;
-	else
+	} else {
 		options |= H323Connection::H245TunnelingOptionEnable;
-
+	}
+#if 0
+	if (opts->noSilenceSuppression) {
+		options |= H323Connection::SilenceSuppresionOptionDisable;
+	} else {
+		options |= H323Connection::SilenceSUppressionOptionEnable;
+	}
+#endif
 	return new MyH323Connection(*this, callReference, options);
 }
 
@@ -515,9 +524,9 @@
        if (h323debug)
                cout << "\t=-= In OnAnswerCall for call " << GetCallReference() << endl;
 	
-	if (!on_answer_call(GetCallReference(), (const char *)GetCallToken()))
+	if (!on_answer_call(GetCallReference(), (const char *)GetCallToken())) {
 		return H323Connection::AnswerCallDenied;
-
+	}
 	/* The call will be answered later with "AnsweringCall()" function.
 	 */ 
 	return H323Connection::AnswerCallDeferred;
@@ -716,7 +725,7 @@
 	if (h323debug) {
 		cout << "	-- Sending user input tone (" << tone << ") to remote" << endl;
 	}
-	on_send_digit(GetCallReference(), tone);	
+	on_send_digit(GetCallReference(), tone, (const char *)GetCallToken());	
 	H323Connection::SendUserInputTone(tone, duration);
 }
 
@@ -726,7 +735,7 @@
 		if (h323debug) {
 			cout << "	-- Received user input tone (" << tone << ") from remote" << endl;
 		}
-		on_send_digit(GetCallReference(), tone);
+		on_send_digit(GetCallReference(), tone, (const char *)GetCallToken());
 	}
 	H323Connection::OnUserInputTone(tone, duration, logicalChannel, rtpTimestamp);
 }
@@ -737,7 +746,7 @@
 		if (h323debug) {
 			cout <<  "	-- Received user input string (" << value << ") from remote." << endl;
 		}
-		on_send_digit(GetCallReference(), value[0]);
+		on_send_digit(GetCallReference(), value[0], (const char *)GetCallToken());
 	}	
 }
 
@@ -901,13 +910,9 @@
 	return 1;
 }
     
-void h323_end_point_create(int no_fast_start, int no_h245_tunneling)
+void h323_end_point_create(void)
 {
 	channelsOpen = 0;
-	
-	noFastStart = (BOOL)no_fast_start;
-	noH245Tunneling = (BOOL)no_h245_tunneling;
-
 	localProcess = new MyProcess();	
 	localProcess->Main();
 }
@@ -968,7 +973,7 @@
 	H323Capabilities oldcaps;
 	PStringArray codecs;
 	int g711Frames = 30;
-	int gsmFrames  = 4;
+//	int gsmFrames  = 4;
 
 	if (!h323_end_point_exist()) {
 		cout << " ERROR: [h323_set_capablity] No Endpoint, this is bad" << endl;
@@ -1320,12 +1325,5 @@
 
 }
 
-/* set defalt h323 options */
-void h323_set_options(int nofs, int noh245tun) {
-       noFastStart = nofs;
-       noH245Tunneling = noh245tun;
-       return;
-}
-
 } /* extern "C" */
 

Index: chan_h323.h
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/chan_h323.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- chan_h323.h	30 Sep 2004 19:30:49 -0000	1.28
+++ chan_h323.h	4 Oct 2004 10:18:06 -0000	1.29
@@ -56,7 +56,7 @@
    All peers are registered to a GK if there is one */
 struct oh323_peer {
 	char name[80];
-	char mailbox[AST_MAX_EXTENSION];
+	char mailbox[80];
 	int capability;
 	int noFastStart;
 	int noH245Tunneling;
@@ -83,9 +83,8 @@
 	struct oh323_alias *next;	
 };
 
-/** call_option struct is filled from the 
-	PBX application and passed through make_call 
-	function*/
+/** call_option struct holds various bits 
+	of information for each call */
 typedef struct call_options {
 	char		*callerid;
 	char		*callername;
@@ -168,7 +167,7 @@
 #endif   
     
 	void h323_gk_urq(void);
-	void h323_end_point_create(int, int);
+	void h323_end_point_create(void);
 	void h323_end_process(void);
 	int  h323_end_point_exist(void);
     
@@ -204,7 +203,6 @@
 	/* H323 create and destroy sessions */
 	int h323_make_call(char *host, call_details_t *cd, call_options_t);
 	int h323_clear_call(const char *);
-	void h323_set_options(int nofs, int noh245tun);	
 	
 	/* H.323 alerting and progress */
 	int h323_send_alerting(const char *token);




More information about the svn-commits mailing list