[asterisk-commits] qwell: branch qwell/gtalk_jingle-merge r56004 - in /team/qwell/gtalk_jingle-m...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Feb 21 14:41:06 MST 2007


Author: qwell
Date: Wed Feb 21 15:41:05 2007
New Revision: 56004

URL: http://svn.digium.com/view/asterisk?view=rev&rev=56004
Log:
Merged revisions 55495,55514,55534,55554,55556,55591,55635,55671,55697,55716,55718,55748,55762-55763,55805,55835,55870,55915,55948,55950,55952-55953,55955,55958 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r55495 | qwell | 2007-02-19 17:27:09 -0600 (Mon, 19 Feb 2007) | 2 lines

We need to bump the cleancount when we make API changes...

................
r55514 | oej | 2007-02-20 01:48:12 -0600 (Tue, 20 Feb 2007) | 11 lines

Merged revisions 55483 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55483 | oej | 2007-02-19 22:12:55 +0100 (Mon, 19 Feb 2007) | 3 lines

- Not sending arguments to an application is not "out of memory"
- Making error messages a bit more clear

........

................
r55534 | file | 2007-02-20 09:19:23 -0600 (Tue, 20 Feb 2007) | 2 lines

I like it when trunk builds, so let's make res_jabber compile again!

................
r55554 | russell | 2007-02-20 10:42:33 -0600 (Tue, 20 Feb 2007) | 11 lines

Merged revisions 55553 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55553 | russell | 2007-02-20 10:41:57 -0600 (Tue, 20 Feb 2007) | 3 lines

Change the formatting of sla.conf.sample to make it more readable.  
(issue #9112, blitzrage)

........

................
r55556 | qwell | 2007-02-20 10:56:58 -0600 (Tue, 20 Feb 2007) | 12 lines

Merged revisions 55555 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55555 | qwell | 2007-02-20 10:53:45 -0600 (Tue, 20 Feb 2007) | 4 lines

No need to cast nor free with strdupa (thanks file)

55555!

........

................
r55591 | russell | 2007-02-20 13:58:07 -0600 (Tue, 20 Feb 2007) | 10 lines

Merged revisions 55590 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55590 | russell | 2007-02-20 13:57:07 -0600 (Tue, 20 Feb 2007) | 2 lines

Increase the maximum number of manager headers to 128, at the request of Pari.

........

................
r55635 | russell | 2007-02-20 14:32:13 -0600 (Tue, 20 Feb 2007) | 11 lines

Merged revisions 55634 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55634 | russell | 2007-02-20 14:26:06 -0600 (Tue, 20 Feb 2007) | 3 lines

Add the Asterisk version information to the Server header in HTTP
responses.  (requested by Pari)

........

................
r55671 | file | 2007-02-20 16:49:53 -0600 (Tue, 20 Feb 2007) | 18 lines

Merged revisions 55670 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r55670 | file | 2007-02-20 17:47:00 -0500 (Tue, 20 Feb 2007) | 10 lines

Merged revisions 55669 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r55669 | file | 2007-02-20 17:39:14 -0500 (Tue, 20 Feb 2007) | 2 lines

Defer clearing callback information if channels are up until they are hung up. This ensures the hangup process goes smoothly and no channels get hung in limbo. (issue #8088 reported by kebl0155)

........

................

................
r55697 | file | 2007-02-20 17:12:55 -0600 (Tue, 20 Feb 2007) | 10 lines

Merged revisions 55688 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55688 | file | 2007-02-20 18:08:45 -0500 (Tue, 20 Feb 2007) | 2 lines

Don't test our own address against the localnet settings. At least one person has had issues as a result of this from #7051 so I'm reversing it. (issue #8821 reported by kokoskarokoska)

........

................
r55716 | file | 2007-02-20 17:26:00 -0600 (Tue, 20 Feb 2007) | 2 lines

Flush out the file pointer. (issue #9115 reported by guthrie)

................
r55718 | file | 2007-02-20 18:00:11 -0600 (Tue, 20 Feb 2007) | 10 lines

Merged revisions 55717 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55717 | file | 2007-02-20 18:57:03 -0500 (Tue, 20 Feb 2007) | 2 lines

Return behavior I removed. I did not remember that you could just add a localnet entry to make it work.

........

................
r55748 | file | 2007-02-20 18:14:07 -0600 (Tue, 20 Feb 2007) | 10 lines

Merged revisions 55741 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55741 | file | 2007-02-20 19:11:20 -0500 (Tue, 20 Feb 2007) | 2 lines

Better handle dropped IMAP connections. (issue #9054 reported by bsmithurst)

........

................
r55762 | russell | 2007-02-20 19:05:00 -0600 (Tue, 20 Feb 2007) | 12 lines

Merged revisions 55758 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55758 | russell | 2007-02-20 19:03:25 -0600 (Tue, 20 Feb 2007) | 4 lines

Improve the reference counting to fix bugs where people report seeing
conferences listed that have no members.
(issue #9073)

........

................
r55763 | file | 2007-02-20 19:05:26 -0600 (Tue, 20 Feb 2007) | 2 lines

Return trunk to a state where it compiles under Darwin. The byte order stuff is ugly, if anyone wants to clean it up... by all means do so.

................
r55805 | qwell | 2007-02-20 20:04:10 -0600 (Tue, 20 Feb 2007) | 12 lines

Merged revisions 55799 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55799 | qwell | 2007-02-20 20:01:36 -0600 (Tue, 20 Feb 2007) | 4 lines

Fix segfault when buddy couldn't be found.

Issue 7764, patch by sailer

........

................
r55835 | oej | 2007-02-21 02:39:15 -0600 (Wed, 21 Feb 2007) | 10 lines

Merged revisions 55834 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55834 | oej | 2007-02-21 09:32:34 +0100 (Wed, 21 Feb 2007) | 2 lines

Issue #8848 - Turn off lamp more quickly after transfer (decrement inuse early on transferer's call leg)

........

................
r55870 | kpfleming | 2007-02-21 08:07:43 -0600 (Wed, 21 Feb 2007) | 18 lines

Merged revisions 55869 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r55869 | kpfleming | 2007-02-21 08:06:47 -0600 (Wed, 21 Feb 2007) | 10 lines

Merged revisions 55868 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r55868 | kpfleming | 2007-02-21 08:03:11 -0600 (Wed, 21 Feb 2007) | 2 lines

use new tag version script

........

................

................
r55915 | file | 2007-02-21 11:23:42 -0600 (Wed, 21 Feb 2007) | 10 lines

Merged revisions 55914 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55914 | file | 2007-02-21 12:18:19 -0500 (Wed, 21 Feb 2007) | 2 lines

Add a flag that indicates whether a SIP dialog is an outgoing call or not. SIP_OUTGOING originally did it but it was repurposed to the direction of the last transaction, which can cause update_call_counter to falsely decrease the wrong counters. (please don't hurt me oej) (issue #8943 reported by mdu113)

........

................
r55948 | file | 2007-02-21 14:05:15 -0600 (Wed, 21 Feb 2007) | 10 lines

Merged revisions 55947 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55947 | file | 2007-02-21 15:03:38 -0500 (Wed, 21 Feb 2007) | 2 lines

Only start playing the next file if we have not been quieted.

........

................
r55950 | file | 2007-02-21 14:18:16 -0600 (Wed, 21 Feb 2007) | 10 lines

Merged revisions 55949 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55949 | file | 2007-02-21 15:16:34 -0500 (Wed, 21 Feb 2007) | 2 lines

Only dispose of the conference if one was created.

........

................
r55952 | russell | 2007-02-21 14:23:03 -0600 (Wed, 21 Feb 2007) | 11 lines

Merged revisions 55951 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55951 | russell | 2007-02-21 14:22:33 -0600 (Wed, 21 Feb 2007) | 3 lines

Simplify the last change to app_meetme, and move the call to dispose_conf()
up into the block where we know a conf exists.

........

................
r55953 | file | 2007-02-21 14:26:43 -0600 (Wed, 21 Feb 2007) | 2 lines

Clarify in the doxygen docs abou RFC2833 compensation flag.

................
r55955 | qwell | 2007-02-21 14:30:54 -0600 (Wed, 21 Feb 2007) | 12 lines

Merged revisions 55954 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55954 | qwell | 2007-02-21 14:27:08 -0600 (Wed, 21 Feb 2007) | 4 lines

Fix locking issue, and accept "transport-accept" as a valid accept message.

This should solve issues 8970 and 8503.

........

................
r55958 | file | 2007-02-21 14:41:53 -0600 (Wed, 21 Feb 2007) | 18 lines

Merged revisions 55957 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r55957 | file | 2007-02-21 15:35:40 -0500 (Wed, 21 Feb 2007) | 10 lines

Merged revisions 55956 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r55956 | file | 2007-02-21 15:32:16 -0500 (Wed, 21 Feb 2007) | 2 lines

Change naughty warning message to provide useful information. If a write now fails on a channel in meetme it will tell you the channel name instead of spitting out the wrong error message.

........

................

................

Modified:
    team/qwell/gtalk_jingle-merge/   (props changed)
    team/qwell/gtalk_jingle-merge/.cleancount
    team/qwell/gtalk_jingle-merge/apps/app_meetme.c
    team/qwell/gtalk_jingle-merge/apps/app_speech_utils.c
    team/qwell/gtalk_jingle-merge/apps/app_voicemail.c
    team/qwell/gtalk_jingle-merge/build_tools/make_version
    team/qwell/gtalk_jingle-merge/channels/chan_agent.c
    team/qwell/gtalk_jingle-merge/channels/chan_gtalk.c
    team/qwell/gtalk_jingle-merge/channels/chan_jingle.c
    team/qwell/gtalk_jingle-merge/channels/chan_sip.c
    team/qwell/gtalk_jingle-merge/configs/sla.conf.sample
    team/qwell/gtalk_jingle-merge/include/asterisk/manager.h
    team/qwell/gtalk_jingle-merge/main/dns.c
    team/qwell/gtalk_jingle-merge/main/http.c
    team/qwell/gtalk_jingle-merge/main/logger.c
    team/qwell/gtalk_jingle-merge/res/res_jabber.c

Propchange: team/qwell/gtalk_jingle-merge/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/qwell/gtalk_jingle-merge/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Feb 21 15:41:05 2007
@@ -1,1 +1,1 @@
-/trunk:1-55478
+/trunk:1-56003

Modified: team/qwell/gtalk_jingle-merge/.cleancount
URL: http://svn.digium.com/view/asterisk/team/qwell/gtalk_jingle-merge/.cleancount?view=diff&rev=56004&r1=56003&r2=56004
==============================================================================
--- team/qwell/gtalk_jingle-merge/.cleancount (original)
+++ team/qwell/gtalk_jingle-merge/.cleancount Wed Feb 21 15:41:05 2007
@@ -1,1 +1,1 @@
-28
+29

Modified: team/qwell/gtalk_jingle-merge/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/qwell/gtalk_jingle-merge/apps/app_meetme.c?view=diff&rev=56004&r1=56003&r2=56004
==============================================================================
--- team/qwell/gtalk_jingle-merge/apps/app_meetme.c (original)
+++ team/qwell/gtalk_jingle-merge/apps/app_meetme.c Wed Feb 21 15:41:05 2007
@@ -634,7 +634,7 @@
 static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin, int make, int dynamic, int refcount)
 {
 	struct ast_conference *cnf;
-	struct zt_confinfo ztc;
+	struct zt_confinfo ztc = { 0, };
 
 	AST_LIST_LOCK(&confs);
 
@@ -655,8 +655,6 @@
 	ast_copy_string(cnf->confno, confno, sizeof(cnf->confno));
 	ast_copy_string(cnf->pin, pin, sizeof(cnf->pin));
 	ast_copy_string(cnf->pinadmin, pinadmin, sizeof(cnf->pinadmin));
-	cnf->refcount = 0;
-	cnf->markedusers = 0;
 	cnf->chan = ast_request("zap", AST_FORMAT_SLINEAR, "pseudo", NULL);
 	if (cnf->chan) {
 		ast_set_read_format(cnf->chan, AST_FORMAT_SLINEAR);
@@ -672,9 +670,8 @@
 			goto cnfout;
 		}
 	}
-	memset(&ztc, 0, sizeof(ztc));
+	
 	/* Setup a new zap conference */
-	ztc.chan = 0;
 	ztc.confno = -1;
 	ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
 	if (ioctl(cnf->fd, ZT_SETCONF, &ztc)) {
@@ -709,7 +706,7 @@
 	
 cnfout:
 	if (cnf)
-		cnf->refcount += refcount;
+		ast_atomic_fetchadd_int(&cnf->refcount, refcount);
 
 	AST_LIST_UNLOCK(&confs);
 
@@ -1060,6 +1057,7 @@
 		conf->recording = MEETME_RECORD_TERMINATE;
 		AST_LIST_UNLOCK(&confs);
 		while (1) {
+			usleep(1);
 			AST_LIST_LOCK(&confs);
 			if (conf->recording == MEETME_RECORD_OFF)
 				break;
@@ -1145,6 +1143,22 @@
 	ast_cond_signal(&sla.cond);
 	ast_mutex_unlock(&sla.lock);
 }
+
+/* Decrement reference counts, as incremented by find_conf() */
+static int dispose_conf(struct ast_conference *conf)
+{
+	int res = 0;
+
+	AST_LIST_LOCK(&confs);
+	if (ast_atomic_dec_and_test(&conf->refcount)) {
+		conf_free(conf);
+		res = 1;
+	}
+	AST_LIST_UNLOCK(&confs);
+
+	return res;
+}
+
 
 static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int confflags, char *optargs[])
 {
@@ -1188,15 +1202,8 @@
 	char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
 	char *buf = __buf + AST_FRIENDLY_OFFSET;
 
-	if (!(user = ast_calloc(1, sizeof(*user)))) {
-		AST_LIST_LOCK(&confs);
-		conf->refcount--;
-		if (!conf->refcount){
-			conf_free(conf);
-		}
-		AST_LIST_UNLOCK(&confs);
+	if (!(user = ast_calloc(1, sizeof(*user))))
 		return ret;
-	}
 
 	/* Possible timeout waiting for marked user */
 	if ((confflags & CONFFLAG_WAITMARKED) &&
@@ -1980,7 +1987,7 @@
 						if (conf->transframe[index]) {
  							if (conf->transframe[index]->frametype != AST_FRAME_NULL) {
 	 							if (ast_write(chan, conf->transframe[index]))
-									ast_log(LOG_WARNING, "Unable to write frame to channel: %s\n", strerror(errno));
+									ast_log(LOG_WARNING, "Unable to write frame to channel %s\n", chan->name);
 							}
 						} else {
 							ast_mutex_unlock(&conf->listenlock);
@@ -1992,7 +1999,7 @@
 						if (user->listen.actual)
 							ast_frame_adjust_volume(&fr, user->listen.actual);
 						if (ast_write(chan, &fr) < 0) {
-							ast_log(LOG_WARNING, "Unable to write frame to channel: %s\n", strerror(errno));
+							ast_log(LOG_WARNING, "Unable to write frame to channel %s\n", chan->name);
 						}
 					}
 				} else 
@@ -2065,7 +2072,6 @@
 		}
 
 		conf->users--;
-		conf->refcount--;
 		/* Update table */
 		snprintf(members, sizeof(members), "%d", conf->users);
 		ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
@@ -2077,12 +2083,7 @@
 		/* Change any states */
 		if (!conf->users)
 			ast_device_state_changed("meetme:%s", conf->confno);
-
-		if (AST_LIST_EMPTY(&conf->userlist)) {
-			/* close this one when no more users and no references*/
-			if (!conf->refcount)
-				conf_free(conf);
-		}
+		
 		/* Return the number of seconds the user was in the conf */
 		snprintf(meetmesecs, sizeof(meetmesecs), "%d", (int) (time(NULL) - user->jointime));
 		pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
@@ -2272,11 +2273,13 @@
 
 	AST_STANDARD_APP_ARGS(args, localdata);
 	
-	conf = find_conf(chan, args.confno, 0, 0, NULL, 0, 0, NULL);
-
-	if (conf)
+	conf = find_conf(chan, args.confno, 0, 0, NULL, 0, 1, NULL);
+
+	if (conf) {
 		count = conf->users;
-	else
+		dispose_conf(conf);
+		conf = NULL;
+	} else
 		count = 0;
 
 	if (!ast_strlen_zero(args.varname)){
@@ -2301,7 +2304,7 @@
 	char confno[MAX_CONFNUM] = "";
 	int allowretry = 0;
 	int retrycnt = 0;
-	struct ast_conference *cnf;
+	struct ast_conference *cnf = NULL;
 	struct ast_flags confflags = {0};
 	int dynamic = 0;
 	int empty = 0, empty_no_pin = 0;
@@ -2514,15 +2517,8 @@
 									ast_log(LOG_WARNING, "Couldn't play invalid pin msg!\n");
 									break;
 								}
-								if (res < 0) {
-									AST_LIST_LOCK(&confs);
-									cnf->refcount--;
-									if (!cnf->refcount){
-										conf_free(cnf);
-									}
-									AST_LIST_UNLOCK(&confs);
+								if (res < 0)
 									break;
-								}
 								pin[0] = res;
 								pin[1] = '\0';
 								res = -1;
@@ -2534,12 +2530,6 @@
 							res = -1;
 							allowretry = 0;
 							/* see if we need to get rid of the conference */
-							AST_LIST_LOCK(&confs);
-							cnf->refcount--;
-							if (!cnf->refcount) {
-								conf_free(cnf);
-							}
-							AST_LIST_UNLOCK(&confs);
 							break;
 						}
 
@@ -2555,10 +2545,15 @@
 					/* Run the conference */
 					res = conf_run(chan, cnf, confflags.flags, optargs);
 				}
+				dispose_conf(cnf);
+				cnf = NULL;
 			}
 		}
 	} while (allowretry);
-	
+
+	if (cnf)
+		dispose_conf(cnf);
+
 	ast_module_user_remove(u);
 	
 	return res;
@@ -2621,6 +2616,8 @@
 		ast_module_user_remove(u);
 		return 0;
 	}
+
+	ast_atomic_fetchadd_int(&cnf->refcount, 1);
 
 	if (args.user)
 		user = find_user(cnf, args.user);
@@ -2725,6 +2722,8 @@
 
 	AST_LIST_UNLOCK(&confs);
 
+	dispose_conf(cnf);
+
 	ast_module_user_remove(u);
 	
 	return 0;
@@ -3018,8 +3017,11 @@
 		CONFFLAG_QUIET | CONFFLAG_MARKEDEXIT | CONFFLAG_PASS_DTMF | CONFFLAG_SLA_STATION);
 	ast_answer(trunk_ref->chan);
 	conf = build_conf(conf_name, "", "", 0, 0, 1);
-	if (conf)
+	if (conf) {
 		conf_run(trunk_ref->chan, conf, conf_flags.flags, NULL);
+		dispose_conf(conf);
+		conf = NULL;
+	}
 	trunk_ref->chan = NULL;
 	if (ast_atomic_dec_and_test((int *) &trunk_ref->trunk->active_stations)) {
 		strncat(conf_name, "|K", sizeof(conf_name) - strlen(conf_name) - 1);
@@ -3334,8 +3336,11 @@
 	ast_cond_signal(args->cond);
 	ast_mutex_unlock(args->cond_lock);
 
-	if (conf)
+	if (conf) {
 		conf_run(trunk->chan, conf, conf_flags.flags, NULL);
+		dispose_conf(conf);
+		conf = NULL;
+	}
 
 	trunk->chan = NULL;
 
@@ -3440,8 +3445,11 @@
 	trunk_ref->chan = chan;
 	ast_answer(chan);
 	conf = build_conf(conf_name, "", "", 0, 0, 1);
-	if (conf)
+	if (conf) {
 		conf_run(chan, conf, conf_flags.flags, NULL);
+		dispose_conf(conf);
+		conf = NULL;
+	}
 	trunk_ref->chan = NULL;
 	res = ast_atomic_fetchadd_int((int *) &trunk_ref->trunk->active_stations, -1);
 	if (res == 1) {	
@@ -3517,6 +3525,8 @@
 		CONFFLAG_QUIET | CONFFLAG_MARKEDEXIT | CONFFLAG_MARKEDUSER | CONFFLAG_PASS_DTMF);
 	ast_indicate(chan, AST_CONTROL_RINGING);
 	conf_run(chan, conf, conf_flags.flags, NULL);
+	dispose_conf(conf);
+	conf = NULL;
 	trunk->chan = NULL;
 
 	pbx_builtin_setvar_helper(chan, "SLATRUNK_STATUS", "SUCCESS");

Modified: team/qwell/gtalk_jingle-merge/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/team/qwell/gtalk_jingle-merge/apps/app_speech_utils.c?view=diff&rev=56004&r1=56003&r2=56004
==============================================================================
--- team/qwell/gtalk_jingle-merge/apps/app_speech_utils.c (original)
+++ team/qwell/gtalk_jingle-merge/apps/app_speech_utils.c Wed Feb 21 15:41:05 2007
@@ -560,7 +560,7 @@
         /* Okay it's streaming so go into a loop grabbing frames! */
         while (done == 0) {
 		/* If the filename is null and stream is not running, start up a new sound file */
-		if ((chan->streamid == -1 && chan->timingfunc == NULL) && (filename = strsep(&filename_tmp, "&"))) {
+		if (!quieted && (chan->streamid == -1 && chan->timingfunc == NULL) && (filename = strsep(&filename_tmp, "&"))) {
 			/* Discard old stream information */
 			ast_stopstream(chan);
 			/* Start new stream */

Modified: team/qwell/gtalk_jingle-merge/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/qwell/gtalk_jingle-merge/apps/app_voicemail.c?view=diff&rev=56004&r1=56003&r2=56004
==============================================================================
--- team/qwell/gtalk_jingle-merge/apps/app_voicemail.c (original)
+++ team/qwell/gtalk_jingle-merge/apps/app_voicemail.c Wed Feb 21 15:41:05 2007
@@ -2468,6 +2468,7 @@
 	fread(buf, len, 1, p);
 	((char *)buf)[len] = '\0';
 	INIT(&str, mail_string, buf, len);
+	init_mailstream(vms, 0);
 	imap_mailbox_name(mailbox, vms, 0, 1);
 	if(!mail_append(vms->mailstream, mailbox, &str))
 		ast_log(LOG_ERROR, "Error while sending the message to %s\n", mailbox);
@@ -2578,12 +2579,10 @@
  	}
 
 	/* If no mailstream exists yet and even after attempting to initialize it fails, bail out */
- 	if (!vms_p->mailstream) {
- 		ret = init_mailstream(vms_p, 0);
-		if (!vms_p->mailstream) {
-			ast_log (LOG_ERROR,"Houston we have a problem - IMAP mailstream is NULL\n");
-			return -1;
-		}
+	ret = init_mailstream(vms_p, 0);
+	if (!vms_p->mailstream) {
+		ast_log (LOG_ERROR,"Houston we have a problem - IMAP mailstream is NULL\n");
+		return -1;
 	}
 
 	if (!ret && vms_p->updated == 1) {

Modified: team/qwell/gtalk_jingle-merge/build_tools/make_version
URL: http://svn.digium.com/view/asterisk/team/qwell/gtalk_jingle-merge/build_tools/make_version?view=diff&rev=56004&r1=56003&r2=56004
==============================================================================
--- team/qwell/gtalk_jingle-merge/build_tools/make_version (original)
+++ team/qwell/gtalk_jingle-merge/build_tools/make_version Wed Feb 21 15:41:05 2007
@@ -2,12 +2,11 @@
 
 if [ -f ${1}/.version ]; then
 	cat ${1}/.version
-elif [ -f ${1}/.svnrevision ]; then
-	echo SVN-`cat ${1}/.svnbranch`-r`cat ${1}/.svnrevision`
 elif [ -d .svn ]; then
     PARTS=`LANG=C svn info ${1} | grep URL | awk '{print $2;}' | sed -e 's:^.*/svn/asterisk/::' | sed -e 's:/: :g'`
     BRANCH=0
     TEAM=0
+    TAG=0
     
     REV=`svnversion -c ${1} | cut -d: -f2`
     
@@ -19,6 +18,12 @@
     
     for PART in $PARTS
       do
+      if [ ${TAG} != 0 ]
+	  then
+	  RESULT="${PART}"
+	  break
+      fi
+      
       if [ ${BRANCH} != 0 ]
 	  then
 	  RESULT="${RESULT}-${PART}"
@@ -40,8 +45,7 @@
       
       if [ "${PART}" = "tags" ]
 	  then
-	  BRANCH=1
-	  RESULT="tag"
+	  TAG=1
 	  continue
       fi
       
@@ -52,5 +56,10 @@
       fi
     done
     
-    echo SVN-${RESULT##-}-r${REV}
+    if [ ${TAG} != 0 ]
+	then
+	echo ${RESULT}
+	else
+	echo SVN-${RESULT##-}-r${REV}
+    fi
 fi

Modified: team/qwell/gtalk_jingle-merge/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/qwell/gtalk_jingle-merge/channels/chan_agent.c?view=diff&rev=56004&r1=56003&r2=56004
==============================================================================
--- team/qwell/gtalk_jingle-merge/channels/chan_agent.c (original)
+++ team/qwell/gtalk_jingle-merge/channels/chan_agent.c Wed Feb 21 15:41:05 2007
@@ -169,6 +169,7 @@
 	int abouttograb;               /*!< About to grab */
 	int autologoff;                /*!< Auto timeout time */
 	int ackcall;                   /*!< ackcall */
+	int deferlogoff;               /*!< Defer logoff to hangup */
 	time_t loginstart;             /*!< When agent first logged in (0 when logged off) */
 	time_t start;                  /*!< When call started */
 	struct timeval lastdisc;       /*!< When last disconnected */
@@ -765,10 +766,12 @@
 			}
 			if (option_debug)
 				ast_log(LOG_DEBUG, "Hungup, howlong is %d, autologoff is %d\n", howlong, p->autologoff);
-			if (howlong  && p->autologoff && (howlong > p->autologoff)) {
+			if ((p->deferlogoff) || (howlong && p->autologoff && (howlong > p->autologoff))) {
 				long logintime = time(NULL) - p->loginstart;
 				p->loginstart = 0;
-				ast_log(LOG_NOTICE, "Agent '%s' didn't answer/confirm within %d seconds (waited %d)\n", p->name, p->autologoff, howlong);
+				if (!p->deferlogoff)
+					ast_log(LOG_NOTICE, "Agent '%s' didn't answer/confirm within %d seconds (waited %d)\n", p->name, p->autologoff, howlong);
+				p->deferlogoff = 0;
 				agent_logoff_maintenance(p, p->loginchan, logintime, ast->uniqueid, "Autologoff");
 			}
 		} else if (p->dead) {
@@ -1507,16 +1510,20 @@
 
 	AST_LIST_TRAVERSE(&agents, p, list) {
 		if (!strcasecmp(p->agent, agent)) {
-			if (!soft) {
-				if (p->owner)
-					ast_softhangup(p->owner, AST_SOFTHANGUP_EXPLICIT);
-				if (p->chan) 
-					ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
+			ret = 0;
+			if (p->owner || p->chan) {
+				p->deferlogoff = 1;
+				if (!soft) {
+					if (p->owner)
+						ast_softhangup(p->owner, AST_SOFTHANGUP_EXPLICIT);
+					if (p->chan)
+						ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
+				}
+			} else {
+				logintime = time(NULL) - p->loginstart;
+				p->loginstart = 0;
+				agent_logoff_maintenance(p, p->loginchan, logintime, NULL, "CommandLogoff");
 			}
-			ret = 0; /* found an agent => return 0 */
-			logintime = time(NULL) - p->loginstart;
-			p->loginstart = 0;
-			agent_logoff_maintenance(p, p->loginchan, logintime, NULL, "CommandLogoff");
 			break;
 		}
 	}

Modified: team/qwell/gtalk_jingle-merge/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/team/qwell/gtalk_jingle-merge/channels/chan_gtalk.c?view=diff&rev=56004&r1=56003&r2=56004
==============================================================================
--- team/qwell/gtalk_jingle-merge/channels/chan_gtalk.c (original)
+++ team/qwell/gtalk_jingle-merge/channels/chan_gtalk.c Wed Feb 21 15:41:05 2007
@@ -257,11 +257,11 @@
 {
 	struct gtalk *gtalk = NULL;
 	char *domain = NULL , *s = NULL;
+
 	if(strchr(connection, '@')) {
-		s = ast_strdupa((char *) connection);
+		s = ast_strdupa(connection);
 		domain = strsep(&s, "@");
 		ast_verbose("OOOOH domain = %s\n", domain);
-		free(s);
 	}
 	gtalk = ASTOBJ_CONTAINER_FIND(&gtalk_list, name);
 	if (!gtalk && strchr(name, '@'))
@@ -269,20 +269,20 @@
 
 	if (!gtalk) {				/* guest call */
 		ASTOBJ_CONTAINER_TRAVERSE(&gtalk_list, 1, {
-			ASTOBJ_WRLOCK(iterator);
+			ASTOBJ_RDLOCK(iterator);
 			if (!strcasecmp(iterator->name, "guest")) {
 				if (!strcasecmp(iterator->connection->jid->partial, connection)) {
 					gtalk = iterator;
-					break;
 				} else if (!strcasecmp(iterator->connection->name, connection)) {
 					gtalk = iterator;
-					break;
 				} else if (iterator->connection->component && !strcasecmp(iterator->connection->user,domain)) {
 					gtalk = iterator;
-					break;
 				}
 			}
 			ASTOBJ_UNLOCK(iterator);
+
+			if (gtalk)
+				break;
 		});
 
 	}
@@ -839,7 +839,7 @@
 			buddy = ASTOBJ_CONTAINER_FIND(&client->connection->buddies, them);
 			if (buddy)
 				resources = buddy->resources;
-		} else 
+		} else if (client->buddy)
 			resources = client->buddy->resources;
 		while (resources) {
 			if (resources->cap->jingle) {
@@ -876,13 +876,11 @@
 	}
 
 	if(strchr(tmp->us, '/')) {
-		data = ast_strdupa((char *) tmp->us);
+		data = ast_strdupa(tmp->us);
 		exten = strsep(&data, "/");
 	} else
 		exten = tmp->us;
 	ast_copy_string(tmp->exten,  exten, sizeof(tmp->exten));
-	if(data)
-		free(data);
 	ast_mutex_init(&tmp->lock);
 	ast_mutex_lock(&gtalklock);
 	tmp->next = client->p;
@@ -1480,15 +1478,13 @@
 	struct ast_channel *chan = NULL;
 
 	if (data) {
-		s = ast_strdupa((char *) data);
+		s = ast_strdupa(data);
 		if (s) {
 			sender = strsep(&s, "/");
 			if (sender && (sender[0] != '\0'))
 				to = strsep(&s, "/");
 			if (!to) {
 				ast_log(LOG_ERROR, "Bad arguments in Gtalk Dialstring: %s\n", (char*) data);
-				if (s)
-					free(s);
 				return NULL;
 			}
 		}
@@ -1496,14 +1492,14 @@
 	client = find_gtalk(to, sender);
 	if (!client) {
 		ast_log(LOG_WARNING, "Could not find recipient.\n");
-		if (s)
-			free(s);
 		return NULL;
 	}
+	ASTOBJ_WRLOCK(client);
 	p = gtalk_alloc(client, strchr(sender, '@') ? sender : client->connection->jid->full, strchr(to, '@') ? to : client->user, NULL);
 	if (p)
 		chan = gtalk_new(client, p, AST_STATE_DOWN, to);
 
+	ASTOBJ_UNLOCK(client);
 	return chan;
 }
 
@@ -1533,13 +1529,13 @@
 	if (iks_find_with_attrib(pak->x, "session", "type", "initiate")) {
 		/* New call */
 		gtalk_newcall(client, pak);
-	} else if (iks_find_with_attrib(pak->x, "session", "type", "candidates") || iks_find_with_attrib(pak->x, "session", "type", "transport-info") ) {
+	} else if (iks_find_with_attrib(pak->x, "session", "type", "candidates") || iks_find_with_attrib(pak->x, "session", "type", "transport-info")) {
 		if (option_debug > 2)
 			ast_log(LOG_DEBUG, "About to add candidate!\n");
 		gtalk_add_candidate(client, pak);
 		if (option_debug > 2)
 			ast_log(LOG_DEBUG, "Candidate Added!\n");
-	} else if (iks_find_with_attrib(pak->x, "session", "type", "accept")) {
+	} else if (iks_find_with_attrib(pak->x, "session", "type", "accept") || iks_find_with_attrib(pak->x, "session", "type", "transport-accept")) {
 		gtalk_is_answered(client, pak);
 	} else if (iks_find_with_attrib(pak->x, "session", "type", "content-info")) {
 		gtalk_handle_dtmf(client, pak);

Modified: team/qwell/gtalk_jingle-merge/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/team/qwell/gtalk_jingle-merge/channels/chan_jingle.c?view=diff&rev=56004&r1=56003&r2=56004
==============================================================================
--- team/qwell/gtalk_jingle-merge/channels/chan_jingle.c (original)
+++ team/qwell/gtalk_jingle-merge/channels/chan_jingle.c Wed Feb 21 15:41:05 2007
@@ -242,17 +242,18 @@
 
 	if (!jingle) {				/* guest call */
 		ASTOBJ_CONTAINER_TRAVERSE(&jingles, 1, {
-			ASTOBJ_WRLOCK(iterator);
+			ASTOBJ_RDLOCK(iterator);
 			if (!strcasecmp(iterator->name, "guest")) {
 				if (!strcasecmp(iterator->connection->jid->partial, connection)) {
 					jingle = iterator;
-					break;
 				} else if (!strcasecmp(iterator->connection->name, connection)) {
 					jingle = iterator;
-					break;
 				}
 			}
 			ASTOBJ_UNLOCK(iterator);
+
+			if (jingle)
+				break;
 		});
 
 	}
@@ -707,7 +708,7 @@
 			buddy = ASTOBJ_CONTAINER_FIND(&client->connection->buddies, from);
 			if (buddy)
 				resources = buddy->resources;
-		} else 
+		} else if (client->buddy)
 			resources = client->buddy->resources;
 		while (resources) {
 			if (resources->cap->jingle) {
@@ -1360,15 +1361,13 @@
 	struct ast_channel *chan = NULL;
 
 	if (data) {
-		s = ast_strdupa((char *) data);
+		s = ast_strdupa(data);
 		if (s) {
 			sender = strsep(&s, "/");
 			if (sender && (sender[0] != '\0'))
 				to = strsep(&s, "/");
 			if (!to) {
 				ast_log(LOG_ERROR, "Bad arguments in Jingle Dialstring: %s\n", (char*) data);
-				if (s)
-					free(s);
 				return NULL;
 			}
 		}
@@ -1376,13 +1375,13 @@
 	client = find_jingle(to, sender);
 	if (!client) {
 		ast_log(LOG_WARNING, "Could not find recipient.\n");
-		if (s)
-			free(s);
 		return NULL;
 	}
+	ASTOBJ_WRLOCK(client);
 	p = jingle_alloc(client, to, NULL);
 	if (p)
 		chan = jingle_new(client, p, AST_STATE_DOWN, to);
+	ASTOBJ_UNLOCK(client);
 
 	return chan;
 }

Modified: team/qwell/gtalk_jingle-merge/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/qwell/gtalk_jingle-merge/channels/chan_sip.c?view=diff&rev=56004&r1=56003&r2=56004
==============================================================================
--- team/qwell/gtalk_jingle-merge/channels/chan_sip.c (original)
+++ team/qwell/gtalk_jingle-merge/channels/chan_sip.c Wed Feb 21 15:41:05 2007
@@ -794,11 +794,12 @@
 #define SIP_PAGE2_CALL_ONHOLD		(3 << 23)	/*!< Call states */
 #define SIP_PAGE2_CALL_ONHOLD_ONEDIR	(1 << 23)	/*!< 23: One directional hold */
 #define SIP_PAGE2_CALL_ONHOLD_INACTIVE	(1 << 24)	/*!< 24: Inactive  */
-#define SIP_PAGE2_RFC2833_COMPENSATE    (1 << 25)	/*!< 25: ???? */
+#define SIP_PAGE2_RFC2833_COMPENSATE    (1 << 25)	/*!< 25: Compensate for buggy RFC2833 implementations */
 #define SIP_PAGE2_BUGGY_MWI		(1 << 26)	/*!< 26: Buggy CISCO MWI fix */
-#define SIP_PAGE2_NOTEXT		(1 << 27)	/*!< 26: Text not supported  */
-#define SIP_PAGE2_TEXTSUPPORT		(1 << 28)	/*!< 27: Global text enable */
-#define SIP_PAGE2_DEBUG_TEXT		(1 << 29)	/*!< 28: Global text debug */
+#define SIP_PAGE2_NOTEXT		(1 << 27)	/*!< 27: Text not supported  */
+#define SIP_PAGE2_TEXTSUPPORT		(1 << 28)	/*!< 28: Global text enable */
+#define SIP_PAGE2_DEBUG_TEXT		(1 << 29)	/*!< 29: Global text debug */
+#define SIP_PAGE2_OUTGOING_CALL         (1 << 30)       /*!< 30: Is this an outgoing call? */
 
 #define SIP_PAGE2_FLAGS_TO_COPY \
 	(SIP_PAGE2_ALLOWSUBSCRIBE | SIP_PAGE2_ALLOWOVERLAP | SIP_PAGE2_VIDEOSUPPORT | \
@@ -1933,8 +1934,8 @@
 	ours.sin_addr = *us;
 
 	if (localaddr && externip.sin_addr.s_addr &&
-	    ast_apply_ha(localaddr, &theirs) &&
-	    !ast_apply_ha(localaddr, &ours)) {
+	    (ast_apply_ha(localaddr, &theirs)) &&
+	    (!ast_apply_ha(localaddr, &ours))) {
 		if (externexpire && time(NULL) >= externexpire) {
 			struct ast_hostent ahp;
 			struct hostent *hp;
@@ -3296,7 +3297,7 @@
 {
 	char name[256];
 	int *inuse = NULL, *call_limit = NULL, *inringing = NULL;
-	int outgoing = ast_test_flag(&fup->flags[0], SIP_OUTGOING);
+	int outgoing = ast_test_flag(&fup->flags[1], SIP_PAGE2_OUTGOING_CALL);
 	struct sip_user *u = NULL;
 	struct sip_peer *p = NULL;
 
@@ -3578,6 +3579,11 @@
 	}
 
 	if (ast_test_flag(&p->flags[0], SIP_DEFER_BYE_ON_TRANSFER)) {
+		if (ast_test_flag(&p->flags[0], SIP_INC_COUNT)) {
+			if (option_debug && sipdebug)
+				ast_log(LOG_DEBUG, "update_call_counter(%s) - decrement call limit counter on hangup\n", p->username);
+			update_call_counter(p, DEC_CALL_LIMIT);
+		}
 		if (option_debug >3)
 			ast_log(LOG_DEBUG, "SIP Transfer: Not hanging up right now... Rescheduling hangup for %s.\n", p->callid);
 		if (p->autokillid > -1)
@@ -3601,9 +3607,11 @@
 		ast_log(LOG_DEBUG, "Hanging up zombie call. Be scared.\n");
 
 	sip_pvt_lock(p);
-	if (option_debug && sipdebug)
-		ast_log(LOG_DEBUG, "update_call_counter(%s) - decrement call limit counter on hangup\n", p->username);
-	update_call_counter(p, DEC_CALL_LIMIT);
+	if (ast_test_flag(&p->flags[0], SIP_INC_COUNT)) {
+		if (option_debug && sipdebug)
+			ast_log(LOG_DEBUG, "update_call_counter(%s) - decrement call limit counter on hangup\n", p->username);
+		update_call_counter(p, DEC_CALL_LIMIT);
+	}
 
 	/* Determine how to disconnect */
 	if (p->owner != ast) {
@@ -15955,6 +15963,8 @@
 		return NULL;
 	}
 
+	ast_set_flag(&p->flags[1], SIP_PAGE2_OUTGOING_CALL);
+
 	if (!(p->options = ast_calloc(1, sizeof(*p->options)))) {
 		sip_destroy(p);
 		ast_log(LOG_ERROR, "Unable to build option SIP data structure - Out of memory\n");

Modified: team/qwell/gtalk_jingle-merge/configs/sla.conf.sample
URL: http://svn.digium.com/view/asterisk/team/qwell/gtalk_jingle-merge/configs/sla.conf.sample?view=diff&rev=56004&r1=56003&r2=56004
==============================================================================
--- team/qwell/gtalk_jingle-merge/configs/sla.conf.sample (original)
+++ team/qwell/gtalk_jingle-merge/configs/sla.conf.sample Wed Feb 21 15:41:05 2007
@@ -10,73 +10,69 @@
 
 
 ; ---- Trunk Declarations -------------
+;
+;[line1]                  ; Provide a name for this trunk.
+;type=trunk               ; This line is what marks this entry as a trunk.
+;
+;device=Zap/3             ; Map this trunk declaration to a specific device.
+                          ; NOTE: At this point, this *must* be a zap channel!
 
-; Provide a name for this trunk.
-[line1]
-; This line is what marks this entry as a trunk.
-type=trunk
-; Map this trunk declaration to a specific device.
-; NOTE: At this point, this *must* be a zap channel!
-device=Zap/3
-; This supports automatic generation of the dialplan entries if the autocontext
-; option is used.  Each trunk should have a unique context name.  Then, in
-; zapata.conf, this device should be configured to have incoming calls go to
-; this context.
-autocontext=line1
+;autocontext=line1        ; This supports automatic generation of the dialplan entries 
+                          ; if the autocontext option is used.  Each trunk should have 
+                          ; a unique context name.  Then, in zapata.conf, this device 
+                          ; should be configured to have incoming calls go to this context.
 
-[line2]
-type=trunk
-device=Zap/4
-autocontext=line2
+;[line2]
+;type=trunk
+;device=Zap/4
+;autocontext=line2
 
-[line3]
-type=trunk
-device=Zap/3
-autocontext=line3
+;[line3]
+;type=trunk
+;device=Zap/3
+;autocontext=line3
 
-[line4]
-type=trunk
-device=Zap/4
-autocontext=line4
+;[line4]
+;type=trunk
+;device=Zap/4
+;autocontext=line4
 ; --------------------------------------
 
 
 ; ---- Station Declarations ------------
 
-; In this example, all stations have the same trunks, so this configuration
-; template is used to simplify the declaration of each station.
-[station](!)
-; This line indicates that this entry is a station.
-type=station
-; This supports automatic generation of the dialplan entries if the autocontext
-; option is used.  All stations can use the same context without conflict.  The
-; device for this station should have its context configured to the same one
-; listed here.
-autocontext=sla_stations
-; Individually list all of the trunks that will appear on this station.  This
-; order is significant.  It should be the same order as they appear on the
-; phone.  The order here defines the order of preference that the trunks will
-; be used.
-trunk=line1
-trunk=line2
-trunk=line3
-trunk=line4
+;[station](!)                       ; In this example, all stations have the same trunks, so this 
+                                    ; configuration template is used to simplify the declaration 
+                                    ; of each station.
 
-; Define a station that uses the configuration from the template "station".
-[station1](station)
-; Each station must be mapped to a device.
-device=SIP/station1
+;type=station                       ; This line indicates that this entry is a station.
 
-[station2](station)
-device=SIP/station2
+;autocontext=sla_stations           ; This supports automatic generation of the dialplan entries if 
+                                    ; the autocontext option is used.  All stations can use the same 
+                                    ; context without conflict.  The device for this station should 
+                                    ; have its context configured to the same one listed here.
 
-[station3](station)
-device=SIP/station3
+;trunk=line1                        ; Individually list all of the trunks that will appear on this station.  This
+                                    ; order is significant.  It should be the same order as they appear on the
+                                    ; phone.  The order here defines the order of preference that the trunks will
+                                    ; be used.
+;trunk=line2
+;trunk=line3
+;trunk=line4
 
-[station4](station)
-device=SIP/station4
-
-[station5](station)
-device=SIP/station5
+;[station1](station)                ; Define a station that uses the configuration from the template "station".
+;device=SIP/station1                ; Each station must be mapped to a device.
+;
+;[station2](station)
+;device=SIP/station2
+;
+;[station3](station)
+;device=SIP/station3
+;
+;[station4](station)
+;device=SIP/station4
+;
+;[station5](station)
+;device=SIP/station5
 ; --------------------------------------
 

Modified: team/qwell/gtalk_jingle-merge/include/asterisk/manager.h
URL: http://svn.digium.com/view/asterisk/team/qwell/gtalk_jingle-merge/include/asterisk/manager.h?view=diff&rev=56004&r1=56003&r2=56004
==============================================================================
--- team/qwell/gtalk_jingle-merge/include/asterisk/manager.h (original)
+++ team/qwell/gtalk_jingle-merge/include/asterisk/manager.h Wed Feb 21 15:41:05 2007
@@ -57,7 +57,7 @@
 #define EVENT_FLAG_CONFIG		(1 << 7) /* Ability to modify configurations */
 
 /* Export manager structures */
-#define AST_MAX_MANHEADERS 80
+#define AST_MAX_MANHEADERS 128
 
 /* Manager Helper Function */
 typedef int (*manager_hook_t)(int, const char *, char *); 

Modified: team/qwell/gtalk_jingle-merge/main/dns.c
URL: http://svn.digium.com/view/asterisk/team/qwell/gtalk_jingle-merge/main/dns.c?view=diff&rev=56004&r1=56003&r2=56004
==============================================================================
--- team/qwell/gtalk_jingle-merge/main/dns.c (original)

[... 228 lines stripped ...]


More information about the asterisk-commits mailing list