[asterisk-commits] russell: branch group/issue_11972 r105735 - in /team/group/issue_11972: ./ ch...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 4 14:38:57 CST 2008


Author: russell
Date: Tue Mar  4 14:38:57 2008
New Revision: 105735

URL: http://svn.digium.com/view/asterisk?view=rev&rev=105735
Log:
sync with trunk

Modified:
    team/group/issue_11972/   (props changed)
    team/group/issue_11972/channels/chan_sip.c
    team/group/issue_11972/res/res_phoneprov.c

Propchange: team/group/issue_11972/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Mar  4 14:38:57 2008
@@ -1,1 +1,1 @@
-/trunk:1-105730
+/trunk:1-105734

Modified: team/group/issue_11972/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/issue_11972/channels/chan_sip.c?view=diff&rev=105735&r1=105734&r2=105735
==============================================================================
--- team/group/issue_11972/channels/chan_sip.c (original)
+++ team/group/issue_11972/channels/chan_sip.c Tue Mar  4 14:38:57 2008
@@ -2200,8 +2200,10 @@
 		while (req.len < 4 || strncmp((char *)&req.data + req.len - 4, "\r\n\r\n", 4)) {
 			if (req.socket.lock) 
 				ast_mutex_lock(req.socket.lock);
-			if (!fgets(buf, sizeof(buf), ser->f))
+			if (!fgets(buf, sizeof(buf), ser->f)) {
+				ast_mutex_unlock(req.socket.lock);
 				goto cleanup;
+			}
 			if (req.socket.lock) 
 				ast_mutex_unlock(req.socket.lock);
 			if (me->stop) 
@@ -2237,7 +2239,12 @@
 cleanup2:
 	fclose(ser->f);
 	ast_free(ser);
-	ast_free(req.socket.lock);
+
+	if (req.socket.lock) {
+		ast_mutex_destroy(req.socket.lock);
+		ast_free(req.socket.lock);
+		req.socket.lock = NULL;
+	}
 
 	return NULL;
 }

Modified: team/group/issue_11972/res/res_phoneprov.c
URL: http://svn.digium.com/view/asterisk/team/group/issue_11972/res/res_phoneprov.c?view=diff&rev=105735&r1=105734&r2=105735
==============================================================================
--- team/group/issue_11972/res/res_phoneprov.c (original)
+++ team/group/issue_11972/res/res_phoneprov.c Tue Mar  4 14:38:57 2008
@@ -705,7 +705,13 @@
 	for (i = 0; i < PP_VAR_LIST_LENGTH; i++) {
 		tmp = ast_variable_retrieve(cfg, name, pp_variable_list[i].user_var);
 
-		if (i == PP_TIMEZONE) {
+		/* If we didn't get a USERNAME variable, set it to the user->name */
+		if (i == PP_USERNAME && !tmp) {
+			if ((var = ast_var_assign(pp_variable_list[PP_USERNAME].template_var, user->name))) {
+				AST_LIST_INSERT_TAIL(user->headp, var, entries);
+			}
+			continue;
+		} else if (i == PP_TIMEZONE) {
 			/* perfectly ok if tmp is NULL, will set variables based on server's time zone */
 			set_timezone_variables(user->headp, tmp);
 		}




More information about the asterisk-commits mailing list