[Asterisk-cvs] asterisk/channels chan_h323.c,1.87,1.88

jeremy at lists.digium.com jeremy at lists.digium.com
Thu Nov 11 14:50:37 CST 2004


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

Modified Files:
	chan_h323.c 
Log Message:
copy over username to create a proper called addr

Index: chan_h323.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- chan_h323.c	28 Oct 2004 06:06:58 -0000	1.87
+++ chan_h323.c	11 Nov 2004 19:51:55 -0000	1.88
@@ -433,28 +433,35 @@
  * Returns -1 on error, 0 on success.
  */
 static int oh323_call(struct ast_channel *c, char *dest, int timeout)
-{
-	int res = 0;
-	struct oh323_pvt *pvt = (struct oh323_pvt *)c->pvt->pvt;
-	char called_addr[INET_ADDRSTRLEN];
-
-	if ((c->_state != AST_STATE_DOWN) && (c->_state != AST_STATE_RESERVED)) {
-		ast_log(LOG_WARNING, "Line is already in use (%s)\n", c->name);
-		return -1;
-	}
-	/* Clear and then set the address to call */
-	memset(called_addr, 0, sizeof(called_addr));
-	if (usingGk) {
-		memcpy(called_addr, dest, strlen(called_addr));
-		pvt->options.noFastStart = noFastStart;
-		pvt->options.noH245Tunneling = noH245Tunneling;
-		pvt->options.noSilenceSuppression = noSilenceSuppression;
-		pvt->options.port = h323_signalling_port;
-	} else {
-		ast_inet_ntoa(called_addr, sizeof(called_addr), pvt->sa.sin_addr);
-		pvt->options.port = htons(pvt->sa.sin_port);
+{  
+        int res = 0;
+        struct oh323_pvt *pvt = (struct oh323_pvt *)c->pvt->pvt;
+        char addr[INET_ADDRSTRLEN];
+        char called_addr[INET_ADDRSTRLEN];
+  
+        ast_log(LOG_DEBUG, "Dest is %s\n", dest);
+        
+        if ((c->_state != AST_STATE_DOWN) && (c->_state != AST_STATE_RESERVED)) {
+                ast_log(LOG_WARNING, "Line is already in use (%s)\n", c->name);
+                return -1;
+        }
+        /* Clear and then set the address to call */
+        memset(addr, 0, sizeof(addr));
+        if (usingGk) {
+                memcpy(addr, dest, strlen(addr));
+                pvt->options.noFastStart = noFastStart;
+                pvt->options.noH245Tunneling = noH245Tunneling;
+                pvt->options.noSilenceSuppression = noSilenceSuppression;
+                pvt->options.port = h323_signalling_port;
+        } else {
+                ast_inet_ntoa(addr, sizeof(addr), pvt->sa.sin_addr);
+                pvt->options.port = htons(pvt->sa.sin_port);
+        }
+	if (pvt->username) {
+	        sprintf(called_addr, "%s:%s", pvt->username, addr);
+        } else {
+		memcpy(called_addr, addr, strlen(called_addr));
 	}
-	/* indicate that this is an outgoing call */
 	pvt->outgoing = 1;
 	ast_log(LOG_DEBUG, "Placing outgoing call to %s:%d\n", called_addr, pvt->options.port);
 	res = h323_make_call(called_addr, &(pvt->cd), pvt->options);




More information about the svn-commits mailing list