[svn-commits] jpeeler: branch may/chan_ooh323_rework r226527 - in /team/may/chan_ooh323_rew...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Oct 29 11:41:59 CDT 2009


Author: jpeeler
Date: Thu Oct 29 11:41:55 2009
New Revision: 226527

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=226527
Log:
sync with trunk so the reviewboard diff can be updated

Modified:
    team/may/chan_ooh323_rework/   (props changed)
    team/may/chan_ooh323_rework/Makefile
    team/may/chan_ooh323_rework/UPGRADE-1.6.txt   (props changed)
    team/may/chan_ooh323_rework/UPGRADE.txt   (props changed)
    team/may/chan_ooh323_rework/build_tools/get_documentation
    team/may/chan_ooh323_rework/channels/chan_local.c
    team/may/chan_ooh323_rework/channels/chan_sip.c
    team/may/chan_ooh323_rework/configs/sip.conf.sample
    team/may/chan_ooh323_rework/doc/lang/language-criteria.txt   (props changed)
    team/may/chan_ooh323_rework/doc/tex/channelvariables.tex
    team/may/chan_ooh323_rework/include/asterisk/linkedlists.h
    team/may/chan_ooh323_rework/main/editline/makelist.in   (props changed)
    team/may/chan_ooh323_rework/main/manager.c
    team/may/chan_ooh323_rework/res/res_http_post.c

Propchange: team/may/chan_ooh323_rework/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Oct 29 11:41:55 2009
@@ -1,1 +1,1 @@
-//team/may/chan_ooh323_rework:1-225766 /trunk:1-224772
+//team/may/chan_ooh323_rework:1-225766 /trunk:1-226526

Modified: team/may/chan_ooh323_rework/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_rework/Makefile?view=diff&rev=226527&r1=226526&r2=226527
==============================================================================
--- team/may/chan_ooh323_rework/Makefile (original)
+++ team/may/chan_ooh323_rework/Makefile Thu Oct 29 11:41:55 2009
@@ -305,7 +305,8 @@
 
 ifneq ($(findstring darwin,$(OSARCH)),)
   _ASTCFLAGS+=-D__Darwin__
-  SOLINK=-bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
+  SOLINK=-bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace /usr/lib/bundle1.o
+  _ASTLDFLAGS+= /usr/lib/bundle1.o -L/usr/local/lib
 else
 # These are used for all but Darwin
   SOLINK=-shared

Propchange: team/may/chan_ooh323_rework/UPGRADE-1.6.txt
            ('svn:mergeinfo' removed)

Propchange: team/may/chan_ooh323_rework/UPGRADE.txt
            ('svn:mergeinfo' removed)

Modified: team/may/chan_ooh323_rework/build_tools/get_documentation
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_rework/build_tools/get_documentation?view=diff&rev=226527&r1=226526&r2=226527
==============================================================================
--- team/may/chan_ooh323_rework/build_tools/get_documentation (original)
+++ team/may/chan_ooh323_rework/build_tools/get_documentation Thu Oct 29 11:41:55 2009
@@ -1,3 +1,3 @@
 /\/\*\*\* DOCUMENTATION/ {printit=1; next}
 /\*\*\*\// {if (printit) exit}
-// {if (printit) print}
+{if (printit) print}

Modified: team/may/chan_ooh323_rework/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_rework/channels/chan_local.c?view=diff&rev=226527&r1=226526&r2=226527
==============================================================================
--- team/may/chan_ooh323_rework/channels/chan_local.c (original)
+++ team/may/chan_ooh323_rework/channels/chan_local.c Thu Oct 29 11:41:55 2009
@@ -98,18 +98,25 @@
 	.bridged_channel = local_bridgedchannel,
 };
 
+/*! \brief the local pvt structure for all channels
+
+	The local channel pvt has two ast_chan objects - the "owner" and the "next channel", the outbound channel
+
+	ast_chan owner -> local_pvt -> ast_chan chan -> yet-another-pvt-depending-on-channel-type
+
+*/
 struct local_pvt {
-	ast_mutex_t lock;			/* Channel private lock */
-	unsigned int flags;                     /* Private flags */
-	char context[AST_MAX_CONTEXT];		/* Context to call */
-	char exten[AST_MAX_EXTENSION];		/* Extension to call */
-	int reqformat;				/* Requested format */
+	ast_mutex_t lock;			/*!< Channel private lock */
+	unsigned int flags;                     /*!< Private flags */
+	char context[AST_MAX_CONTEXT];		/*!< Context to call */
+	char exten[AST_MAX_EXTENSION];		/*!< Extension to call */
+	int reqformat;				/*!< Requested format */
 	struct ast_jb_conf jb_conf;		/*!< jitterbuffer configuration for this local channel */
-	struct ast_channel *owner;		/* Master Channel - Bridging happens here */
-	struct ast_channel *chan;		/* Outbound channel - PBX is run here */
-	struct ast_module_user *u_owner;	/*! reference to keep the module loaded while in use */
-	struct ast_module_user *u_chan;		/*! reference to keep the module loaded while in use */
-	AST_LIST_ENTRY(local_pvt) list;		/* Next entity */
+	struct ast_channel *owner;		/*!< Master Channel - Bridging happens here */
+	struct ast_channel *chan;		/*!< Outbound channel - PBX is run here */
+	struct ast_module_user *u_owner;	/*!< reference to keep the module loaded while in use */
+	struct ast_module_user *u_chan;		/*!< reference to keep the module loaded while in use */
+	AST_LIST_ENTRY(local_pvt) list;		/*!< Next entity */
 };
 
 #define LOCAL_GLARE_DETECT    (1 << 0) /*!< Detect glare on hangup */

Modified: team/may/chan_ooh323_rework/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_rework/channels/chan_sip.c?view=diff&rev=226527&r1=226526&r2=226527
==============================================================================
--- team/may/chan_ooh323_rework/channels/chan_sip.c (original)
+++ team/may/chan_ooh323_rework/channels/chan_sip.c Thu Oct 29 11:41:55 2009
@@ -1995,6 +1995,7 @@
 		AST_STRING_FIELD(useragent);		/*!<  User agent in SIP request (saved from registration) */
 		AST_STRING_FIELD(mwi_from);         /*!< Name to place in From header for outgoing NOTIFY requests */
 		AST_STRING_FIELD(engine);               /*!<  RTP Engine to use */
+		AST_STRING_FIELD(unsolicited_mailbox);  /*!< Mailbox to store received unsolicited MWI NOTIFY messages information in */
 		);
 	struct sip_socket socket;	/*!< Socket used for this peer */
 	enum sip_transport default_outbound_transport;    /*!< Peer Registration may change the default outbound transport.
@@ -7628,10 +7629,6 @@
 		if (intended_method == SIP_REFER) {
 			/* We do support REFER, but not outside of a dialog yet */
 			transmit_response_using_temp(callid, sin, 1, intended_method, req, "603 Declined (no dialog)");
-		} else if (intended_method == SIP_NOTIFY) {
-			/* We do not support out-of-dialog NOTIFY either,
-		   	like voicemail notification, so cancel that early */
-			transmit_response_using_temp(callid, sin, 1, intended_method, req, "489 Bad event");
 		} else {
 			/* Ok, time to create a new SIP dialog object, a pvt */
 			if ((p = sip_alloc(callid, sin, 1, intended_method, req)))  {
@@ -19829,25 +19826,39 @@
 		}
 		/* Confirm that we received this packet */
 		transmit_response(p, "200 OK", req);
-	} else if (p->mwi && !strcmp(event, "message-summary")) {
+	} else if (!strcmp(event, "message-summary")) {
+		const char *mailbox = NULL;
 		char *c = ast_strdupa(get_body(req, "Voice-Message", ':'));
 
-		if (!ast_strlen_zero(c)) {
+		if (!p->mwi) {
+			struct sip_peer *peer = find_peer(NULL, &p->recv, TRUE, FINDPEERS, FALSE, p->socket.type);
+
+			if (peer) {
+				mailbox = ast_strdupa(peer->unsolicited_mailbox);
+				unref_peer(peer, "removing unsolicited mwi ref");
+			}
+		} else {
+			mailbox = p->mwi->mailbox;
+		}
+
+		if (!ast_strlen_zero(mailbox) && !ast_strlen_zero(c)) {
 			char *old = strsep(&c, " ");
 			char *new = strsep(&old, "/");
 			struct ast_event *event;
 
 			if ((event = ast_event_new(AST_EVENT_MWI,
-						   AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, p->mwi->mailbox,
+						   AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
 						   AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, "SIP_Remote",
 						   AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, atoi(new),
 						   AST_EVENT_IE_OLDMSGS, AST_EVENT_IE_PLTYPE_UINT, atoi(old),
 						   AST_EVENT_IE_END))) {
 				ast_event_queue_and_cache(event);
 			}
-		}
-
-		transmit_response(p, "200 OK", req);
+			transmit_response(p, "200 OK", req);
+		} else {
+			transmit_response(p, "489 Bad event", req);
+			res = -1;
+		}
 	} else if (!strcmp(event, "keep-alive")) {
 		 /* Used by Sipura/Linksys for NAT pinhole,
 		  * just confirm that we recieved the packet. */
@@ -24897,6 +24908,8 @@
 			} else if (!strcasecmp(v->name, "disallowed_methods")) {
 				char *disallow = ast_strdupa(v->value);
 				mark_parsed_methods(&peer->disallowed_methods, disallow);
+			} else if (!strcasecmp(v->name, "unsolicited_mailbox")) {
+				ast_string_field_set(peer, unsolicited_mailbox, v->value);
 			}
 		}
 

Modified: team/may/chan_ooh323_rework/configs/sip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_rework/configs/sip.conf.sample?view=diff&rev=226527&r1=226526&r2=226527
==============================================================================
--- team/may/chan_ooh323_rework/configs/sip.conf.sample (original)
+++ team/may/chan_ooh323_rework/configs/sip.conf.sample Thu Oct 29 11:41:55 2009
@@ -730,6 +730,13 @@
                                 ; at call setup (a new feature in 1.4 - setting up the
                                 ; call directly between the endpoints instead of sending
                                 ; a re-INVITE).
+
+                                ; Additionally this option does not disable all reINVITE operations.
+                                ; It only controls Asterisk generating reINVITEs for the specific
+                                ; purpose of setting up a direct media path. If a reINVITE is
+                                ; needed to switch a media stream to inactive (when placed on
+                                ; hold) or to T.38, it will still be done, regardless of this 
+                                ; setting.
 
 ;directmedia=nonat              ; An additional option is to allow media path redirection
                                 ; (reinvite) but only when the peer where the media is being
@@ -975,6 +982,7 @@
 ; contactdeny           ; is to register at the same IP as a SIP provider,
 ;                       ; then call oneself, and get redirected to that
 ;                       ; same location).
+; unsolicited_mailbox
 
 ;[sip_proxy]
 ; For incoming calls only. Example: FWD (Free World Dialup)
@@ -1015,6 +1023,10 @@
 ;transport=udp,tcp                ; This sets the transport type to udp for outgoing, and will
 ;                                 ;   accept both tcp and udp. Default is udp. The first transport
 ;                                 ;   listed will always be used for outgoing connections.
+;unsolicited_mailbox=4015552299   ; If the remote SIP server sends an unsolicited MWI NOTIFY message the new/old
+;                                 ;   message count will be stored in the configured virtual mailbox. It can be used
+;                                 ;   by any device supporting MWI by specifying <configured value>@SIP_Remote as the
+;                                 ;   mailbox.
 
 ;
 ; Because you might have a large number of similar sections, it is generally

Propchange: team/may/chan_ooh323_rework/doc/lang/language-criteria.txt
            ('svn:mergeinfo' removed)

Modified: team/may/chan_ooh323_rework/doc/tex/channelvariables.tex
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_rework/doc/tex/channelvariables.tex?view=diff&rev=226527&r1=226526&r2=226527
==============================================================================
--- team/may/chan_ooh323_rework/doc/tex/channelvariables.tex (original)
+++ team/may/chan_ooh323_rework/doc/tex/channelvariables.tex Thu Oct 29 11:41:55 2009
@@ -918,7 +918,7 @@
 ${CALLEDTON}          * Type of number for incoming PRI extension
                         i.e. 0=unknown, 1=international, 2=domestic, 3=net_specific,
                         4=subscriber, 6=abbreviated, 7=reserved
-${CALLINGSUBADDR}     * Called PRI Subaddress
+${CALLINGSUBADDR}     * Caller's PRI Subaddress
 ${FAXEXTEN}           * The extension called before being redirected to "fax"
 ${PRIREDIRECTREASON}  * Reason for redirect, if a call was directed
 ${SMDI_VM_TYPE}       * When an call is received with an SMDI message, the 'type'

Modified: team/may/chan_ooh323_rework/include/asterisk/linkedlists.h
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_rework/include/asterisk/linkedlists.h?view=diff&rev=226527&r1=226526&r2=226527
==============================================================================
--- team/may/chan_ooh323_rework/include/asterisk/linkedlists.h (original)
+++ team/may/chan_ooh323_rework/include/asterisk/linkedlists.h Thu Oct 29 11:41:55 2009
@@ -443,8 +443,8 @@
  * \brief Checks whether the specified list contains any entries.
  * \param head This is a pointer to the list head structure
  *
- * \return non-zero if the list has entries
- * \return zero if not.
+ * \return zero if the list has entries
+ * \return non-zero if not.
  */
 #define	AST_LIST_EMPTY(head)	(AST_LIST_FIRST(head) == NULL)
 

Propchange: team/may/chan_ooh323_rework/main/editline/makelist.in
            ('svn:mergeinfo' removed)

Modified: team/may/chan_ooh323_rework/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_rework/main/manager.c?view=diff&rev=226527&r1=226526&r2=226527
==============================================================================
--- team/may/chan_ooh323_rework/main/manager.c (original)
+++ team/may/chan_ooh323_rework/main/manager.c Thu Oct 29 11:41:55 2009
@@ -4878,9 +4878,12 @@
 
 	if (s.f != NULL) {	/* have temporary output */
 		char *buf;
-		size_t l = ftell(s.f);
-
-		if (l) {
+		size_t l;
+
+		/* Ensure buffer is NULL-terminated */
+		fprintf(s.f, "%c", 0);
+
+		if ((l = ftell(s.f))) {
 			if (MAP_FAILED == (buf = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_PRIVATE, s.fd, 0))) {
 				ast_log(LOG_WARNING, "mmap failed.  Manager output was not processed\n");
 			} else {

Modified: team/may/chan_ooh323_rework/res/res_http_post.c
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_rework/res/res_http_post.c?view=diff&rev=226527&r1=226526&r2=226527
==============================================================================
--- team/may/chan_ooh323_rework/res/res_http_post.c (original)
+++ team/may/chan_ooh323_rework/res/res_http_post.c Thu Oct 29 11:41:55 2009
@@ -445,7 +445,7 @@
 
 			urih->description = ast_strdup("HTTP POST mapping");
 			urih->uri = ast_strdup(v->name);
-			ast_str_set(&ds, 0, "%s/%s", prefix, v->value);
+			ast_str_set(&ds, 0, "%s", v->value);
 			urih->data = ds;
 			urih->has_subtree = 0;
 			urih->callback = http_post_callback;




More information about the svn-commits mailing list