[svn-commits] seanbright: branch seanbright/resolve-shadow-warnings r121590 - in /team/sean...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 10 10:41:25 CDT 2008


Author: seanbright
Date: Tue Jun 10 10:41:24 2008
New Revision: 121590

URL: http://svn.digium.com/view/asterisk?view=rev&rev=121590
Log:
Merged revisions 121334,121365,121367,121401-121403,121407,121439,121441,121444,121496,121501,121503,121555,121559 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r121334 | tilghman | 2008-06-09 15:33:23 -0400 (Mon, 09 Jun 2008) | 3 lines

Add storage of the useragent in the realtime database.
(Closes AST-38)

................
r121365 | twilson | 2008-06-09 18:42:08 -0400 (Mon, 09 Jun 2008) | 2 lines

Initialize the lock and destroy lock and cond in the destructor (thanks, mmichelson)

................
r121367 | tilghman | 2008-06-09 18:51:59 -0400 (Mon, 09 Jun 2008) | 2 lines

Expand RQ_INTEGER type out to multiple types, one for each precision

................
r121401 | russell | 2008-06-09 20:29:01 -0400 (Mon, 09 Jun 2008) | 2 lines

Change system header includes to be like how it is done in other files

................
r121402 | russell | 2008-06-09 20:31:30 -0400 (Mon, 09 Jun 2008) | 2 lines

Properly initialize the cli_ping condition and lock

................
r121403 | russell | 2008-06-09 20:43:06 -0400 (Mon, 09 Jun 2008) | 4 lines

Merge a couple of configure script checks in from team/russell/events.  This adds
the checks for the CLM and EVT services from the SAForum AIS.  I'm going to work
on merging in changes from this branch in pieces.

................
r121407 | russell | 2008-06-09 20:52:46 -0400 (Mon, 09 Jun 2008) | 2 lines

Bump up the debug level of a couple of messages

................
r121439 | russell | 2008-06-10 08:48:50 -0400 (Tue, 10 Jun 2008) | 13 lines

Merge another change from team/russell/events ...

DUNDi uses a concept called the Entity ID for unique server identifiers.  I have
pulled out the handling of EIDs and made it something available to all of Asterisk.
There is now a global Entity ID that can be used for other purposes as well, such
as code providing distributed device state, which is why I did this.  The global
Entity ID is set automatically, just like it was done in DUNDi, but it can also be
set in asterisk.conf.  DUNDi will now use this global EID unless one is specified
in dundi.conf.

The current EID for the system can be seen in the "core show settings" CLI command.
It is also available in the dialplan via the ENTITYID variable.

................
r121441 | russell | 2008-06-10 08:50:07 -0400 (Tue, 10 Jun 2008) | 3 lines

Update dundi.conf to indicate that the asterisk.conf entityid option can be used
to set the entityid used in DUNDi, as well.

................
r121444 | file | 2008-06-10 08:54:39 -0400 (Tue, 10 Jun 2008) | 12 lines

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

........
r121442 | file | 2008-06-10 09:52:06 -0300 (Tue, 10 Jun 2008) | 4 lines

Update BRIDGEPEER variable before we do a generic bridge in case we just broke out of a native bridge and fell through to generic.
(closes issue #12815)
Reported by: ramonpeek

........

................
r121496 | file | 2008-06-10 09:36:13 -0400 (Tue, 10 Jun 2008) | 12 lines

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

........
r121495 | file | 2008-06-10 10:34:27 -0300 (Tue, 10 Jun 2008) | 4 lines

If we are destroying a dialog only set the MWI dialog pointer on the related peer to NULL if it is the dialog currently being destroyed.
(closes issue #12828)
Reported by: ramonpeek

........

................
r121501 | russell | 2008-06-10 10:06:29 -0400 (Tue, 10 Jun 2008) | 9 lines

Merge another change from team/russell/events

This commit breaks out some logic from pbx.c into a simple API.  The hint
processing code had logic for taking the state from multiple devices and
turning that into the state for a single extension.  So, I broke this out
and made an API that lets you take multiple device states and determine
the aggregate device state.  I needed this for some core device state changes
to support distributed device state.

................
r121503 | file | 2008-06-10 10:11:16 -0400 (Tue, 10 Jun 2008) | 7 lines

Fix issue where session timer headers were present when they should not have been.
(closes issue #12706)
Reported by: falves11
Patches:
      chan_sip.c.diff uploaded by rjain (license 226)
Tested by: falves11

................
r121555 | russell | 2008-06-10 10:53:40 -0400 (Tue, 10 Jun 2008) | 22 lines

Merge some more changes from team/russell/events

This commit pulls in a batch of improvements and additions to the event API.
Changes include:
 - the ability to dynamically build a subscription.  This is useful if you're
    building a subscription based on something you receive from the network,
    or from options in a configuration file.
 - Add tables of event types and IE types and the corresponding string
    representation for implementing text based protocols that use these
	events, for showing events on the CLI, reading configuration that
	references event information, among other things.
 - Add a table that maps IE types and the corresponding payload type.
 - an API call to get the total size of an event
 - an API call to get all events from the cache that match a subscription
 - a new IE payload type, raw, which I used for transporting the Entity ID in
    my code for handling distributed device state.
 - Code improvements to reduce code duplication
 - Include the Entity ID of the server that originated the event in every event
 - an additional event type, DEVICE_STATE_CHANGE, to help facilitate distributed
    device state.  DEVICE_STATE is a state change on one server, DEVICE_STATE_CHANGE
	is the aggregate device state change across all servers.

................
r121559 | russell | 2008-06-10 11:12:17 -0400 (Tue, 10 Jun 2008) | 24 lines

Merge another big set of changes from team/russell/events

This commit merges in the rest of the code needed to support distributed device
state.  There are two main parts to this commit.

Core changes:
 - The device state handling in the core has been updated to understand device
   state across a cluster of Asterisk servers.  Every time the state of a device
   changes, it looks at all of the device states on each node, and determines the
   aggregate device state.  That resulting device state is what is provided to
   modules in Asterisk that take actions based on the state of a device.

New module, res_ais:
 - A module has been written to facilitate the communication of events between
   nodes in a cluster of Asterisk servers.  This module uses the SAForum AIS
   (Service Availability Forum Application Interface Specification) CLM and EVT
   services (Cluster Management and Event) to handle this task.  This module
   currently supports sharing Voicemail MWI (Message Waiting Indication) and
   device state events between servers.  It has been tested with openais, though
   other implementations of the spec do exist.

For more information on testing distributed device state, see the following doc:
  - doc/distributed_devstate.txt

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

Added:
    team/seanbright/resolve-shadow-warnings/configs/ais.conf.sample
      - copied unchanged from r121559, trunk/configs/ais.conf.sample
    team/seanbright/resolve-shadow-warnings/doc/distributed_devstate.txt
      - copied unchanged from r121559, trunk/doc/distributed_devstate.txt
    team/seanbright/resolve-shadow-warnings/res/ais/
      - copied from r121559, trunk/res/ais/
    team/seanbright/resolve-shadow-warnings/res/ais/ais.h
      - copied unchanged from r121559, trunk/res/ais/ais.h
    team/seanbright/resolve-shadow-warnings/res/ais/amf.c
      - copied unchanged from r121559, trunk/res/ais/amf.c
    team/seanbright/resolve-shadow-warnings/res/ais/ckpt.c
      - copied unchanged from r121559, trunk/res/ais/ckpt.c
    team/seanbright/resolve-shadow-warnings/res/ais/clm.c
      - copied unchanged from r121559, trunk/res/ais/clm.c
    team/seanbright/resolve-shadow-warnings/res/ais/evt.c
      - copied unchanged from r121559, trunk/res/ais/evt.c
    team/seanbright/resolve-shadow-warnings/res/ais/lck.c
      - copied unchanged from r121559, trunk/res/ais/lck.c
    team/seanbright/resolve-shadow-warnings/res/res_ais.c
      - copied unchanged from r121559, trunk/res/res_ais.c
Modified:
    team/seanbright/resolve-shadow-warnings/   (props changed)
    team/seanbright/resolve-shadow-warnings/CHANGES
    team/seanbright/resolve-shadow-warnings/apps/app_meetme.c
    team/seanbright/resolve-shadow-warnings/apps/app_queue.c
    team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c
    team/seanbright/resolve-shadow-warnings/build_tools/menuselect-deps.in
    team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c
    team/seanbright/resolve-shadow-warnings/channels/chan_sip.c
    team/seanbright/resolve-shadow-warnings/configs/dundi.conf.sample
    team/seanbright/resolve-shadow-warnings/configure
    team/seanbright/resolve-shadow-warnings/configure.ac
    team/seanbright/resolve-shadow-warnings/doc/tex/asterisk-conf.tex
    team/seanbright/resolve-shadow-warnings/doc/tex/channelvariables.tex
    team/seanbright/resolve-shadow-warnings/include/asterisk/autoconfig.h.in
    team/seanbright/resolve-shadow-warnings/include/asterisk/config.h
    team/seanbright/resolve-shadow-warnings/include/asterisk/devicestate.h
    team/seanbright/resolve-shadow-warnings/include/asterisk/dundi.h
    team/seanbright/resolve-shadow-warnings/include/asterisk/event.h
    team/seanbright/resolve-shadow-warnings/include/asterisk/event_defs.h
    team/seanbright/resolve-shadow-warnings/include/asterisk/utils.h
    team/seanbright/resolve-shadow-warnings/main/asterisk.c
    team/seanbright/resolve-shadow-warnings/main/channel.c
    team/seanbright/resolve-shadow-warnings/main/devicestate.c
    team/seanbright/resolve-shadow-warnings/main/event.c
    team/seanbright/resolve-shadow-warnings/main/netsock.c
    team/seanbright/resolve-shadow-warnings/main/pbx.c
    team/seanbright/resolve-shadow-warnings/main/rtp.c
    team/seanbright/resolve-shadow-warnings/main/taskprocessor.c
    team/seanbright/resolve-shadow-warnings/main/utils.c
    team/seanbright/resolve-shadow-warnings/makeopts.in
    team/seanbright/resolve-shadow-warnings/pbx/dundi-parser.c
    team/seanbright/resolve-shadow-warnings/pbx/dundi-parser.h
    team/seanbright/resolve-shadow-warnings/pbx/pbx_dundi.c
    team/seanbright/resolve-shadow-warnings/res/Makefile
    team/seanbright/resolve-shadow-warnings/res/res_config_curl.c
    team/seanbright/resolve-shadow-warnings/res/res_config_odbc.c
    team/seanbright/resolve-shadow-warnings/res/res_config_pgsql.c

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jun 10 10:41:24 2008
@@ -1,1 +1,1 @@
-/trunk:1-121326
+/trunk:1-121560

Modified: team/seanbright/resolve-shadow-warnings/CHANGES
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/CHANGES?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/CHANGES (original)
+++ team/seanbright/resolve-shadow-warnings/CHANGES Tue Jun 10 10:41:24 2008
@@ -1,6 +1,17 @@
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.6.0 to Asterisk 1.6.1  -------------
 ------------------------------------------------------------------------------
+
+Device State Handling
+---------------------
+ * The event infrastructure in Asterisk got another big update to help support
+    distributed events.  It currently supports distributed device state and
+    distributed Voicemail MWI (Message Waiting Indication).  A new module has
+    been merged, res_ais, which facilitates communicating events between servers.
+    It uses the SAForum AIS (Service Availability Forum Application Interface
+    Specification) CLM (Cluster Management) and EVT (Event) services to maintain
+    a cluster of Asterisk servers, and to share events between them.  For more
+    information on setting this up, see doc/distributed_devstate.txt.
 
 Dialplan Functions
 ------------------
@@ -17,9 +28,9 @@
  * TIMEOUT() has been modified to be accurate down to the millisecond.
  * ENUM*() functions now include the following new options:
      - 'u' returns the full URI and does not strip off the URI-scheme.
-	 - 's' triggers ISN specific rewriting
-	 - 'i' looks for branches into an Infrastructure ENUM tree
-	 - 'd' for a direct DNS lookup without any flipping of digits.
+     - 's' triggers ISN specific rewriting
+     - 'i' looks for branches into an Infrastructure ENUM tree
+     - 'd' for a direct DNS lookup without any flipping of digits.
  * TXCIDNAME() has a new zone-suffix parameter (which defaults to 'e164.arpa')
  * CHANNEL() now has options for the maximum, minimum, and standard or normal
    deviation of jitter, rtt, and loss for a call using chan_sip.
@@ -116,9 +127,9 @@
      which shows which configuration files are in use.
   * New CLI commands, "pri show version" and "ss7 show version" that will
      display which version of libpri and libss7 are being used, respectively.
-	 A new API call was added so trunk will now have to be compiled against
-	 a versions of libpri and libss7 that have them or it will not know that
-	 these libraries exist.
+     A new API call was added so trunk will now have to be compiled against
+     a versions of libpri and libss7 that have them or it will not know that
+     these libraries exist.
 
 DNS manager changes
 -------------------
@@ -443,10 +454,10 @@
      a web interface of some kind).
   * Added the support for marking messages as "urgent." There are two methods to accomplish
      this. One is to pass the 'U' option to VoiceMail(). Another way to mark a message as urgent
-	 is to specify "review=yes" in voicemail.conf. Doing this will cause allow the user to mark
-	 the message as urgent after he has recorded a voicemail by following the voice instructions.
-	When listening to voicemails using VoiceMailMain urgent messages will be presented before other
-	 messages
+     is to specify "review=yes" in voicemail.conf. Doing this will cause allow the user to mark
+     the message as urgent after he has recorded a voicemail by following the voice instructions.
+    When listening to voicemails using VoiceMailMain urgent messages will be presented before other
+     messages
 
 Queue changes
 -------------
@@ -480,18 +491,18 @@
     device state reported.
   * New configuration option: randomperiodicannounce. If a list of periodic announcements is
     specified by the periodic-announce option, then one will be chosen randomly when it is time
-	to play a periodic announcment
+    to play a periodic announcment
   * New configuration options: announce-position now takes two more values in addition to "yes" and
     "no." Two new options, "limit" and "more," are allowed. These are tied to another option,
-	announce-position-limit. By setting announce-position to "limit" callers will only have their
-	position announced if their position is less than what is specified by announce-position-limit.
-	If announce-position is set to "more" then callers beyond the position specified by announce-position-limit
-	will be told that their are more than announce-position-limit callers waiting.
+    announce-position-limit. By setting announce-position to "limit" callers will only have their
+    position announced if their position is less than what is specified by announce-position-limit.
+    If announce-position is set to "more" then callers beyond the position specified by announce-position-limit
+    will be told that their are more than announce-position-limit callers waiting.
   * Two new queue log events have been added. An ADDMEMBER event will be logged
     when a realtime queue member is added and a REMOVEMEMBER event will be logged
-	when a realtime queue member is removed. Since there is no calling channel associated
-	with these events, the string "REALTIME" is placed where the channel's unique id
-	is typically placed.
+    when a realtime queue member is removed. Since there is no calling channel associated
+    with these events, the string "REALTIME" is placed where the channel's unique id
+    is typically placed.
 
 MeetMe Changes
 --------------
@@ -761,7 +772,7 @@
   * iLBC source code no longer included (see UPGRADE.txt for details)
   * If compiled with DETECT_DEADLOCKS enabled and if you have glibc, then if 
      deadlock is detected, a backtrace of the stack which led to the lock calls
-	 will be output to the CLI.
+     will be output to the CLI.
   * If compiled with DEBUG_THREADS enabled and if you have glibc, then issuing
      the "core show locks" CLI command will give lock information output as well
-	 as a backtrace of the stack which led to the lock calls.
+     as a backtrace of the stack which led to the lock calls.

Modified: team/seanbright/resolve-shadow-warnings/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_meetme.c?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_meetme.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_meetme.c Tue Jun 10 10:41:24 2008
@@ -1743,7 +1743,10 @@
 	if (rt_log_members) {
 		/* Update table */
 		snprintf(members, sizeof(members), "%d", conf->users);
-		ast_realtime_require_field("meetme", "confno", RQ_INTEGER, strlen(conf->confno), "members", RQ_INTEGER, strlen(members), NULL);
+		ast_realtime_require_field("meetme",
+			"confno", strlen(conf->confno) > 7 ? RQ_UINTEGER4 : strlen(conf->confno) > 4 ? RQ_UINTEGER3 : RQ_UINTEGER2, strlen(conf->confno),
+			"members", RQ_UINTEGER1, strlen(members),
+			NULL);
 		ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
 	}
 	setusercount = 1;
@@ -2683,7 +2686,10 @@
 			if (rt_log_members) {
 				/* Update table */
 				snprintf(members, sizeof(members), "%d", conf->users);
-				ast_realtime_require_field("meetme", "confno", RQ_INTEGER, strlen(conf->confno), "members", RQ_INTEGER, strlen(members), NULL);
+				ast_realtime_require_field("meetme",
+					"confno", strlen(conf->confno) > 7 ? RQ_UINTEGER4 : strlen(conf->confno) > 4 ? RQ_UINTEGER3 : RQ_UINTEGER2, strlen(conf->confno),
+					"members", RQ_UINTEGER1, strlen(members),
+					NULL);
 				ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
 			}
 			if (confflags & CONFFLAG_MARKEDUSER) 
@@ -5710,7 +5716,7 @@
 	res |= ast_devstate_prov_add("SLA", sla_state);
 
 	res |= ast_custom_function_register(&meetme_info_acf);
-	ast_realtime_require_field("meetme", "confno", RQ_INTEGER, 3, "members", RQ_INTEGER, 3, NULL);
+	ast_realtime_require_field("meetme", "confno", RQ_UINTEGER2, 3, "members", RQ_UINTEGER1, 3, NULL);
 
 	return res;
 }

Modified: team/seanbright/resolve-shadow-warnings/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_queue.c?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_queue.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_queue.c Tue Jun 10 10:41:24 2008
@@ -6334,9 +6334,11 @@
 		ast_log(LOG_WARNING, "devicestate taskprocessor reference failed - devicestate notifications will not occur\n");
 	}
 
-	if (!(device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE, device_state_cb, NULL, AST_EVENT_IE_END)))
+	if (!(device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE_CHANGE, device_state_cb, NULL, AST_EVENT_IE_END))) {
 		res = -1;
-	ast_realtime_require_field("queue_members", "paused", RQ_INTEGER, 1, "uniqueid", RQ_INTEGER, 5, NULL);
+	}
+
+	ast_realtime_require_field("queue_members", "paused", RQ_INTEGER1, 1, "uniqueid", RQ_UINTEGER2, 5, NULL);
 
 	return res ? AST_MODULE_LOAD_DECLINE : 0;
 }

Modified: team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c (original)
+++ team/seanbright/resolve-shadow-warnings/apps/app_voicemail.c Tue Jun 10 10:41:24 2008
@@ -10088,8 +10088,8 @@
 	ast_cli_register_multiple(cli_voicemail, sizeof(cli_voicemail) / sizeof(struct ast_cli_entry));
 
 	ast_install_vm_functions(has_voicemail, inboxcount, messagecount, sayname);
-	ast_realtime_require_field("voicemail", "uniqueid", RQ_INTEGER, 11, "password", RQ_CHAR, 10, NULL);
-	ast_realtime_require_field("voicemail_data", "filename", RQ_CHAR, 30, "duration", RQ_INTEGER, 5, NULL);
+	ast_realtime_require_field("voicemail", "uniqueid", RQ_UINTEGER3, 11, "password", RQ_CHAR, 10, NULL);
+	ast_realtime_require_field("voicemail_data", "filename", RQ_CHAR, 30, "duration", RQ_UINTEGER3, 5, NULL);
 
 	return res;
 }

Modified: team/seanbright/resolve-shadow-warnings/build_tools/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/build_tools/menuselect-deps.in?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/build_tools/menuselect-deps.in (original)
+++ team/seanbright/resolve-shadow-warnings/build_tools/menuselect-deps.in Tue Jun 10 10:41:24 2008
@@ -29,6 +29,8 @@
 POPT=@PBX_POPT@
 PORTAUDIO=@PBX_PORTAUDIO@
 PRI=@PBX_PRI@
+SACLM=@PBX_SACLM@
+SAEVT=@PBX_SAEVT@
 RADIUS=@PBX_RADIUS@
 SPANDSP=@PBX_SPANDSP@
 SPEEX=@PBX_SPEEX@

Modified: team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c Tue Jun 10 10:41:24 2008
@@ -9685,13 +9685,13 @@
 	}
 
 	if (!reg->callno) {
-		ast_debug(1, "Allocate call number\n");
+		ast_debug(3, "Allocate call number\n");
 		reg->callno = find_callno_locked(0, 0, &reg->addr, NEW_FORCE, defaultsockfd, 0);
 		if (reg->callno < 1) {
 			ast_log(LOG_WARNING, "Unable to create call for registration\n");
 			return -1;
 		} else
-			ast_debug(1, "Registration created on call %d\n", reg->callno);
+			ast_debug(3, "Registration created on call %d\n", reg->callno);
 		iaxs[reg->callno]->reg = reg;
 		ast_mutex_unlock(&iaxsl[reg->callno]);
 	}
@@ -12189,7 +12189,7 @@
 	reload_firmware(0);
 	iax_provision_reload(0);
 
-	ast_realtime_require_field("iaxpeers", "name", RQ_CHAR, 10, "ipaddr", RQ_CHAR, 15, "port", RQ_INTEGER, 5, "regseconds", RQ_INTEGER, 6, NULL);
+	ast_realtime_require_field("iaxpeers", "name", RQ_CHAR, 10, "ipaddr", RQ_CHAR, 15, "port", RQ_UINTEGER2, 5, "regseconds", RQ_UINTEGER2, 6, NULL);
 
 	return AST_MODULE_LOAD_SUCCESS;
 }

Modified: team/seanbright/resolve-shadow-warnings/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/chan_sip.c?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/chan_sip.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/chan_sip.c Tue Jun 10 10:41:24 2008
@@ -2056,7 +2056,7 @@
 static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask, struct ast_variable *v);
 
 /* Realtime device support */
-static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *username, const char *fullcontact, int expirey, int deprecated_username);
+static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *username, const char *fullcontact, const char *useragent, int expirey, int deprecated_username);
 static struct sip_user *realtime_user(const char *username);
 static void update_peer(struct sip_peer *p, int expire);
 static struct ast_variable *get_insecure_variable_from_config(struct ast_config *config);
@@ -2485,7 +2485,7 @@
 		dialog->stateid = -1; /* shouldn't we 'zero' this out? */
 	}
 	/* Remove link from peer to subscription of MWI */
-	if (dialog->relatedpeer && dialog->relatedpeer->mwipvt)
+	if (dialog->relatedpeer && dialog->relatedpeer->mwipvt == dialog)
 		dialog->relatedpeer->mwipvt = dialog_unref(dialog->relatedpeer->mwipvt, "delete ->relatedpeer->mwipvt");
 	if (dialog->relatedpeer && dialog->relatedpeer->call == dialog)
 		dialog->relatedpeer->call = dialog_unref(dialog->relatedpeer->call, "unset the relatedpeer->call field in tandem with relatedpeer field itself");
@@ -3630,7 +3630,7 @@
 	that name and store that in the "regserver" field in the sippeers
 	table to facilitate multi-server setups.
 */
-static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *defaultuser, const char *fullcontact, int expirey, int deprecated_username)
+static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *defaultuser, const char *fullcontact, const char *useragent, int expirey, int deprecated_username)
 {
 	char port[10];
 	char ipaddr[INET_ADDRSTRLEN];
@@ -3656,14 +3656,19 @@
 	else if (sip_cfg.rtsave_sysname)
 		syslabel = "regserver";
 
-	if (fc)
+	if (fc) {
 		ast_update_realtime(tablename, "name", peername, "ipaddr", ipaddr,
 			"port", port, "regseconds", regseconds,
-			deprecated_username ? "username" : "defaultuser", defaultuser, fc, fullcontact, syslabel, sysname, NULL); /* note fc and syslabel _can_ be NULL */
-	else
+			deprecated_username ? "username" : "defaultuser", defaultuser,
+			"useragent", useragent,
+			fc, fullcontact, syslabel, sysname, NULL); /* note fc and syslabel _can_ be NULL */
+	} else {
 		ast_update_realtime(tablename, "name", peername, "ipaddr", ipaddr,
 			"port", port, "regseconds", regseconds,
-			deprecated_username ? "username" : "defaultuser", defaultuser, syslabel, sysname, NULL); /* note syslabel _can_ be NULL */
+			"useragent", useragent,
+			deprecated_username ? "username" : "defaultuser", defaultuser,
+			syslabel, sysname, NULL); /* note syslabel _can_ be NULL */
+	}
 }
 
 /*! \brief Automatically add peer extension to dial plan */
@@ -3783,7 +3788,7 @@
 	int rtcachefriends = ast_test_flag(&p->flags[1], SIP_PAGE2_RTCACHEFRIENDS);
 	if (sip_cfg.peer_rtupdate &&
 	    (p->is_realtime || rtcachefriends)) {
-		realtime_update_peer(p->name, &p->addr, p->username, rtcachefriends ? p->fullcontact : NULL, expire, p->deprecated_username);
+		realtime_update_peer(p->name, &p->addr, p->username, rtcachefriends ? p->fullcontact : NULL, p->useragent, expire, p->deprecated_username);
 	}
 }
 
@@ -7840,8 +7845,13 @@
 		ast_string_field_set(p, url, NULL);
 	}
 
-	/* Add Session-Timers related headers if the feature is active for this session */
-	if (p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE) {
+	/* Add Session-Timers related headers if the feature is active for this session.
+	   An exception to this behavior is the ACK request. Since Asterisk never requires 
+	   session-timers support from a remote end-point (UAS) in an INVITE, it must 
+	   not send 'Require: timer' header in the ACK request. Also, Require: header 
+	   is not applicable for CANCEL method. */
+	if (p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE 
+	    && sipmethod != SIP_ACK && sipmethod != SIP_CANCEL) {
 		char se_hdr[256];
 		snprintf(se_hdr, sizeof(se_hdr), "%d;refresher=%s", p->stimer->st_interval, 
 			strefresher2str(p->stimer->st_ref));
@@ -9163,6 +9173,7 @@
 		
 		snprintf(i2astr, sizeof(i2astr), "%d", p->stimer->st_interval);
 		add_header(&req, "Session-Expires", i2astr);
+		snprintf(i2astr, sizeof(i2astr), "%d", st_get_se(p, FALSE));
 		add_header(&req, "Min-SE", i2astr);
 	}
 
@@ -10093,7 +10104,7 @@
 
 	if (!sip_cfg.ignore_regexpire) {
 		if (peer->rt_fromcontact)
-			ast_update_realtime(tablename, "name", peer->name, "fullcontact", "", "ipaddr", "", "port", "", "regseconds", "0", peer->deprecated_username ? "username" : "defaultuser", "", "regserver", "", NULL);
+			ast_update_realtime(tablename, "name", peer->name, "fullcontact", "", "ipaddr", "", "port", "", "regseconds", "0", peer->deprecated_username ? "username" : "defaultuser", "", "regserver", "", "useragent", "", NULL);
 		else 
 			ast_db_del("SIP/Registry", peer->name);
 	}
@@ -22857,11 +22868,12 @@
 	ast_realtime_require_field(ast_check_realtime("sipregs") ? "sipregs" : "sippeers",
 		"name", RQ_CHAR, 10,
 		"ipaddr", RQ_CHAR, 15,
-		"port", RQ_INTEGER, 5,
-		"regseconds", RQ_INTEGER, 5,
+		"port", RQ_UINTEGER2, 5,
+		"regseconds", RQ_UINTEGER2, 5,   /* Max of 18 hours */
 		"defaultuser", RQ_CHAR, 10,
 		"fullcontact", RQ_CHAR, 20,
 		"regserver", RQ_CHAR, 20,
+		"useragent", RQ_CHAR, 20,
 		NULL);
 
 	return AST_MODULE_LOAD_SUCCESS;

Modified: team/seanbright/resolve-shadow-warnings/configs/dundi.conf.sample
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/configs/dundi.conf.sample?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/configs/dundi.conf.sample (original)
+++ team/seanbright/resolve-shadow-warnings/configs/dundi.conf.sample Tue Jun 10 10:41:24 2008
@@ -33,7 +33,8 @@
 ; Our entity identifier (Should generally be the MAC address of the
 ; machine it's running on.  Defaults to the first eth address, but you
 ; can override it here, as long as you set it to the MAC of *something*
-; you own!)
+; you own!)  The EID can be overridden by a setting in asterisk.conf,
+; or by setting this option.
 ;
 ;entityid=00:07:E9:3B:76:60
 ;

Modified: team/seanbright/resolve-shadow-warnings/configure.ac
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/configure.ac?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/configure.ac (original)
+++ team/seanbright/resolve-shadow-warnings/configure.ac Tue Jun 10 10:41:24 2008
@@ -240,6 +240,8 @@
 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
 AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl])
 AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image library], [SDL_image])
+AST_EXT_LIB_SETUP([SACLM], [SAForum AIS CLM], [SaClm])
+AST_EXT_LIB_SETUP([SAEVT], [SAForum AIS EVT], [SaEvt])
 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
 AST_EXT_LIB_SETUP([SPEEXDSP], [Speexdsp], [speexdsp])
 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
@@ -1357,6 +1359,9 @@
 
 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
 
+AST_EXT_LIB_CHECK([SACLM], [SaClm], [saClmInitialize], [openais/saClm.h])
+AST_EXT_LIB_CHECK([SAEVT], [SaEvt], [saEvtInitialize], [openais/saEvt.h])
+
 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
 
 # See if the main speex library contains the preprocess functions

Modified: team/seanbright/resolve-shadow-warnings/doc/tex/asterisk-conf.tex
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/doc/tex/asterisk-conf.tex?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/doc/tex/asterisk-conf.tex (original)
+++ team/seanbright/resolve-shadow-warnings/doc/tex/asterisk-conf.tex Tue Jun 10 10:41:24 2008
@@ -124,6 +124,11 @@
 ;           eh. on SMB/CIFS mounts
 lockmode = lockfile | flock
   
+; Entity ID.  This is in the form of a MAC address.  It should be universally
+; unique.  It must be unique between servers communicating with a protocol
+; that uses this value.  The only thing that uses this currently is DUNDi,
+; but other things will use it in the future.
+; entityid=00:11:22:33:44:55
 
 [files]
 ; Changing the following lines may compromise your security

Modified: team/seanbright/resolve-shadow-warnings/doc/tex/channelvariables.tex
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/doc/tex/channelvariables.tex?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/doc/tex/channelvariables.tex (original)
+++ team/seanbright/resolve-shadow-warnings/doc/tex/channelvariables.tex Tue Jun 10 10:41:24 2008
@@ -795,6 +795,7 @@
 ${FORWARD_CONTEXT}       Context for forwarded calls
 ${UNIQUEID}            * Current call unique identifier
 ${SYSTEMNAME}          * value of the systemname option of asterisk.conf
+${ENTITYID}            * Global Entity ID set automatically, or from asterisk.conf
 \end{verbatim}
 
 \subsection{Application return values}

Modified: team/seanbright/resolve-shadow-warnings/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/include/asterisk/autoconfig.h.in?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/include/asterisk/autoconfig.h.in (original)
+++ team/seanbright/resolve-shadow-warnings/include/asterisk/autoconfig.h.in Tue Jun 10 10:41:24 2008
@@ -681,6 +681,18 @@
 
 /* Define RTLD_NOLOAD headers version */
 #undef HAVE_RTLD_NOLOAD_VERSION
+
+/* Define this to indicate the ${SACLM_DESCRIP} library */
+#undef HAVE_SACLM
+
+/* Define to indicate the ${SACLM_DESCRIP} library version */
+#undef HAVE_SACLM_VERSION
+
+/* Define this to indicate the ${SAEVT_DESCRIP} library */
+#undef HAVE_SAEVT
+
+/* Define to indicate the ${SAEVT_DESCRIP} library version */
+#undef HAVE_SAEVT_VERSION
 
 /* Define to 1 if your system has /sbin/launchd. */
 #undef HAVE_SBIN_LAUNCHD
@@ -1202,6 +1214,9 @@
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
 
 /* Define like PROTOTYPES; this can be used by system headers. */
 #undef __PROTOTYPES

Modified: team/seanbright/resolve-shadow-warnings/include/asterisk/config.h
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/include/asterisk/config.h?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/include/asterisk/config.h (original)
+++ team/seanbright/resolve-shadow-warnings/include/asterisk/config.h Tue Jun 10 10:41:24 2008
@@ -28,6 +28,7 @@
 #endif
 
 #include "asterisk/utils.h"
+#include "asterisk/inline_api.h"
 
 struct ast_config;
 
@@ -50,7 +51,16 @@
  * \brief Types used in ast_realtime_require_field
  */
 typedef enum {
-	RQ_INTEGER,
+	RQ_INTEGER1,
+	RQ_UINTEGER1,
+	RQ_INTEGER2,
+	RQ_UINTEGER2,
+	RQ_INTEGER3,
+	RQ_UINTEGER3,
+	RQ_INTEGER4,
+	RQ_UINTEGER4,
+	RQ_INTEGER8,
+	RQ_UINTEGER8,
 	RQ_CHAR,
 	RQ_FLOAT,
 	RQ_DATE,
@@ -451,6 +461,27 @@
 #define CV_DSTR(__x, __dst)	CV_F(__x, if (__dst) ast_free(__dst); __dst = ast_strdup(__val))
 #define CV_STRFIELD(__x, __obj, __field) CV_F(__x, ast_string_field_set(__obj, __field, __val))
 
+AST_INLINE_API(
+int ast_rq_is_int(require_type type),
+{
+	switch (type) {
+	case RQ_INTEGER1:
+	case RQ_UINTEGER1:
+	case RQ_INTEGER2:
+	case RQ_UINTEGER2:
+	case RQ_INTEGER3:
+	case RQ_UINTEGER3:
+	case RQ_INTEGER4:
+	case RQ_UINTEGER4:
+	case RQ_INTEGER8:
+	case RQ_UINTEGER8:
+		return 1;
+	default:
+		return 0;
+	}
+}
+)
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif

Modified: team/seanbright/resolve-shadow-warnings/include/asterisk/devicestate.h
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/include/asterisk/devicestate.h?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/include/asterisk/devicestate.h (original)
+++ team/seanbright/resolve-shadow-warnings/include/asterisk/devicestate.h Tue Jun 10 10:41:24 2008
@@ -196,6 +196,54 @@
  */ 
 int ast_devstate_prov_del(const char *label);
 
+/*!
+ * \brief An object to hold state when calculating aggregate device state
+ */
+struct ast_devstate_aggregate;
+
+/*!
+ * \brief Initialize aggregate device state
+ *
+ * \arg agg the state object
+ *
+ * \return nothing
+ */
+void ast_devstate_aggregate_init(struct ast_devstate_aggregate *agg);
+
+/*!
+ * \brief Add a device state to the aggregate device state
+ *
+ * \arg agg the state object
+ * \arg state the state to add
+ *
+ * \return nothing
+ */
+void ast_devstate_aggregate_add(struct ast_devstate_aggregate *agg, enum ast_device_state state);
+
+/*!
+ * \brief Get the aggregate device state result
+ *
+ * \arg agg the state object
+ *
+ * \return the aggregate device state after adding some number of device states.
+ */
+enum ast_device_state ast_devstate_aggregate_result(struct ast_devstate_aggregate *agg);
+
+/*! 
+ * \brief You shouldn't care about the contents of this struct 
+ *
+ * This struct is only here so that it can be easily declared on the stack.
+ */
+struct ast_devstate_aggregate {
+	unsigned int all_unavail:1;
+	unsigned int all_busy:1;
+	unsigned int all_free:1;
+	unsigned int all_on_hold:1;
+	unsigned int busy:1;
+	unsigned int in_use:1;
+	unsigned int ring:1;
+};
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif

Modified: team/seanbright/resolve-shadow-warnings/include/asterisk/dundi.h
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/include/asterisk/dundi.h?view=diff&rev=121590&r1=121589&r2=121590
==============================================================================
--- team/seanbright/resolve-shadow-warnings/include/asterisk/dundi.h (original)
+++ team/seanbright/resolve-shadow-warnings/include/asterisk/dundi.h Tue Jun 10 10:41:24 2008
@@ -25,15 +25,11 @@
 #define _ASTERISK_DUNDI_H
 
 #include "asterisk/channel.h"
+#include "asterisk/utils.h"
 
 #define DUNDI_PORT 4520
 
-/*!\brief A DUNDi Entity ID is essentially a MAC address, brief and unique */
-struct _dundi_eid {
-	unsigned char eid[6];
-} __attribute__ ((__packed__));
-
-typedef struct _dundi_eid dundi_eid;
+typedef struct ast_eid dundi_eid;
 
 struct dundi_hdr {
 	unsigned short strans;			/*!< Source transaction */
@@ -54,26 +50,49 @@
 #define DUNDI_FLAG_RETRANS		(1 << 16)	/*!< Applies to dtrans */
 #define DUNDI_FLAG_RESERVED		(1 << 16)	/*!< Applies to strans */
 
-#define DUNDI_PROTO_NONE		0		/*!< No answer yet */
-#define DUNDI_PROTO_IAX			1		/*!< IAX version 2 */
-#define DUNDI_PROTO_SIP			2		/*!< Session Initiation Protocol */
-#define DUNDI_PROTO_H323		3		/*!< ITU H.323 */
-
-#define DUNDI_FLAG_NONEXISTENT		(0)		/*!< Isn't and can't be a valid number */
-#define DUNDI_FLAG_EXISTS		(1 << 0)	/*!< Is a valid number */
-#define DUNDI_FLAG_MATCHMORE		(1 << 1)	/*!< Might be valid if you add more digits */
-#define DUNDI_FLAG_CANMATCH		(1 << 2)	/*!< Might be a match */
-#define DUNDI_FLAG_IGNOREPAT		(1 << 3)	/*!< Keep dialtone */

[... 3342 lines stripped ...]



More information about the svn-commits mailing list