[asterisk-commits] dvossel: branch dvossel/hd_conferencing_ftw r308148 - in /team/dvossel/hd_con...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 16 09:28:54 CST 2011


Author: dvossel
Date: Wed Feb 16 09:28:47 2011
New Revision: 308148

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=308148
Log:
merge update

Modified:
    team/dvossel/hd_conferencing_ftw/   (props changed)
    team/dvossel/hd_conferencing_ftw/addons/ooh323c/src/ooSocket.c
    team/dvossel/hd_conferencing_ftw/apps/app_dial.c
    team/dvossel/hd_conferencing_ftw/apps/app_queue.c
    team/dvossel/hd_conferencing_ftw/channels/chan_dahdi.c
    team/dvossel/hd_conferencing_ftw/channels/chan_phone.c
    team/dvossel/hd_conferencing_ftw/channels/sig_pri.c
    team/dvossel/hd_conferencing_ftw/channels/sig_pri.h

Propchange: team/dvossel/hd_conferencing_ftw/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Propchange: team/dvossel/hd_conferencing_ftw/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Feb 16 09:28:47 2011
@@ -1,1 +1,1 @@
-/team/dvossel/fixtheworld_phase2:1-307925
+/team/dvossel/fixtheworld_phase2:1-308146

Modified: team/dvossel/hd_conferencing_ftw/addons/ooh323c/src/ooSocket.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_conferencing_ftw/addons/ooh323c/src/ooSocket.c?view=diff&rev=308148&r1=308147&r2=308148
==============================================================================
--- team/dvossel/hd_conferencing_ftw/addons/ooh323c/src/ooSocket.c (original)
+++ team/dvossel/hd_conferencing_ftw/addons/ooh323c/src/ooSocket.c Wed Feb 16 09:28:47 2011
@@ -191,7 +191,9 @@
 int ooSocketCreate (OOSOCKET* psocket) 
 {
    int on;
+#ifdef __linux__
    int keepalive = 1, keepcnt = 24, keepidle = 120, keepintvl = 30;
+#endif
    struct linger linger;
    OOSOCKET sock = socket (AF_INET,
                              SOCK_STREAM,
@@ -219,9 +221,11 @@
    }
    setsockopt (sock, SOL_SOCKET, SO_KEEPALIVE, (const char *)&keepalive,
 			sizeof(keepalive));
+#ifdef __linux__
    setsockopt (sock, SOL_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt));
    setsockopt (sock, SOL_TCP, TCP_KEEPIDLE, &keepidle, sizeof(keepidle));
    setsockopt (sock, SOL_TCP, TCP_KEEPINTVL, &keepintvl, sizeof(keepintvl));
+#endif
    *psocket = sock;
    return ASN_OK;
 }

Modified: team/dvossel/hd_conferencing_ftw/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_conferencing_ftw/apps/app_dial.c?view=diff&rev=308148&r1=308147&r2=308148
==============================================================================
--- team/dvossel/hd_conferencing_ftw/apps/app_dial.c (original)
+++ team/dvossel/hd_conferencing_ftw/apps/app_dial.c Wed Feb 16 09:28:47 2011
@@ -2115,7 +2115,7 @@
 			struct ast_party_connected_line connected;
 			int pres;
 
-			ast_party_connected_line_set_init(&connected, &tmp->chan->connected);
+			ast_party_connected_line_set_init(&connected, &tc->connected);
 			if (cid_pres) {
 				pres = ast_parse_caller_presentation(cid_pres);
 				if (pres < 0) {
@@ -2135,7 +2135,7 @@
 				connected.id.name.presentation = pres;
 			}
 			connected.id.tag = cid_tag;
-			ast_channel_set_connected_line(tmp->chan, &connected, NULL);
+			ast_channel_set_connected_line(tc, &connected, NULL);
 		} else {
 			ast_connected_line_copy_from_caller(&tc->connected, &chan->caller);
 		}

Modified: team/dvossel/hd_conferencing_ftw/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_conferencing_ftw/apps/app_queue.c?view=diff&rev=308148&r1=308147&r2=308148
==============================================================================
--- team/dvossel/hd_conferencing_ftw/apps/app_queue.c (original)
+++ team/dvossel/hd_conferencing_ftw/apps/app_queue.c Wed Feb 16 09:28:47 2011
@@ -3719,7 +3719,6 @@
 								ast_moh_stop(qe->chan);
 								ast_indicate(qe->chan, AST_CONTROL_RINGING);
 							}
-							ast_indicate(in, AST_CONTROL_RINGING);
 							break;
 						case AST_CONTROL_OFFHOOK:
 							/* Ignore going off hook */

Modified: team/dvossel/hd_conferencing_ftw/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_conferencing_ftw/channels/chan_dahdi.c?view=diff&rev=308148&r1=308147&r2=308148
==============================================================================
--- team/dvossel/hd_conferencing_ftw/channels/chan_dahdi.c (original)
+++ team/dvossel/hd_conferencing_ftw/channels/chan_dahdi.c Wed Feb 16 09:28:47 2011
@@ -14025,6 +14025,7 @@
 }
 #endif	/* defined(HAVE_PRI) */
 
+#if defined(HAVE_PRI)
 #if defined(HAVE_PRI_SERVICE_MESSAGES)
 static char *handle_pri_service_generic(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a, int changestatus)
 {
@@ -14168,6 +14169,36 @@
 	return handle_pri_service_generic(e, cmd, a, 2);
 }
 #endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
+#endif	/* defined(HAVE_PRI) */
+
+#if defined(HAVE_PRI)
+static char *handle_pri_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	int span;
+
+	switch (cmd) {
+	case CLI_INIT:
+		e->command = "pri show channels";
+		e->usage =
+			"Usage: pri show channels\n"
+			"       Displays PRI channel information\n";
+		return NULL;
+	case CLI_GENERATE:
+		return NULL;
+	}
+
+	if (a->argc != 3)
+		return CLI_SHOWUSAGE;
+
+	sig_pri_cli_show_channels_header(a->fd);
+	for (span = 0; span < NUM_SPANS; ++span) {
+		if (pris[span].pri.pri) {
+			sig_pri_cli_show_channels(a->fd, &pris[span].pri);
+		}
+	}
+	return CLI_SUCCESS;
+}
+#endif	/* defined(HAVE_PRI) */
 
 #if defined(HAVE_PRI)
 static char *handle_pri_show_spans(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
@@ -14179,7 +14210,7 @@
 		e->command = "pri show spans";
 		e->usage =
 			"Usage: pri show spans\n"
-			"       Displays PRI Information\n";
+			"       Displays PRI span information\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
@@ -14300,8 +14331,9 @@
  	AST_CLI_DEFINE(handle_pri_service_enable_channel, "Return a channel to service"),
  	AST_CLI_DEFINE(handle_pri_service_disable_channel, "Remove a channel from service"),
 #endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
-	AST_CLI_DEFINE(handle_pri_show_spans, "Displays PRI Information"),
-	AST_CLI_DEFINE(handle_pri_show_span, "Displays PRI Information"),
+	AST_CLI_DEFINE(handle_pri_show_channels, "Displays PRI channel information"),
+	AST_CLI_DEFINE(handle_pri_show_spans, "Displays PRI span information"),
+	AST_CLI_DEFINE(handle_pri_show_span, "Displays PRI span information"),
 	AST_CLI_DEFINE(handle_pri_show_debug, "Displays current PRI debug settings"),
 	AST_CLI_DEFINE(handle_pri_set_debug_file, "Sends PRI debug output to the specified file"),
 	AST_CLI_DEFINE(handle_pri_version, "Displays libpri version"),
@@ -14892,7 +14924,7 @@
 				}
 				break;
 			default:
-				;
+				break;
 			}
 		}
 		if (tmp->channel > 0) {

Modified: team/dvossel/hd_conferencing_ftw/channels/chan_phone.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_conferencing_ftw/channels/chan_phone.c?view=diff&rev=308148&r1=308147&r2=308148
==============================================================================
--- team/dvossel/hd_conferencing_ftw/channels/chan_phone.c (original)
+++ team/dvossel/hd_conferencing_ftw/channels/chan_phone.c Wed Feb 16 09:28:47 2011
@@ -819,7 +819,7 @@
 		} else {
 			int swap = 0;
 #if __BYTE_ORDER == __BIG_ENDIAN
-			if (frame->subclass.codec == AST_FORMAT_SLINEAR)
+			if (frame->subclass.format.id == AST_FORMAT_SLINEAR)
 				swap = 1; /* Swap big-endian samples to little-endian as we copy */
 #endif
 			res = phone_write_buf(p, pos, expected, maxfr, swap);

Modified: team/dvossel/hd_conferencing_ftw/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_conferencing_ftw/channels/sig_pri.c?view=diff&rev=308148&r1=308147&r2=308148
==============================================================================
--- team/dvossel/hd_conferencing_ftw/channels/sig_pri.c (original)
+++ team/dvossel/hd_conferencing_ftw/channels/sig_pri.c Wed Feb 16 09:28:47 2011
@@ -108,6 +108,25 @@
 	} while (0)
 
 static int pri_active_dchan_index(struct sig_pri_span *pri);
+
+static const char *sig_pri_call_level2str(enum sig_pri_call_level level)
+{
+	switch (level) {
+	case SIG_PRI_CALL_LEVEL_IDLE:
+		return "Idle";
+	case SIG_PRI_CALL_LEVEL_SETUP:
+		return "Setup";
+	case SIG_PRI_CALL_LEVEL_OVERLAP:
+		return "Overlap";
+	case SIG_PRI_CALL_LEVEL_PROCEEDING:
+		return "Proceeding";
+	case SIG_PRI_CALL_LEVEL_ALERTING:
+		return "Alerting";
+	case SIG_PRI_CALL_LEVEL_CONNECT:
+		return "Connect";
+	}
+	return "Unknown";
+}
 
 static inline void pri_rel(struct sig_pri_span *pri)
 {
@@ -7880,8 +7899,9 @@
 		}
 		if (pvt->call_level < SIG_PRI_CALL_LEVEL_CONNECT) {
 			ast_log(LOG_WARNING,
-				"Span %d: Digit '%c' may be ignored by peer. (Call level:%d)\n",
-				pvt->pri->span, digit, pvt->call_level);
+				"Span %d: Digit '%c' may be ignored by peer. (Call level:%d(%s))\n",
+				pvt->pri->span, digit, pvt->call_level,
+				sig_pri_call_level2str(pvt->call_level));
 		}
 	}
 	return 1;
@@ -8300,6 +8320,54 @@
 	ast_free(doomed);
 }
 
+#define SIG_PRI_SC_HEADER	"%-4s %4s %-4s %-10s %-4s %s\n"
+#define SIG_PRI_SC_LINE		"%4d %4d %-4s %-10s %-4s %s"
+void sig_pri_cli_show_channels_header(int fd)
+{
+	ast_cli(fd, SIG_PRI_SC_HEADER, "PRI",  "",     "B",    "Call",  "PRI",  "Channel");
+	ast_cli(fd, SIG_PRI_SC_HEADER, "Span", "Chan", "Chan", "Level", "Call", "Name");
+}
+
+void sig_pri_cli_show_channels(int fd, struct sig_pri_span *pri)
+{
+	char line[256];
+	int idx;
+	struct sig_pri_chan *pvt;
+
+	ast_mutex_lock(&pri->lock);
+	for (idx = 0; idx < pri->numchans; ++idx) {
+		if (!pri->pvts[idx]) {
+			continue;
+		}
+		pvt = pri->pvts[idx];
+		sig_pri_lock_private(pvt);
+		sig_pri_lock_owner(pri, idx);
+		if (pvt->no_b_channel && !pvt->call && !pvt->owner) {
+			/* Don't show held/call-waiting channels if they are not in use. */
+			sig_pri_unlock_private(pvt);
+			continue;
+		}
+
+		snprintf(line, sizeof(line), SIG_PRI_SC_LINE,
+			pri->span,
+			pvt->channel,
+			pvt->no_b_channel ? "No" : "Yes",/* Has media */
+			sig_pri_call_level2str(pvt->call_level),
+			pvt->call ? "Yes" : "No",
+			pvt->owner ? pvt->owner->name : "");
+
+		if (pvt->owner) {
+			ast_channel_unlock(pvt->owner);
+		}
+		sig_pri_unlock_private(pvt);
+
+		ast_mutex_unlock(&pri->lock);
+		ast_cli(fd, "%s\n", line);
+		ast_mutex_lock(&pri->lock);
+	}
+	ast_mutex_unlock(&pri->lock);
+}
+
 static void build_status(char *s, size_t len, int status, int active)
 {
 	if (!s || len < 1) {

Modified: team/dvossel/hd_conferencing_ftw/channels/sig_pri.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_conferencing_ftw/channels/sig_pri.h?view=diff&rev=308148&r1=308147&r2=308148
==============================================================================
--- team/dvossel/hd_conferencing_ftw/channels/sig_pri.h (original)
+++ team/dvossel/hd_conferencing_ftw/channels/sig_pri.h Wed Feb 16 09:28:47 2011
@@ -572,6 +572,8 @@
 
 int pri_is_up(struct sig_pri_span *pri);
 
+void sig_pri_cli_show_channels_header(int fd);
+void sig_pri_cli_show_channels(int fd, struct sig_pri_span *pri);
 void sig_pri_cli_show_spans(int fd, int span, struct sig_pri_span *pri);
 
 void sig_pri_cli_show_span(int fd, int *dchannels, struct sig_pri_span *pri);




More information about the asterisk-commits mailing list