[svn-commits] irroot: branch irroot/distrotech-customers-trunk r321672 - in /team/irroot/di...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jun 3 04:35:39 CDT 2011


Author: irroot
Date: Fri Jun  3 04:35:33 2011
New Revision: 321672

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=321672
Log:
resolve/automerge enable

Modified:
    team/irroot/distrotech-customers-trunk/   (props changed)
    team/irroot/distrotech-customers-trunk/addons/chan_ooh323.c
    team/irroot/distrotech-customers-trunk/addons/ooh323c/src/oochannels.c
    team/irroot/distrotech-customers-trunk/addons/ooh323c/src/ooh245.c
    team/irroot/distrotech-customers-trunk/cel/cel_odbc.c   (props changed)
    team/irroot/distrotech-customers-trunk/configs/cel_odbc.conf.sample   (props changed)
    team/irroot/distrotech-customers-trunk/configs/jabber.conf.sample
    team/irroot/distrotech-customers-trunk/configs/sip.conf.sample
    team/irroot/distrotech-customers-trunk/include/asterisk/acl.h
    team/irroot/distrotech-customers-trunk/include/asterisk/dnsmgr.h
    team/irroot/distrotech-customers-trunk/main/asterisk.c
    team/irroot/distrotech-customers-trunk/main/channel.c
    team/irroot/distrotech-customers-trunk/res/res_jabber.c
    team/irroot/distrotech-customers-trunk/sounds/Makefile   (props changed)

Propchange: team/irroot/distrotech-customers-trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Propchange: team/irroot/distrotech-customers-trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 04:35:33 2011
@@ -2,3 +2,4 @@
 /team/irroot/distrotech-customers:318992-318995,318997-319000
 /team/irroot/distrotech-customers-1.8:319062,319075,321526,321549-321550
 /team/irroot/t38gateway-trunk:318974-319016,319064,319067,319071,320879,321513
+/trunk:321462-321617

Modified: team/irroot/distrotech-customers-trunk/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/addons/chan_ooh323.c?view=diff&rev=321672&r1=321671&r2=321672
==============================================================================
--- team/irroot/distrotech-customers-trunk/addons/chan_ooh323.c (original)
+++ team/irroot/distrotech-customers-trunk/addons/chan_ooh323.c Fri Jun  3 04:35:33 2011
@@ -1093,6 +1093,7 @@
 static int ooh323_answer(struct ast_channel *ast)
 {
 	struct ooh323_pvt *p = ast->tech_pvt;
+	char *callToken = (char *)NULL;
 
 	if (gH323Debug)
 		ast_verbose("--- ooh323_answer\n");
@@ -1100,8 +1101,18 @@
 	if (p) {
 
 		ast_mutex_lock(&p->lock);
+		callToken = (p->callToken ? strdup(p->callToken) : NULL);
 		if (ast->_state != AST_STATE_UP) {
 			ast_channel_lock(ast);
+			if (!p->alertsent) {
+	    			if (gH323Debug) {
+					ast_debug(1, "Sending forced ringback for %s, res = %d\n", 
+						callToken, ooManualRingback(callToken));
+				} else {
+	    				ooManualRingback(callToken);
+				}
+				p->alertsent = 1;
+			}
 			ast_setstate(ast, AST_STATE_UP);
       			if (option_debug)
 				ast_debug(1, "ooh323_answer(%s)\n", ast->name);
@@ -1269,6 +1280,7 @@
 				}
 				p->alertsent = 1;
 			}
+			p->alertsent = 1;
 		}
 	 break;
 	case AST_CONTROL_SRCUPDATE:

Modified: team/irroot/distrotech-customers-trunk/addons/ooh323c/src/oochannels.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/addons/ooh323c/src/oochannels.c?view=diff&rev=321672&r1=321671&r2=321672
==============================================================================
--- team/irroot/distrotech-customers-trunk/addons/ooh323c/src/oochannels.c (original)
+++ team/irroot/distrotech-customers-trunk/addons/ooh323c/src/oochannels.c Fri Jun  3 04:35:33 2011
@@ -682,10 +682,11 @@
 
     if (0 != call->pH245Channel && 0 != call->pH245Channel->sock)
     {
-     if(call->pH245Channel->outQueue.count>0)
-     {                           
-      if(ooPDWrite(pfds, nfds, call->pH245Channel->sock))
-       ooSendMsg(call, OOH245MSG);
+     if(ooPDWrite(pfds, nfds, call->pH245Channel->sock)) {
+      while (call->pH245Channel->outQueue.count>0) {
+       if (ooSendMsg(call, OOH245MSG) != OO_OK)
+	break;
+      }
      }
     }
     else if(call->h245listener)
@@ -702,20 +703,23 @@
     {
      if(ooPDWrite(pfds, nfds, call->pH225Channel->sock))
      {
-      if(call->pH225Channel->outQueue.count>0)
+      while (call->pH225Channel->outQueue.count>0)
       {
        OOTRACEDBGC3("Sending H225 message (%s, %s)\n", 
                         call->callType, call->callToken);
-       ooSendMsg(call, OOQ931MSG);
+       if (ooSendMsg(call, OOQ931MSG) != OO_OK)
+	break;
       }
       if(call->pH245Channel && 
          call->pH245Channel->outQueue.count>0 && 
-        OO_TESTFLAG (call->flags, OO_M_TUNNELING))
-      {
+        OO_TESTFLAG (call->flags, OO_M_TUNNELING)) {
+       while (call->pH245Channel->outQueue.count>0) {
         OOTRACEDBGC3("H245 message needs to be tunneled. "
                           "(%s, %s)\n", call->callType, 
                                call->callToken);
-        ooSendMsg(call, OOH245MSG);
+        if (ooSendMsg(call, OOH245MSG) != OO_OK)
+	 break;
+       }
       }
      }                                
     }
@@ -1330,7 +1334,7 @@
    {
       OOTRACEDBGA3("Warning:Call marked for cleanup. Can not send message."
                    "(%s, %s)\n", call->callType, call->callToken);
-      return OO_OK;
+      return OO_FAILED;
    }
 
    if(type == OOQ931MSG)

Modified: team/irroot/distrotech-customers-trunk/addons/ooh323c/src/ooh245.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/addons/ooh323c/src/ooh245.c?view=diff&rev=321672&r1=321671&r2=321672
==============================================================================
--- team/irroot/distrotech-customers-trunk/addons/ooh323c/src/ooh245.c (original)
+++ team/irroot/distrotech-customers-trunk/addons/ooh323c/src/ooh245.c Fri Jun  3 04:35:33 2011
@@ -2126,6 +2126,8 @@
                ooClearAllLogicalChannels(call);
             }
             ooSendEndSessionCommand(call);
+	    if (call->callState < OO_CALL_CLEAR)
+	        call->callState = OO_CALL_CLEAR;
          }
             
             

Propchange: team/irroot/distrotech-customers-trunk/cel/cel_odbc.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 04:35:33 2011
@@ -3,3 +3,4 @@
 /team/irroot/distrotech-customers/cel/cel_odbc.c:318992-319000
 /team/irroot/distrotech-customers-1.8/cel/cel_odbc.c:319062,319075,321526,321549-321550
 /team/irroot/t38gateway-trunk/cel/cel_odbc.c:318974-319016,319064,319067,319071,319361,320879-321541
+/trunk/cel/cel_odbc.c:321462-321617

Propchange: team/irroot/distrotech-customers-trunk/configs/cel_odbc.conf.sample
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 04:35:33 2011
@@ -3,3 +3,4 @@
 /team/irroot/distrotech-customers/configs/cel_odbc.conf.sample:318992-319000
 /team/irroot/distrotech-customers-1.8/configs/cel_odbc.conf.sample:319062,319075,321526,321549-321550
 /team/irroot/t38gateway-trunk/configs/cel_odbc.conf.sample:318974-319016,319064,319067,319071,319361,320879-321541
+/trunk/configs/cel_odbc.conf.sample:321462-321617

Modified: team/irroot/distrotech-customers-trunk/configs/jabber.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/configs/jabber.conf.sample?view=diff&rev=321672&r1=321671&r2=321672
==============================================================================
--- team/irroot/distrotech-customers-trunk/configs/jabber.conf.sample (original)
+++ team/irroot/distrotech-customers-trunk/configs/jabber.conf.sample Fri Jun  3 04:35:33 2011
@@ -34,3 +34,6 @@
 					; Messages stored longer than this value will be deleted by Asterisk.
 					; This option applies to incoming messages only, which are intended to
 					; be processed by the JABBER_RECEIVE dialplan function.
+;sendtodialplan=yes			; Send incoming messages into the dialplan.  Off by default.
+;context=messages			; Dialplan context to send incoming messages to.  If not set,
+					; "default" will be used.

Modified: team/irroot/distrotech-customers-trunk/configs/sip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/configs/sip.conf.sample?view=diff&rev=321672&r1=321671&r2=321672
==============================================================================
--- team/irroot/distrotech-customers-trunk/configs/sip.conf.sample (original)
+++ team/irroot/distrotech-customers-trunk/configs/sip.conf.sample Fri Jun  3 04:35:33 2011
@@ -384,6 +384,16 @@
 
 ;auth_options_requests = yes    ; Enabling this option will authenticate OPTIONS requests just like
                                 ; INVITE requests are.  By default this option is disabled.
+
+;accept_outofcall_message = no  ; Disable this option to reject all MESSAGE requests outside of a
+                                ; call.  By default, this option is enabled.  When enabled, MESSAGE
+                                ; requests are passed in to the dialplan.
+
+;auth_message_requests = yes    ; Enabling this option will authenticate MESSAGE requests.
+                                ; By default this option is enabled.  However, it can be disabled
+                                ; should an application desire to not load the Asterisk server with
+                                ; doing authentication and implement end to end security in the
+                                ; message body.
 
 ;g726nonstandard = yes          ; If the peer negotiates G726-32 audio, use AAL2 packing
                                 ; order instead of RFC3551 packing order (this is required

Modified: team/irroot/distrotech-customers-trunk/include/asterisk/acl.h
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/include/asterisk/acl.h?view=diff&rev=321672&r1=321671&r2=321672
==============================================================================
--- team/irroot/distrotech-customers-trunk/include/asterisk/acl.h (original)
+++ team/irroot/distrotech-customers-trunk/include/asterisk/acl.h Fri Jun  3 04:35:33 2011
@@ -143,7 +143,7 @@
  * then this function acts exactly like a call to ast_get_ip.
  *
  * \param addr The IP address found.  The address family is used as an input parameter to
- * filter the returned adresses. if it is 0, both IPv4 and IPv6 addresses
+ * filter the returned addresses. if it is 0, both IPv4 and IPv6 addresses
  * can be returned.
  *
  * \param value The hostname to look up

Modified: team/irroot/distrotech-customers-trunk/include/asterisk/dnsmgr.h
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/include/asterisk/dnsmgr.h?view=diff&rev=321672&r1=321671&r2=321672
==============================================================================
--- team/irroot/distrotech-customers-trunk/include/asterisk/dnsmgr.h (original)
+++ team/irroot/distrotech-customers-trunk/include/asterisk/dnsmgr.h Fri Jun  3 04:35:33 2011
@@ -68,11 +68,13 @@
  * \brief Allocate and initialize a DNS manager entry
  *
  * \param name the hostname
- * \param result where to store the IP address as the DNS manager refreshes it. The address family
- * is used as an input parameter to filter the returned adresses. if it is 0, both IPv4 * and IPv6 addresses can be returned.
+ * \param result where to store the IP address as the DNS manager refreshes it.
+ * The address family is used as an input parameter to filter the returned addresses.
+ * If it is 0, both IPv4 and IPv6 addresses can be returned.
  * \param dnsmgr Where to store the allocate DNS manager entry
  * \param service
  *
+ * \note
  * This function allocates a new DNS manager entry object, and fills it with
  * the provided hostname and IP address.  This function _does_ force an initial
  * lookup, so it may block for some period of time.

Modified: team/irroot/distrotech-customers-trunk/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/main/asterisk.c?view=diff&rev=321672&r1=321671&r2=321672
==============================================================================
--- team/irroot/distrotech-customers-trunk/main/asterisk.c (original)
+++ team/irroot/distrotech-customers-trunk/main/asterisk.c Fri Jun  3 04:35:33 2011
@@ -3750,6 +3750,11 @@
 	ast_xmldoc_load_documentation();
 #endif
 
+	if (ast_msg_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
 	/* initialize the data retrieval API */
 	if (ast_data_init()) {
 		printf ("%s", term_quit());

Modified: team/irroot/distrotech-customers-trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/main/channel.c?view=diff&rev=321672&r1=321671&r2=321672
==============================================================================
--- team/irroot/distrotech-customers-trunk/main/channel.c (original)
+++ team/irroot/distrotech-customers-trunk/main/channel.c Fri Jun  3 04:35:33 2011
@@ -9618,3 +9618,8 @@
 
 	return result;
 }
+
+void ast_channel_unlink(struct ast_channel *chan)
+{
+	ao2_unlink(channels, chan);
+}

Modified: team/irroot/distrotech-customers-trunk/res/res_jabber.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/res/res_jabber.c?view=diff&rev=321672&r1=321671&r2=321672
==============================================================================
--- team/irroot/distrotech-customers-trunk/res/res_jabber.c (original)
+++ team/irroot/distrotech-customers-trunk/res/res_jabber.c Fri Jun  3 04:35:33 2011
@@ -60,6 +60,7 @@
 #include "asterisk/manager.h"
 #include "asterisk/event.h"
 #include "asterisk/devicestate.h"
+#include "asterisk/message.h"
 
 /*** DOCUMENTATION
 	<application name="JabberSend" language="en_US">
@@ -373,6 +374,13 @@
 static int aji_register_transport2(void *data, ikspak *pak);
 */
 
+static int msg_send_cb(const struct ast_msg *msg, const char *to, const char *from);
+
+static const struct ast_msg_tech msg_tech = {
+	.name = "xmpp",
+	.msg_send = msg_send_cb,
+};
+
 static struct ast_cli_entry aji_cli[] = {
 	AST_CLI_DEFINE(aji_do_set_debug, "Enable/Disable Jabber debug"),
 	AST_CLI_DEFINE(aji_do_reload, "Reload Jabber configuration"),
@@ -1134,6 +1142,44 @@
 		ast_aji_send_chat(client, args.recipient, args.message);
 	}
 	return 0;
+}
+
+static int msg_send_cb(const struct ast_msg *msg, const char *to, const char *from)
+{
+	struct aji_client *client;
+	char *sender;
+	char *dest;
+	int res;
+
+	sender = ast_strdupa(from);
+	strsep(&sender, ":");
+	dest = ast_strdupa(to);
+	strsep(&dest, ":");
+
+	if (ast_strlen_zero(sender)) {
+		ast_log(LOG_ERROR, "MESSAGE(from) of '%s' invalid for xmpp\n", from);
+		return -1;
+	}
+
+	if (!(client = ast_aji_get_client(sender))) {
+		ast_log(LOG_WARNING, "Could not finder account to send from as '%s'\n", sender);
+		return -1;
+	}
+
+
+	ast_debug(1, "Sending message to '%s' from '%s'\n", dest, client->name);
+
+	res = ast_aji_send_chat(client, dest, ast_msg_get_body(msg));
+	if (res != IKS_OK) {
+		ast_log(LOG_WARNING, "Failed to send xmpp message (%d).\n", res);
+	}
+
+	/* 
+	 * XXX Reference leak here.  See note with ast_aji_get_client() about the problems
+	 * with that function.
+	 */
+
+	return res == IKS_OK ? 0 : -1;
 }
 
 /*!
@@ -2218,6 +2264,7 @@
 {
 	struct aji_message *insert;
 	int deleted = 0;
+	struct ast_msg *msg;
 
 	ast_debug(3, "client %s received a message\n", client->name);
 
@@ -2246,6 +2293,23 @@
 			return;
 		}
 		ast_debug(3, "message comes from %s\n", insert->from);
+	}
+
+	if ((msg = ast_msg_alloc())) {
+		int res;
+
+		res = ast_msg_set_to(msg, "xmpp:%s", client->user);
+		res |= ast_msg_set_from(msg, "xmpp:%s", insert->from);
+		res |= ast_msg_set_body(msg, "%s", insert->message);
+		res |= ast_msg_set_context(msg, "%s", client->context);
+
+		if (res) {
+			ast_msg_destroy(msg);
+		} else {
+			ast_msg_queue(msg);
+		}
+
+		msg = NULL;
 	}
 
 	/* remove old messages received from this JID
@@ -4248,6 +4312,7 @@
 	ASTOBJ_CONTAINER_MARKALL(&client->buddies);
 	ast_copy_string(client->name, label, sizeof(client->name));
 	ast_copy_string(client->mid, "aaaaa", sizeof(client->mid));
+	ast_copy_string(client->context, "default", sizeof(client->context));
 
 	/* Set default values for the client object */
 	client->debug = debug;
@@ -4265,6 +4330,7 @@
 	ast_copy_string(client->statusmessage, "Online and Available", sizeof(client->statusmessage));
 	client->priority = 0;
 	client->status = IKS_SHOW_AVAILABLE;
+	client->send_to_dialplan = 0;
 
 	if (flag) {
 		client->authorized = 0;
@@ -4356,6 +4422,10 @@
 			} else {
 				ast_log(LOG_WARNING, "Unknown presence status: %s\n", var->value);
 			}
+		} else if (!strcasecmp(var->name, "context")) {
+			ast_copy_string(client->context, var->value, sizeof(client->context));
+		} else if (!strcasecmp(var->name, "sendtodialplan")) {
+			client->send_to_dialplan = ast_true(var->value) ? 1 : 0;
 		}
 	/* no transport support in this version */
 	/*	else if (!strcasecmp(var->name, "transport"))
@@ -4553,6 +4623,13 @@
  * (without the resource string)
  * \param name label or JID
  * \return aji_client.
+ *
+ * XXX \bug This function leads to reference leaks all over the place.
+ *          ASTOBJ_CONTAINER_FIND() returns a reference, but if the
+ *          client is found via the traversal, no reference is returned.
+ *          None of the calling code releases references.  This code needs
+ *          to be changed to always return a reference, and all of the users
+ *          need to be fixed to release them.
  */
 struct aji_client *ast_aji_get_client(const char *name)
 {
@@ -4668,7 +4745,7 @@
  */
 static int unload_module(void)
 {
-
+	ast_msg_tech_unregister(&msg_tech);
 	ast_cli_unregister_multiple(aji_cli, ARRAY_LEN(aji_cli));
 	ast_unregister_application(app_ajisend);
 	ast_unregister_application(app_ajisendgroup);
@@ -4721,6 +4798,7 @@
 	ast_cli_register_multiple(aji_cli, ARRAY_LEN(aji_cli));
 	ast_custom_function_register(&jabberstatus_function);
 	ast_custom_function_register(&jabberreceive_function);
+	ast_msg_tech_register(&msg_tech);
 
 	ast_mutex_init(&messagelock);
 	ast_cond_init(&message_received_condition, NULL);

Propchange: team/irroot/distrotech-customers-trunk/sounds/Makefile
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun  3 04:35:33 2011
@@ -3,3 +3,4 @@
 /team/irroot/distrotech-customers/sounds/Makefile:318992-319000
 /team/irroot/distrotech-customers-1.8/sounds/Makefile:319062,319075,321526,321549-321550
 /team/irroot/t38gateway-trunk/sounds/Makefile:318974-319016,319064,319067,319071,319361,320879-321541
+/trunk/sounds/Makefile:321462-321617




More information about the svn-commits mailing list