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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Sep 20 09:26:05 MST 2006


Author: pcadach
Date: Wed Sep 20 11:26:05 2006
New Revision: 43332

URL: http://svn.digium.com/view/asterisk?rev=43332&view=rev
Log:
Merged revisions 43256-43259,43263-43264,43271-43273,43281-43282,43285,43287-43290,43294,43296,43298,43300,43302-43303,43305,43307,43309-43311,43313,43315-43316,43322,43327 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r43256 | kpfleming | 2006-09-19 20:04:15 +0600 (Втр, 19 Сен 2006) | 2 lines

restore ability for Makefiles to use 'generic' platform names when needed

................
r43257 | qwell | 2006-09-19 20:16:12 +0600 (Втр, 19 Сен 2006) | 2 lines

be a little more consistent with our variable usage

................
r43258 | qwell | 2006-09-19 20:19:54 +0600 (Втр, 19 Сен 2006) | 2 lines

Add a few more 'generic' platforms

................
r43259 | qwell | 2006-09-19 20:24:14 +0600 (Втр, 19 Сен 2006) | 2 lines

Let's order these better..

................
r43263 | file | 2006-09-19 21:23:39 +0600 (Втр, 19 Сен 2006) | 2 lines

Improve output of sip show peers (issue #6624 reported by mavetju with minor code changes by myself)

................
r43264 | file | 2006-09-19 21:36:25 +0600 (Втр, 19 Сен 2006) | 2 lines

Warning be gone!

................
r43271 | mogorman | 2006-09-19 22:23:03 +0600 (Втр, 19 Сен 2006) | 1 line

blocking version 43269 from being pushed into trunk
................
r43272 | mogorman | 2006-09-19 22:23:45 +0600 (Втр, 19 Сен 2006) | 3 lines

similar patch for verbose vs debug with minor changes
bug 2617

................
r43273 | mattf | 2006-09-19 22:25:21 +0600 (Втр, 19 Сен 2006) | 2 lines

Let's try this out.  Seems silly, but we'll try it anyways

................
r43281 | mattf | 2006-09-19 23:07:22 +0600 (Втр, 19 Сен 2006) | 2 lines

Mergeing in Paul Cadach's chan_h323 changes *holds breath*

................
r43282 | mattf | 2006-09-19 23:09:01 +0600 (Втр, 19 Сен 2006) | 2 lines

Update configure and closest kin.  *Hopes my branch doesn't break*

................
r43285 | file | 2006-09-20 00:48:17 +0600 (Срд, 20 Сен 2006) | 2 lines

While this is experimental I don't think it should be experimental enough to be printed out in big capital letters, and Kenny tends to agree too so you know it's right.

................
r43287 | mattf | 2006-09-20 01:04:13 +0600 (Срд, 20 Сен 2006) | 2 lines

Work!!!

................
r43288 | mattf | 2006-09-20 01:25:18 +0600 (Срд, 20 Сен 2006) | 2 lines

Add the h323 config file.  Arrr!!! for international talk like a pirate's day.

................
r43289 | anthonyl | 2006-09-20 01:28:57 +0600 (Срд, 20 Сен 2006) | 1 line

5240 update
................
r43290 | qwell | 2006-09-20 01:58:09 +0600 (Срд, 20 Сен 2006) | 4 lines

After discussing this with other people, we decided we'd like to try to do this a little differently.

Stay tuned.

................
r43294 | mattf | 2006-09-20 03:07:49 +0600 (Срд, 20 Сен 2006) | 2 lines

Various updates from PCadach's chan_h323-live branch

................
r43296 | mattf | 2006-09-20 03:33:50 +0600 (Срд, 20 Сен 2006) | 2 lines

Get rid of zero size old config file

................
r43298 | kpfleming | 2006-09-20 03:48:57 +0600 (Срд, 20 Сен 2006) | 2 lines

move this header to include where it belongs

................
r43300 | qwell | 2006-09-20 04:01:23 +0600 (Срд, 20 Сен 2006) | 4 lines

Commit the changes from issue #5240.

Original patch by junky, modified by anthonyl, modified again by jcolp (with minor modifications by me)

................
r43302 | kpfleming | 2006-09-20 05:08:35 +0600 (Срд, 20 Сен 2006) | 2 lines

do this fix properly :-)

................
r43303 | mogorman | 2006-09-20 05:57:04 +0600 (Срд, 20 Сен 2006) | 3 lines

fixed timeout issue as well as some other minor issues


................
r43305 | mogorman | 2006-09-20 06:39:44 +0600 (Срд, 20 Сен 2006) | 2 lines

thats odd, but just in case it happens again i want to see it.

................
r43307 | bweschke | 2006-09-20 09:51:01 +0600 (Срд, 20 Сен 2006) | 14 lines

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

........
r42133 | bweschke | 2006-09-06 14:16:41 -0400 (Wed, 06 Sep 2006) | 6 lines

 Look ma! No more deadlocks! <sic>

 As posted from #7458 and others similar to it in Mantis:
 p->app_lock was a mutex really designed for use with agents not in callback mode. That being the case, I've tried to code it so that when callback mode is used, the app_lock mutex will not be locked/unlocked at all. Please let me know how you make out - and if you continue to deadlock now, please reproduce the deadlock logging information and post to Mantis. 


........

................
r43309 | kpfleming | 2006-09-20 10:34:51 +0600 (Срд, 20 Сен 2006) | 2 lines

move ADSI functionality into ast_ namespace

................
r43310 | kpfleming | 2006-09-20 10:45:45 +0600 (Срд, 20 Сен 2006) | 2 lines

move more API into the ast_ namespace

................
r43311 | kpfleming | 2006-09-20 10:57:20 +0600 (Срд, 20 Сен 2006) | 2 lines

move ODBC API into ast_ namespace

................
r43313 | kpfleming | 2006-09-20 11:01:03 +0600 (Срд, 20 Сен 2006) | 2 lines

these functions never should have been non-static or in a header file

................
r43315 | kpfleming | 2006-09-20 11:13:03 +0600 (Срд, 20 Сен 2006) | 10 lines

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

........
r43314 | kpfleming | 2006-09-20 00:08:05 -0500 (Wed, 20 Sep 2006) | 2 lines

make some more functions static

........

................
r43316 | qwell | 2006-09-20 11:59:53 +0600 (Срд, 20 Сен 2006) | 6 lines

Add a "member name" to queue members.
Add option to the various methods of adding a queue member, to add the "member name".

Member name is used in (most) queue log records, in place of the interface name.
This makes it consistent, so that you can log in from any device, and still be logged as "member name"

................
r43322 | qwell | 2006-09-20 12:14:05 +0600 (Срд, 20 Сен 2006) | 2 lines

We need to persist the member name also

................
r43327 | qwell | 2006-09-20 20:47:59 +0600 (Срд, 20 Сен 2006) | 2 lines

Document member name logging functionality.

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

Added:
    team/pcadach/chan_h323-live/include/jitterbuf.h   (props changed)
      - copied unchanged from r43327, trunk/include/jitterbuf.h
Removed:
    team/pcadach/chan_h323-live/main/jitterbuf.h
Modified:
    team/pcadach/chan_h323-live/   (props changed)
    team/pcadach/chan_h323-live/CREDITS
    team/pcadach/chan_h323-live/Makefile
    team/pcadach/chan_h323-live/apps/app_adsiprog.c
    team/pcadach/chan_h323-live/apps/app_dial.c
    team/pcadach/chan_h323-live/apps/app_getcpeid.c
    team/pcadach/chan_h323-live/apps/app_queue.c
    team/pcadach/chan_h323-live/apps/app_voicemail.c
    team/pcadach/chan_h323-live/channels/chan_agent.c
    team/pcadach/chan_h323-live/channels/chan_misdn.c
    team/pcadach/chan_h323-live/channels/chan_sip.c
    team/pcadach/chan_h323-live/channels/chan_zap.c
    team/pcadach/chan_h323-live/channels/h323/Makefile.in   (props changed)
    team/pcadach/chan_h323-live/channels/h323/cisco-h225.asn   (props changed)
    team/pcadach/chan_h323-live/channels/h323/cisco-h225.cpp   (props changed)
    team/pcadach/chan_h323-live/channels/h323/cisco-h225.h   (props changed)
    team/pcadach/chan_h323-live/codecs/gsm/Makefile
    team/pcadach/chan_h323-live/configs/queues.conf.sample
    team/pcadach/chan_h323-live/configure
    team/pcadach/chan_h323-live/configure.ac
    team/pcadach/chan_h323-live/funcs/func_odbc.c
    team/pcadach/chan_h323-live/include/asterisk/adsi.h
    team/pcadach/chan_h323-live/include/asterisk/agi.h
    team/pcadach/chan_h323-live/include/asterisk/autoconfig.h.in
    team/pcadach/chan_h323-live/include/asterisk/monitor.h
    team/pcadach/chan_h323-live/include/asterisk/res_odbc.h
    team/pcadach/chan_h323-live/main/asterisk.c
    team/pcadach/chan_h323-live/main/config.c
    team/pcadach/chan_h323-live/main/frame.c
    team/pcadach/chan_h323-live/main/manager.c
    team/pcadach/chan_h323-live/main/pbx.c
    team/pcadach/chan_h323-live/makeopts.in
    team/pcadach/chan_h323-live/res/res_adsi.c
    team/pcadach/chan_h323-live/res/res_agi.c
    team/pcadach/chan_h323-live/res/res_config_odbc.c
    team/pcadach/chan_h323-live/res/res_features.c
    team/pcadach/chan_h323-live/res/res_jabber.c
    team/pcadach/chan_h323-live/res/res_monitor.c
    team/pcadach/chan_h323-live/res/res_musiconhold.c
    team/pcadach/chan_h323-live/res/res_odbc.c
    team/pcadach/chan_h323-live/utils/Makefile

Propchange: team/pcadach/chan_h323-live/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/pcadach/chan_h323-live/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/pcadach/chan_h323-live/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/pcadach/chan_h323-live/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Sep 20 11:26:05 2006
@@ -1,1 +1,1 @@
-/trunk:1-43253
+/trunk:1-43330

Modified: team/pcadach/chan_h323-live/CREDITS
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/CREDITS?rev=43332&r1=43331&r2=43332&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/CREDITS (original)
+++ team/pcadach/chan_h323-live/CREDITS Wed Sep 20 11:26:05 2006
@@ -150,6 +150,8 @@
 
 James Rothenberger - Support for IMAP storage integration added by OneBizTone LLC Work funded by University of Pennsylvania jar at onebiztone.com
 
+Paul Cadach - Bringing chan_h323 up to date, bug fixes, and more!
+
 === OTHER CONTRIBUTIONS ===
 John Todd - Monkey sounds and associated teletorture prompt
 Michael Jerris - bug marshaling

Modified: team/pcadach/chan_h323-live/Makefile
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/Makefile?rev=43332&r1=43331&r2=43332&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/Makefile (original)
+++ team/pcadach/chan_h323-live/Makefile Wed Sep 20 11:26:05 2006
@@ -106,7 +106,7 @@
 GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
 USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
 
-MOD_SUBDIR_CFLAGS=-I../include -I../main
+MOD_SUBDIR_CFLAGS=-I../include
 OTHER_SUBDIR_CFLAGS=-I../include
 
 ifeq ($(OSARCH),linux-gnu)

Modified: team/pcadach/chan_h323-live/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/apps/app_adsiprog.c?rev=43332&r1=43331&r2=43332&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/apps/app_adsiprog.c (original)
+++ team/pcadach/chan_h323-live/apps/app_adsiprog.c Wed Sep 20 11:26:05 2006
@@ -1438,11 +1438,11 @@
 		return -1;
 
 	/* Start an empty ADSI Session */
-	if (adsi_load_session(chan, NULL, 0, 1) < 1) 
+	if (ast_adsi_load_session(chan, NULL, 0, 1) < 1) 
 		return -1;
 
 	/* Now begin the download attempt */
-	if (adsi_begin_download(chan, scr->desc, scr->fdn, scr->sec, scr->ver)) {
+	if (ast_adsi_begin_download(chan, scr->desc, scr->fdn, scr->sec, scr->ver)) {
 		/* User rejected us for some reason */
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "User rejected download attempt\n");
@@ -1456,7 +1456,7 @@
 	for (x=0;x<scr->numkeys;x++) {
 		if (bytes + scr->keys[x].retstrlen > 253) {
 			/* Send what we've collected so far */
-			if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
+			if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
 				ast_log(LOG_WARNING, "Unable to send chunk ending at %d\n", x);
 				return -1;
 			}
@@ -1469,7 +1469,7 @@
 #endif
 	}
 	if (bytes) {
-		if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
+		if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
 			ast_log(LOG_WARNING, "Unable to send chunk ending at %d\n", x);
 			return -1;
 		}
@@ -1480,7 +1480,7 @@
 	for (x=0;x<scr->numdisplays;x++) {
 		if (bytes + scr->displays[x].datalen > 253) {
 			/* Send what we've collected so far */
-			if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
+			if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
 				ast_log(LOG_WARNING, "Unable to send chunk ending at %d\n", x);
 				return -1;
 			}
@@ -1493,7 +1493,7 @@
 #endif
 	}
 	if (bytes) {
-		if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
+		if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
 			ast_log(LOG_WARNING, "Unable to send chunk ending at %d\n", x);
 			return -1;
 		}
@@ -1504,7 +1504,7 @@
 	for (x=0;x<scr->numsubs;x++) {
 		if (bytes + scr->subs[x].datalen > 253) {
 			/* Send what we've collected so far */
-			if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
+			if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
 				ast_log(LOG_WARNING, "Unable to send chunk ending at %d\n", x);
 				return -1;
 			}
@@ -1517,7 +1517,7 @@
 #endif
 	}
 	if (bytes) {
-		if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
+		if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DOWNLOAD)) {
 			ast_log(LOG_WARNING, "Unable to send chunk ending at %d\n", x);
 			return -1;
 		}
@@ -1525,11 +1525,11 @@
 
 
 	bytes = 0;
-	bytes += adsi_display(buf, ADSI_INFO_PAGE, 1, ADSI_JUST_LEFT, 0, "Download complete.", "");
-	bytes += adsi_set_line(buf, ADSI_INFO_PAGE, 1);
-	if (adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY) < 0)
+	bytes += ast_adsi_display(buf, ADSI_INFO_PAGE, 1, ADSI_JUST_LEFT, 0, "Download complete.", "");
+	bytes += ast_adsi_set_line(buf, ADSI_INFO_PAGE, 1);
+	if (ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY) < 0)
 		return -1;
-	if (adsi_end_download(chan)) {
+	if (ast_adsi_end_download(chan)) {
 		/* Download failed for some reason */
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "Download attempt failed\n");
@@ -1538,7 +1538,7 @@
 		return -1;
 	}
 	free(scr);
-	adsi_unload_session(chan);
+	ast_adsi_unload_session(chan);
 	return 0;
 }
 
@@ -1552,7 +1552,7 @@
 	if (ast_strlen_zero(data))
 		data = "asterisk.adsi";
 	
-	if (!adsi_available(chan)) {
+	if (!ast_adsi_available(chan)) {
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "ADSI Unavailable on CPE.  Not bothering to try.\n");
 	} else {

Modified: team/pcadach/chan_h323-live/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/apps/app_dial.c?rev=43332&r1=43331&r2=43332&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/apps/app_dial.c (original)
+++ team/pcadach/chan_h323-live/apps/app_dial.c Wed Sep 20 11:26:05 2006
@@ -1182,7 +1182,7 @@
 			/* Again, keep going even if there's an error */
 			if (option_debug)
 				ast_log(LOG_DEBUG, "ast call on peer returned %d\n", res);
-			else if (option_verbose > 2)
+			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", numsubst);
 			ast_hangup(tmp->chan);
 			tmp->chan = NULL;

Modified: team/pcadach/chan_h323-live/apps/app_getcpeid.c
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/apps/app_getcpeid.c?rev=43332&r1=43331&r2=43332&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/apps/app_getcpeid.c (original)
+++ team/pcadach/chan_h323-live/apps/app_getcpeid.c Wed Sep 20 11:26:05 2006
@@ -60,7 +60,7 @@
 	for (x=0;x<4;x++)
 		tmp[x] = stuff[x];
 	tmp[4] = NULL;
-	return adsi_print(chan, tmp, justify, voice);
+	return ast_adsi_print(chan, tmp, justify, voice);
 }
 
 static int cpeid_exec(struct ast_channel *chan, void *idata)
@@ -83,10 +83,10 @@
 	strncpy(stuff[0], "** CPE Info **", sizeof(data[0]) - 1);
 	strncpy(stuff[1], "Identifying CPE...", sizeof(data[1]) - 1);
 	strncpy(stuff[2], "Please wait...", sizeof(data[2]) - 1);
-	res = adsi_load_session(chan, NULL, 0, 1);
+	res = ast_adsi_load_session(chan, NULL, 0, 1);
 	if (res > 0) {
 		cpeid_setstatus(chan, stuff, 0);
-		res = adsi_get_cpeid(chan, cpeid, 0);
+		res = ast_adsi_get_cpeid(chan, cpeid, 0);
 		if (res > 0) {
 			gotcpeid = 1;
 			if (option_verbose > 2)
@@ -96,7 +96,7 @@
 			strncpy(stuff[1], "Measuring CPE...", sizeof(data[1]) - 1);
 			strncpy(stuff[2], "Please wait...", sizeof(data[2]) - 1);
 			cpeid_setstatus(chan, stuff, 0);
-			res = adsi_get_cpeinfo(chan, &width, &height, &buttons, 0);
+			res = ast_adsi_get_cpeinfo(chan, &width, &height, &buttons, 0);
 			if (res > -1) {
 				if (option_verbose > 2)
 					ast_verbose(VERBOSE_PREFIX_3 "CPE has %d lines, %d columns, and %d buttons on '%s'\n", height, width, buttons, chan->name);
@@ -123,7 +123,7 @@
 					break;
 				}
 			}
-			adsi_unload_session(chan);
+			ast_adsi_unload_session(chan);
 		}
 	}
 	ast_module_user_remove(u);

Modified: team/pcadach/chan_h323-live/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/apps/app_queue.c?rev=43332&r1=43331&r2=43332&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/apps/app_queue.c (original)
+++ team/pcadach/chan_h323-live/apps/app_queue.c Wed Sep 20 11:26:05 2006
@@ -313,6 +313,7 @@
 
 struct member {
 	char interface[80];                 /*!< Technology/Location */
+	char membername[80];                /*!< Member name to use in queue logs */
 	int penalty;                        /*!< Are we a last resort? */
 	int calls;                          /*!< Number of calls serviced by this member */
 	int dynamic;                        /*!< Are we dynamically added? */
@@ -554,13 +555,14 @@
 				manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
 					"Queue: %s\r\n"
 					"Location: %s\r\n"
+					"MemberName: %s\r\n"
 					"Membership: %s\r\n"
 					"Penalty: %d\r\n"
 					"CallsTaken: %d\r\n"
 					"LastCall: %d\r\n"
 					"Status: %d\r\n"
 					"Paused: %d\r\n",
-					q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
+					q->name, cur->interface, cur->membername, cur->dynamic ? "dynamic" : "static",
 					cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
 			}
 		}
@@ -594,7 +596,7 @@
 	return 0;
 }
 
-static struct member *create_queue_member(char *interface, int penalty, int paused)
+static struct member *create_queue_member(char *interface, char *membername, int penalty, int paused)
 {
 	struct member *cur;
 	
@@ -602,6 +604,7 @@
 		cur->penalty = penalty;
 		cur->paused = paused;
 		ast_copy_string(cur->interface, interface, sizeof(cur->interface));
+		ast_copy_string(cur->membername, membername, sizeof(cur->membername));
 		if (!strchr(cur->interface, '/'))
 			ast_log(LOG_WARNING, "No location at interface '%s'\n", interface);
 		cur->status = ast_device_state(interface);
@@ -909,7 +912,7 @@
 	}
 }
 
-static void rt_handle_member_record(struct call_queue *q, char *interface, const char *penalty_str)
+static void rt_handle_member_record(struct call_queue *q, char *interface, char *membername, const char *penalty_str)
 {
 	struct member *m, *prev_m;
 	int penalty = 0;
@@ -927,7 +930,7 @@
 
 	/* Create a new one if not found, else update penalty */
 	if (!m) {
-		if ((m = create_queue_member(interface, penalty, 0))) {
+		if ((m = create_queue_member(interface, membername, penalty, 0))) {
 			m->dead = 0;
 			add_to_interfaces(interface);
 			if (prev_m) {
@@ -1058,8 +1061,11 @@
 			m->dead = 1;
 	}
 
-	while ((interface = ast_category_browse(member_config, interface)))
-		rt_handle_member_record(q, interface, ast_variable_retrieve(member_config, interface, "penalty"));
+	while ((interface = ast_category_browse(member_config, interface))) {
+		rt_handle_member_record(q, interface,
+			ast_variable_retrieve(member_config, interface, "membername"),
+			ast_variable_retrieve(member_config, interface, "penalty"));
+	}
 
 	/* Delete all realtime members that have been deleted in DB. */
 	m = q->members;
@@ -1441,13 +1447,14 @@
 			manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
 				"Queue: %s\r\n"
 				"Location: %s\r\n"
+				"MemberName: %s\r\n"
 				"Membership: %s\r\n"
 				"Penalty: %d\r\n"
 				"CallsTaken: %d\r\n"
 				"LastCall: %d\r\n"
 				"Status: %d\r\n"
 				"Paused: %d\r\n",
-				q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
+				q->name, cur->interface, cur->membername, cur->dynamic ? "dynamic" : "static",
 				cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
 		}
 	}
@@ -1636,7 +1643,7 @@
 		/* Again, keep going even if there's an error */
 		if (option_debug)
 			ast_log(LOG_DEBUG, "ast call on peer returned %d\n", res);
-		else if (option_verbose > 2)
+		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", tmp->interface);
 		do_hang(tmp);
 		(*busies)++;
@@ -1814,18 +1821,18 @@
 }
 
 /*! \brief RNA == Ring No Answer. Common code that is executed when we try a queue member and they don't answer. */
-static void rna(int rnatime, struct queue_ent *qe, char *membername)
+static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername)
 {
 	if (option_verbose > 2)
 		ast_verbose( VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", rnatime);
 	ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d", rnatime);
 	if (qe->parent->autopause) {
-		if (!set_member_paused(qe->parent->name, membername, 1)) {
+		if (!set_member_paused(qe->parent->name, interface, 1)) {
 			if (option_verbose > 2)
-				ast_verbose( VERBOSE_PREFIX_3 "Auto-Pausing Queue Member %s in queue %s since they failed to answer.\n", membername, qe->parent->name);
+				ast_verbose( VERBOSE_PREFIX_3 "Auto-Pausing Queue Member %s in queue %s since they failed to answer.\n", interface, qe->parent->name);
 		} else {
 			if (option_verbose > 2)
-				ast_verbose( VERBOSE_PREFIX_3 "Failed to pause Queue Member %s in queue %s!\n", membername, qe->parent->name);
+				ast_verbose( VERBOSE_PREFIX_3 "Failed to pause Queue Member %s in queue %s!\n", interface, qe->parent->name);
 		}
 	}
 	return;
@@ -1847,7 +1854,8 @@
 	struct callattempt *peer = NULL;
 	struct ast_channel *winner;
 	struct ast_channel *in = qe->chan;
-	char on[256] = "";
+	char on[80] = "";
+	char membername[80] = "";
 	long starttime = 0;
 	long endtime = 0;	
 
@@ -1896,6 +1904,7 @@
 			} else if (o->chan && (o->chan == winner)) {
 				if (!ast_strlen_zero(o->chan->call_forward) && !forwardsallowed) {
 					ast_copy_string(on, o->member->interface, sizeof(on));
+					ast_copy_string(membername, o->member->membername, sizeof(membername));
 					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s' prevented.\n", in->name, o->chan->call_forward);
                                         winner = o->chan = NULL;
@@ -1975,7 +1984,7 @@
 							do_hang(o);
 							endtime = (long)time(NULL);
 							endtime -= starttime;
-							rna(endtime*1000, qe, on);
+							rna(endtime*1000, qe, on, membername);
 							if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
 								if (qe->parent->timeoutrestart)
 									*to = orig;
@@ -1990,7 +1999,7 @@
 								ast_cdr_busy(in->cdr);
 							endtime = (long)time(NULL);
 							endtime -= starttime;
-							rna(endtime*1000, qe, on);
+							rna(endtime*1000, qe, on, membername);
 							do_hang(o);
 							if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
 								if (qe->parent->timeoutrestart)
@@ -2019,7 +2028,7 @@
 					ast_frfree(f);
 				} else {
 					endtime = (long) time(NULL) - starttime;
-					rna(endtime * 1000, qe, on);
+					rna(endtime * 1000, qe, on, membername);
 					do_hang(o);
 					if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
 						if (qe->parent->timeoutrestart)
@@ -2056,7 +2065,7 @@
 			ast_frfree(f);
 		}
 		if (!*to)
-			rna(orig, qe, on);
+			rna(orig, qe, on, membername);
 	}
 
 	return peer;
@@ -2442,7 +2451,7 @@
 			if (peer->_softhangup) {
 				/* Agent must have hung up */
 				ast_log(LOG_WARNING, "Agent on %s hungup on the customer.  They're going to be pissed.\n", peer->name);
-				ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "AGENTDUMP", "%s", "");
+				ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "AGENTDUMP", "%s", "");
 				record_abandoned(qe);
 				if (qe->parent->eventwhencalled)
 					manager_event(EVENT_FLAG_AGENT, "AgentDump",
@@ -2450,15 +2459,16 @@
 							"Uniqueid: %s\r\n"
 							"Channel: %s\r\n"
 							"Member: %s\r\n"
+							"MemberName: %s\r\n"
 							"%s",
-							queuename, qe->chan->uniqueid, peer->name, member->interface,
+							queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername,
 							qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 				ast_hangup(peer);
 				goto out;
 			} else if (res2) {
 				/* Caller must have hung up just before being connected*/
 				ast_log(LOG_NOTICE, "Caller was about to talk to agent on %s but the caller hungup.\n", peer->name);
-				ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long)time(NULL) - qe->start);
+				ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long)time(NULL) - qe->start);
 				record_abandoned(qe);
 				ast_hangup(peer);
 				return -1;
@@ -2472,7 +2482,7 @@
 		/* Make sure channels are compatible */
 		res = ast_channel_make_compatible(qe->chan, peer);
 		if (res < 0) {
-			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "SYSCOMPAT", "%s", "");
+			ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "SYSCOMPAT", "%s", "");
 			ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", qe->chan->name, peer->name);
 			record_abandoned(qe);
 			ast_hangup(peer);
@@ -2587,17 +2597,18 @@
 			} else
 				ast_log(LOG_WARNING, "Asked to execute an AGI on this channel, but could not find application (agi)!\n");
 		}
-		ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "CONNECT", "%ld|%s", (long)time(NULL) - qe->start, peer->uniqueid);
+		ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "CONNECT", "%ld|%s", (long)time(NULL) - qe->start, peer->uniqueid);
 		if (qe->parent->eventwhencalled)
 			manager_event(EVENT_FLAG_AGENT, "AgentConnect",
 					"Queue: %s\r\n"
 					"Uniqueid: %s\r\n"
 					"Channel: %s\r\n"
 					"Member: %s\r\n"
+					"MemberName: %s\r\n"
 					"Holdtime: %ld\r\n"
 					"BridgedChannel: %s\r\n"
 					"%s",
-					queuename, qe->chan->uniqueid, peer->name, member->interface,
+					queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername,
 					(long)time(NULL) - qe->start, peer->uniqueid,
 					qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 		ast_copy_string(oldcontext, qe->chan->context, sizeof(oldcontext));
@@ -2607,7 +2618,7 @@
 		bridge = ast_bridge_call(qe->chan,peer, &bridge_config);
 
 		if (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten)) {
-			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "TRANSFER", "%s|%s|%ld|%ld",
+			ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld",
 				qe->chan->exten, qe->chan->context, (long) (callstart - qe->start),
 				(long) (time(NULL) - callstart));
 		} else if (qe->chan->_softhangup) {
@@ -2619,26 +2630,28 @@
 						"Uniqueid: %s\r\n"
 						"Channel: %s\r\n"
 						"Member: %s\r\n"
+						"MemberName: %s\r\n"
 						"HoldTime: %ld\r\n"
 						"TalkTime: %ld\r\n"
 						"Reason: caller\r\n"
 						"%s",
-						queuename, qe->chan->uniqueid, peer->name, member->interface,
+						queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername,
 						(long)(callstart - qe->start), (long)(time(NULL) - callstart),
 						qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 		} else {
-			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "COMPLETEAGENT", "%ld|%ld",
+			ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETEAGENT", "%ld|%ld",
 				(long) (callstart - qe->start), (long) (time(NULL) - callstart));
 			if (qe->parent->eventwhencalled)
 				manager_event(EVENT_FLAG_AGENT, "AgentComplete",
 						"Queue: %s\r\n"
 						"Uniqueid: %s\r\n"
 						"Channel: %s\r\n"
+						"MemberName: %s\r\n"
 						"HoldTime: %ld\r\n"
 						"TalkTime: %ld\r\n"
 						"Reason: agent\r\n"
 						"%s",
-						queuename, qe->chan->uniqueid, peer->name, (long)(callstart - qe->start),
+						queuename, qe->chan->uniqueid, peer->name, member->membername, (long)(callstart - qe->start),
 						(long)(time(NULL) - callstart),
 						qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 		}
@@ -2699,8 +2712,8 @@
 		if (!cur_member->dynamic)
 			continue;
 
-		res = snprintf(value + value_len, sizeof(value) - value_len, "%s;%d;%d%s",
-			cur_member->interface, cur_member->penalty, cur_member->paused,
+		res = snprintf(value + value_len, sizeof(value) - value_len, "%s;%d;%d;%s%s",
+			cur_member->interface, cur_member->penalty, cur_member->paused, cur_member->membername,
 			cur_member->next ? "|" : "");
 		if (res != strlen(value + value_len)) {
 			ast_log(LOG_WARNING, "Could not create persistent member string, out of space\n");
@@ -2746,8 +2759,9 @@
 			}
 			manager_event(EVENT_FLAG_AGENT, "QueueMemberRemoved",
 				"Queue: %s\r\n"
-				"Location: %s\r\n",
-				q->name, last_member->interface);
+				"Location: %s\r\n"
+				"MemberName: %s\r\n",
+				q->name, last_member->interface, last_member->membername);
 			free(last_member);
 			
 			if (queue_persistent_members)
@@ -2770,7 +2784,7 @@
 }
 
 
-static int add_to_queue(char *queuename, char *interface, int penalty, int paused, int dump)
+static int add_to_queue(char *queuename, char *interface, char *membername, int penalty, int paused, int dump)
 {
 	struct call_queue *q;
 	struct member *new_member;
@@ -2786,20 +2800,22 @@
 	ast_mutex_lock(&q->lock);
 	if (interface_exists(q, interface) == NULL) {
 		add_to_interfaces(interface);
-		if ((new_member = create_queue_member(interface, penalty, paused))) {
+		if ((new_member = create_queue_member(interface, membername, penalty, paused))) {
 			new_member->dynamic = 1;
 			new_member->next = q->members;
 			q->members = new_member;
 			manager_event(EVENT_FLAG_AGENT, "QueueMemberAdded",
 				"Queue: %s\r\n"
 				"Location: %s\r\n"
+				"MemberName: %s\r\n"
 				"Membership: %s\r\n"
 				"Penalty: %d\r\n"
 				"CallsTaken: %d\r\n"
 				"LastCall: %d\r\n"
 				"Status: %d\r\n"
 				"Paused: %d\r\n",
-				q->name, new_member->interface, new_member->dynamic ? "dynamic" : "static",
+				q->name, new_member->interface, new_member->membername,
+				new_member->dynamic ? "dynamic" : "static",
 				new_member->penalty, new_member->calls, (int) new_member->lastcall,
 				new_member->status, new_member->paused);
 			
@@ -2826,7 +2842,7 @@
 	struct member *mem;
 
 	/* Special event for when all queues are paused - individual events still generated */
-
+	/* XXX In all other cases, we use the membername, but since this affects all queues, we cannot */
 	if (ast_strlen_zero(queuename))
 		ast_queue_log("NONE", "NONE", interface, (paused ? "PAUSEALL" : "UNPAUSEALL"), "%s", "");
 
@@ -2843,13 +2859,14 @@
 				if (queue_persistent_members)
 					dump_queue_members(q);
 
-				ast_queue_log(q->name, "NONE", interface, (paused ? "PAUSE" : "UNPAUSE"), "%s", "");
+				ast_queue_log(q->name, "NONE", mem->membername, (paused ? "PAUSE" : "UNPAUSE"), "%s", "");
 
 				manager_event(EVENT_FLAG_AGENT, "QueueMemberPaused",
 					"Queue: %s\r\n"
 					"Location: %s\r\n"
+					"MemberName: %s\r\n"
 					"Paused: %d\r\n",
-						q->name, mem->interface, paused);
+						q->name, mem->interface, mem->membername, paused);
 			}
 		}
 		ast_mutex_unlock(&q->lock);
@@ -2866,6 +2883,7 @@
 	char *queue_name;
 	char *member;
 	char *interface;
+	char *membername;
 	char *penalty_tok;
 	int penalty = 0;
 	char *paused_tok;
@@ -2909,6 +2927,7 @@
 			interface = strsep(&member, ";");
 			penalty_tok = strsep(&member, ";");
 			paused_tok = strsep(&member, ";");
+			membername = strsep(&member, ";");
 
 			if (!penalty_tok) {
 				ast_log(LOG_WARNING, "Error parsing persistent member string for '%s' (penalty)\n", queue_name);
@@ -2929,11 +2948,13 @@
 				ast_log(LOG_WARNING, "Error converting paused: %s: Expected 0 or 1.\n", paused_tok);
 				break;
 			}
+			if (ast_strlen_zero(membername))
+				membername = interface;
 
 			if (option_debug)
-				ast_log(LOG_DEBUG, "Reload Members: Queue: %s  Member: %s  Penalty: %d  Paused: %d\n", queue_name, interface, penalty, paused);
+				ast_log(LOG_DEBUG, "Reload Members: Queue: %s  Member: %s  Name: %s  Penalty: %d  Paused: %d\n", queue_name, interface, membername, penalty, paused);
 			
-			if (add_to_queue(queue_name, interface, penalty, paused, 0) == RES_OUTOFMEMORY) {
+			if (add_to_queue(queue_name, membername, interface, penalty, paused, 0) == RES_OUTOFMEMORY) {
 				ast_log(LOG_ERROR, "Out of Memory when reloading persistent queue member\n");
 				break;
 			}
@@ -3125,11 +3146,12 @@
 		AST_APP_ARG(interface);
 		AST_APP_ARG(penalty);
 		AST_APP_ARG(options);
+		AST_APP_ARG(membername);
 	);
 	int penalty = 0;
 
 	if (ast_strlen_zero(data)) {
-		ast_log(LOG_WARNING, "AddQueueMember requires an argument (queuename[|[interface]|[penalty][|options]])\n");
+		ast_log(LOG_WARNING, "AddQueueMember requires an argument (queuename[|[interface]|[penalty][|options][|membername]])\n");
 		return -1;
 	}
 
@@ -3158,8 +3180,11 @@
 			priority_jump = 1;
 	}
 
-
-	switch (add_to_queue(args.queuename, args.interface, penalty, 0, queue_persistent_members)) {
+	if (ast_strlen_zero(args.membername))
+		args.membername = args.interface;
+
+
+	switch (add_to_queue(args.queuename, args.interface, args.membername, penalty, 0, queue_persistent_members)) {
 	case RES_OKAY:
 		ast_log(LOG_NOTICE, "Added interface '%s' to queue '%s'\n", args.interface, args.queuename);
 		pbx_builtin_setvar_helper(chan, "AQMSTATUS", "ADDED");
@@ -3195,13 +3220,13 @@
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(queuename);
 		AST_APP_ARG(uniqueid);
-		AST_APP_ARG(peer);
+		AST_APP_ARG(membername);
 		AST_APP_ARG(event);
 		AST_APP_ARG(params);
 	);
 
 	if (ast_strlen_zero(data)) {
-		ast_log(LOG_WARNING, "QueueLog requires arguments (queuename|uniqueid|peer|event[|additionalinfo]\n");
+		ast_log(LOG_WARNING, "QueueLog requires arguments (queuename|uniqueid|membername|event[|additionalinfo]\n");
 		return -1;
 	}
 
@@ -3212,13 +3237,13 @@
 	AST_STANDARD_APP_ARGS(args, parse);
 
 	if (ast_strlen_zero(args.queuename) || ast_strlen_zero(args.uniqueid)
-	    || ast_strlen_zero(args.peer) || ast_strlen_zero(args.event)) {
-		ast_log(LOG_WARNING, "QueueLog requires arguments (queuename|uniqueid|peer|event[|additionalinfo])\n");
+	    || ast_strlen_zero(args.membername) || ast_strlen_zero(args.event)) {
+		ast_log(LOG_WARNING, "QueueLog requires arguments (queuename|uniqueid|membername|event[|additionalinfo])\n");
 		ast_module_user_remove(u);
 		return -1;
 	}
 
-	ast_queue_log(args.queuename, args.uniqueid, args.peer, args.event, 
+	ast_queue_log(args.queuename, args.uniqueid, args.membername, args.event, 
 		"%s", args.params ? args.params : "");
 
 	ast_module_user_remove(u);
@@ -3365,7 +3390,7 @@
 					record_abandoned(&qe);
 					reason = QUEUE_TIMEOUT;
 					res = 0;
-					ast_queue_log(args.queuename, chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
+					ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
 					break;
 				}
 
@@ -3427,7 +3452,7 @@
 					record_abandoned(&qe);
 					reason = QUEUE_TIMEOUT;
 					res = 0;
-					ast_queue_log(args.queuename, chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
+					ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
 					break;
 				}
 
@@ -3667,14 +3692,20 @@
 	struct member *prev, *cur, *newm;
 	int new;
 	char *general_val = NULL;
-	char interface[80];
+	char parse[80];
+	char *interface;
+	char *membername;
 	int penalty;
+	AST_DECLARE_APP_ARGS(args,
+		AST_APP_ARG(interface);
+		AST_APP_ARG(penalty);
+		AST_APP_ARG(membername);
+	);
 	
 	if (!(cfg = ast_config_load("queues.conf"))) {
 		ast_log(LOG_NOTICE, "No call queueing config file (queues.conf), so no call queues\n");
 		return 0;
 	}
-	memset(interface, 0, sizeof(interface));
 	AST_LIST_LOCK(&queues);
 	use_weight=0;
 	/* Mark all queues as dead for the moment */
@@ -3724,10 +3755,14 @@
 				for (var = ast_variable_browse(cfg, cat); var; var = var->next) {
 					if (!strcasecmp(var->name, "member")) {
 						/* Add a new member */
-						ast_copy_string(interface, var->value, sizeof(interface));
-						if ((tmp = strchr(interface, ','))) {
-							*tmp = '\0';
-							tmp++;
+						ast_copy_string(parse, var->value, sizeof(parse));
+						
+						AST_NONSTANDARD_APP_ARGS(args, parse, ',');
+
+						interface = args.interface;
+						if(!ast_strlen_zero(args.penalty)) {
+							tmp = args.penalty;
+							while (*tmp && *tmp < 33) tmp++;
 							penalty = atoi(tmp);
 							if (penalty < 0) {
 								penalty = 0;
@@ -3735,6 +3770,12 @@
 						} else
 							penalty = 0;
 
+						if (!ast_strlen_zero(args.membername)) {
+							membername = args.membername;
+							while (*membername && *membername < 33) membername++;
+						} else
+							membername = interface;
+
 						/* Find the old position in the list */
 						for (prev = NULL, cur = q->members; cur; prev = cur, cur = cur->next) {
 							if (!strcmp(cur->interface, interface)) {
@@ -3742,7 +3783,7 @@
 							}
 						}
 
-						newm = create_queue_member(interface, penalty, cur ? cur->paused : 0);
+						newm = create_queue_member(interface, membername, penalty, cur ? cur->paused : 0);
 
 						if (cur) {
 							/* Delete it now */
@@ -4076,13 +4117,14 @@
 
 static int manager_add_queue_member(struct mansession *s, struct message *m)
 {
-	char *queuename, *interface, *penalty_s, *paused_s;
+	char *queuename, *interface, *penalty_s, *paused_s, *membername;
 	int paused, penalty = 0;
 
 	queuename = astman_get_header(m, "Queue");
 	interface = astman_get_header(m, "Interface");
 	penalty_s = astman_get_header(m, "Penalty");
 	paused_s = astman_get_header(m, "Paused");
+	membername = astman_get_header(m, "MemberName");
 
 	if (ast_strlen_zero(queuename)) {
 		astman_send_error(s, m, "'Queue' not specified.");
@@ -4104,7 +4146,10 @@
 	else
 		paused = abs(ast_true(paused_s));
 
-	switch (add_to_queue(queuename, interface, penalty, paused, queue_persistent_members)) {
+	if (ast_strlen_zero(membername))
+		membername = interface;
+
+	switch (add_to_queue(queuename, interface, membername, penalty, paused, queue_persistent_members)) {
 	case RES_OKAY:
 		astman_send_ack(s, m, "Added interface to queue");
 		break;
@@ -4177,20 +4222,22 @@
 
 static int handle_queue_add_member(int fd, int argc, char *argv[])
 {
-	char *queuename, *interface;
+	char *queuename, *interface, *membername;
 	int penalty;
 
-	if ((argc != 6) && (argc != 8)) {
+	if ((argc != 6) && (argc != 8) && (argc != 10)) {
 		return RESULT_SHOWUSAGE;
 	} else if (strcmp(argv[4], "to")) {
 		return RESULT_SHOWUSAGE;

[... 2910 lines stripped ...]


More information about the asterisk-commits mailing list