[asterisk-commits] oej: branch oej/pinetree-trunk r215883 - in /team/oej/pinetree-trunk: ./ addo...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 3 02:45:46 CDT 2009


Author: oej
Date: Thu Sep  3 02:45:41 2009
New Revision: 215883

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=215883
Log:
Reset automerge after oej's %!!" unneeded whitespace changes

Added:
    team/oej/pinetree-trunk/res/res_mutestream.c
      - copied unchanged from r215838, trunk/res/res_mutestream.c
Modified:
    team/oej/pinetree-trunk/   (props changed)
    team/oej/pinetree-trunk/CHANGES
    team/oej/pinetree-trunk/addons/format_mp3.c
    team/oej/pinetree-trunk/apps/app_softhangup.c
    team/oej/pinetree-trunk/channels/chan_dahdi.c
    team/oej/pinetree-trunk/channels/chan_sip.c
    team/oej/pinetree-trunk/channels/chan_skinny.c
    team/oej/pinetree-trunk/channels/sig_analog.c
    team/oej/pinetree-trunk/channels/sig_pri.c
    team/oej/pinetree-trunk/channels/sig_pri.h
    team/oej/pinetree-trunk/configs/chan_dahdi.conf.sample
    team/oej/pinetree-trunk/doc/manager_1_1.txt
    team/oej/pinetree-trunk/funcs/func_channel.c
    team/oej/pinetree-trunk/include/asterisk.h
    team/oej/pinetree-trunk/main/Makefile
    team/oej/pinetree-trunk/main/app.c
    team/oej/pinetree-trunk/main/features.c
    team/oej/pinetree-trunk/main/frame.c

Propchange: team/oej/pinetree-trunk/
------------------------------------------------------------------------------
    automerge = http://www.codename-pineapple.org/

Propchange: team/oej/pinetree-trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/oej/pinetree-trunk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Sep  3 02:45:41 2009
@@ -1,1 +1,1 @@
-/trunk:1-215106
+/trunk:1-215882

Modified: team/oej/pinetree-trunk/CHANGES
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinetree-trunk/CHANGES?view=diff&rev=215883&r1=215882&r2=215883
==============================================================================
--- team/oej/pinetree-trunk/CHANGES (original)
+++ team/oej/pinetree-trunk/CHANGES Thu Sep  3 02:45:41 2009
@@ -41,6 +41,9 @@
    force_rport forces RFC 3581 behavior and disables symmetric RTP support.
    Setting it to comedia enables RFC 3581 behavior if the remote side requests it
    and enables symmetric RTP support.
+ * Slave SIP channels now set HASH(SIP_CAUSE,<slave-channel-name>) on each
+   response.  This permits the master channel to know how each channel dialled
+   in a multi-channel setup resolved in an individual way.
 
 IAX2 Changes
 -----------
@@ -93,6 +96,15 @@
            disabled)
      voice - voice mode (returns from FAX mode, reverting the changes that
              were made when FAX mode was requested)
+ * Added new dialplan function MASTER_CHANNEL(), which permits retrieving
+   and setting variables on the channel which created the current channel.
+   Administrators should take care to avoid naming conflicts, when multiple
+   channels are dialled at once, especially when used with the Local channel
+   construct (which all could set variables on the master channel).  Usage
+   of the HASH() dialplan function, with the key set to the name of the slave
+   channel, is one approach that will avoid conflicts.
+ * Added new dialplan function MUTEAUDIO() for muting inbound and/or outbound
+   audio in a channel.
 
 Dialplan Variables
 ------------------
@@ -177,6 +189,8 @@
    will update the redirecting-to presentation (COLR) when it becomes available.
  * Added Reverse Charging Indication receipt & transmission (requires latest
    LibPRI).
+ * Added the ability to ignore calls that are not in a Multiple Subscriber
+   Number (MSN) list for PTMP CPE interfaces.
 
 Asterisk Manager Interface
 --------------------------
@@ -191,6 +205,8 @@
    across all .conf files. All affected sample.conf files have been modified to
    reflect this change.  Previous options such as 'sslenable' still work,
    but options with the 'tls' prefix are preferred.
+ * Added a MuteAudio AMI action for muting inbound and/or outbound audio
+   in a channel. (res_mutestream.so)
 
 Channel Event Logging
 ---------------------

Modified: team/oej/pinetree-trunk/addons/format_mp3.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinetree-trunk/addons/format_mp3.c?view=diff&rev=215883&r1=215882&r2=215883
==============================================================================
--- team/oej/pinetree-trunk/addons/format_mp3.c (original)
+++ team/oej/pinetree-trunk/addons/format_mp3.c Thu Sep  3 02:45:41 2009
@@ -98,16 +98,7 @@
 static int mp3_open(struct ast_filestream *s)
 {
 	struct mp3_private *p = s->_private;
-	
 	InitMP3(&p->mp, OUTSCALE);
-	p->dbuflen = 0;
-	s->fr.data.ptr = s->buf;
-	s->fr.frametype = AST_FRAME_VOICE;
-	s->fr.subclass = AST_FORMAT_SLINEAR;
-	/* datalen will vary for each frame */
-	s->fr.src = name;
-	s->fr.mallocd = 0;
-	p->offset = 0;
 	return 0;
 }
 
@@ -234,9 +225,7 @@
 	delay = p->buflen/2;
 	s->fr.frametype = AST_FRAME_VOICE;
 	s->fr.subclass = AST_FORMAT_SLINEAR;
-	s->fr.offset = AST_FRIENDLY_OFFSET;
-	s->fr.datalen = p->buflen;
-	s->fr.data.ptr = s->buf;
+	AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, p->buflen);
 	s->fr.mallocd = 0;
 	s->fr.samples = delay;
 	*whennext = delay;

Modified: team/oej/pinetree-trunk/apps/app_softhangup.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinetree-trunk/apps/app_softhangup.c?view=diff&rev=215883&r1=215882&r2=215883
==============================================================================
--- team/oej/pinetree-trunk/apps/app_softhangup.c (original)
+++ team/oej/pinetree-trunk/apps/app_softhangup.c Thu Sep  3 02:45:41 2009
@@ -103,11 +103,13 @@
 		ast_copy_string(name, c->name, sizeof(name));
 		if (ast_test_flag(&flags, OPTION_ALL)) {
 			/* CAPI is set up like CAPI[foo/bar]/clcnt */ 
-			if (!strcmp(c->tech->type, "CAPI")) 
+			if (!strcmp(c->tech->type, "CAPI")) {
 				cut = strrchr(name, '/');
 			/* Basically everything else is Foo/Bar-Z */
-			else
-				cut = strchr(name, '-');
+			} else {
+				/* use strrchr() because Foo/Bar-Z could actually be Foo/B-a-r-Z */
+				cut = strrchr(name,'-');
+			}
 			/* Get rid of what we've cut */
 			if (cut)
 				*cut = 0;

Modified: team/oej/pinetree-trunk/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinetree-trunk/channels/chan_dahdi.c?view=diff&rev=215883&r1=215882&r2=215883
==============================================================================
--- team/oej/pinetree-trunk/channels/chan_dahdi.c (original)
+++ team/oej/pinetree-trunk/channels/chan_dahdi.c Thu Sep  3 02:45:41 2009
@@ -1992,12 +1992,20 @@
 	ast_mutex_unlock(&p->lock);
 }
 
+/* linear_mode = 0 - turn linear mode off, >0 - turn linear mode on
+* 	returns the last value of the linear setting 
+*/ 
 static int my_set_linear_mode(void *pvt, int idx, int linear_mode)
 {
 	struct dahdi_pvt *p = pvt;
-	if (!linear_mode)
-		linear_mode = p->subs[idx].linear;
-	return dahdi_setlinear(p->subs[idx].dfd, linear_mode);
+	int oldval;
+	
+    if (0 > linear_mode || !dahdi_setlinear(p->subs[idx].dfd, linear_mode)) {
+        return -1;
+    }
+	oldval = p->subs[idx].linear;
+	p->subs[idx].linear = linear_mode;
+	return oldval;
 }
 
 static int get_alarms(struct dahdi_pvt *p);
@@ -3494,11 +3502,7 @@
 
 static int dahdi_setlinear(int dfd, int linear)
 {
-	int res;
-	res = ioctl(dfd, DAHDI_SETLINEAR, &linear);
-	if (res)
-		return res;
-	return 0;
+	return ioctl(dfd, DAHDI_SETLINEAR, &linear);
 }
 
 
@@ -10839,6 +10843,7 @@
 						pris[span].pri.inbanddisconnect = conf->pri.pri.inbanddisconnect;
 #endif
 						pris[span].pri.facilityenable = conf->pri.pri.facilityenable;
+						ast_copy_string(pris[span].pri.msn_list, conf->pri.pri.msn_list, sizeof(pris[span].pri.msn_list));
 						ast_copy_string(pris[span].pri.idledial, conf->pri.pri.idledial, sizeof(pris[span].pri.idledial));
 						ast_copy_string(pris[span].pri.idleext, conf->pri.pri.idleext, sizeof(pris[span].pri.idleext));
 						ast_copy_string(pris[span].pri.internationalprefix, conf->pri.pri.internationalprefix, sizeof(pris[span].pri.internationalprefix));
@@ -15610,6 +15615,9 @@
 					ast_log(LOG_ERROR, "Unknown switchtype '%s' at line %d.\n", v->value, v->lineno);
 					return -1;
 				}
+			} else if (!strcasecmp(v->name, "msn")) {
+				ast_copy_string(confp->pri.pri.msn_list, v->value,
+					sizeof(confp->pri.pri.msn_list));
 			} else if (!strcasecmp(v->name, "nsf")) {
 				if (!strcasecmp(v->value, "sdn"))
 					confp->pri.pri.nsf = PRI_NSF_SDN;

Modified: team/oej/pinetree-trunk/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinetree-trunk/channels/chan_sip.c?view=diff&rev=215883&r1=215882&r2=215883
==============================================================================
--- team/oej/pinetree-trunk/channels/chan_sip.c (original)
+++ team/oej/pinetree-trunk/channels/chan_sip.c Thu Sep  3 02:45:41 2009
@@ -32,15 +32,13 @@
  * \note TCP/TLS support is EXPERIMENTAL and WILL CHANGE. This applies to configuration
  *	settings, dialplan commands and dialplans apps/functions
  * See \ref sip_tcp_tls
- * 
+ *
  *
  * ******** General TODO:s
  * \todo Better support of forking
  * \todo VIA branch tag transaction checking
  * \todo Transaction support
- * \todo Asterisk should send a non-100 provisional response every minute to keep proxies
- *  from cancelling the transaction (RFC 3261 13.3.1.1). See bug #11157.
- * 
+ *
  * ******** Wishlist: Improvements
  * - Support of SIP domains for devices, so that we match on username at domain in the From: header
  * - Connect registrations with a specific device on the incoming call. It's not done
@@ -68,7 +66,7 @@
  * sipsock_read() for udp only. In tcp, packets are read by the tcp_helper thread.
  * sipsock_read() function parses the packet and matches an existing
  * dialog or starts a new SIP dialog.
- * 
+ *
  * sipsock_read sends the packet to handle_incoming(), that parses a bit more.
  * If it is a response to an outbound request, the packet is sent to handle_response().
  * If it is a request, handle_incoming() sends it to one of a list of functions
@@ -83,28 +81,28 @@
  * the sip_answer() function is called.
  *
  * The actual media - Video or Audio - is mostly handled by the RTP subsystem
- * in rtp.c 
- * 
+ * in rtp.c
+ *
  * \par Outbound calls
  * Outbound calls are set up by the PBX through the sip_request_call()
  * function. After that, they are activated by sip_call().
- * 
+ *
  * \par Hanging up
  * The PBX issues a hangup on both incoming and outgoing calls through
  * the sip_hangup() function
  */
 
-/*!  
+/*!
  * \page sip_tcp_tls SIP TCP and TLS support
- * 
+ *
  * \par tcpfixes TCP implementation changes needed
  * \todo Fix TCP/TLS handling in dialplan, SRV records, transfers and much more
  * \todo Save TCP/TLS sessions in registry
  *	If someone registers a SIPS uri, this forces us to set up a TLS connection back.
  * \todo Add TCP/TLS information to function SIPPEER and SIPCHANINFO
  * \todo If tcpenable=yes, we must open a TCP socket on the same address as the IP for UDP.
- * 	 The tcpbindaddr config option should only be used to open ADDITIONAL ports
- * 	 So we should propably go back to
+ * 	The tcpbindaddr config option should only be used to open ADDITIONAL ports
+ * 	So we should propably go back to
  *		bindaddr= the default address to bind to. If tcpenable=yes, then bind this to both udp and TCP
  *				if tlsenable=yes, open TLS port (provided we also have cert)
  *		tcpbindaddr = extra address for additional TCP connections
@@ -113,11 +111,11 @@
  *			These three options should take multiple IP/port pairs
  *	Note: Since opening additional listen sockets is a *new* feature we do not have today
  *		the XXXbindaddr options needs to be disabled until we have support for it
- *		
+ *
  * \todo re-evaluate the transport= setting in sip.conf. This is right now not well
  * 	thought of. If a device in sip.conf contacts us via TCP, we should not switch transport,
  *	even if udp is the configured first transport.
- *	
+ *
  * \todo Be prepared for one outbound and another incoming socket per pvt. This applies
  *       specially to communication with other peers (proxies).
  * \todo We need to test TCP sessions with SIP proxies and in regards
@@ -137,7 +135,7 @@
  * \todo Default transports are set to UDP, which cause the wrong behaviour when contacting remote
  *	devices directly from the dialplan. UDP is only a fallback if no other method works,
  *	in order to be compatible with RFC2543 (SIP/1.0) devices. For transactions that exceed the
- * 	MTU (like INIVTE with video, audio and RTT)  TCP should be preferred.
+ *	MTU (like INIVTE with video, audio and RTT)  TCP should be preferred.
  *
  *	When dialling unconfigured peers (with no port number)  or devices in external domains
  *	NAPTR records MUST be consulted to find configured transport. If they are not found,
@@ -150,7 +148,7 @@
  * __set_address_from_contact(const char *fullcontact, struct sockaddr_in *sin, int tcp)
  *	- sets TLS port as default for all TCP connections, unless other port is given in contact.
  * parse_register_contact(struct sip_pvt *pvt, struct sip_peer *peer, struct sip_request *req)
- *	- assumes that the contact the UA registers is using the same transport as the REGISTER request, which is 
+ *	- assumes that the contact the UA registers is using the same transport as the REGISTER request, which is
  *	  a bad guess.
  *      - Does not save any information about TCP/TLS connected devices, which is a severe BUG, as discussed on the mailing list.
  * get_destination(struct sip_pvt *p, struct sip_request *oreq)
@@ -191,9 +189,9 @@
 		made by remote end-points. A remote end-point can request Asterisk to engage
 		session-timers by either sending it an INVITE request with a "Supported: timer"
 		header in it or by responding to Asterisk's INVITE with a 200 OK that contains
-		Session-Expires: header in it. In this mode, the Asterisk server does not 
+		Session-Expires: header in it. In this mode, the Asterisk server does not
 		request session-timers from remote end-points. This is the default mode.
-	2. Originate :: In the "originate" mode, the Asterisk server requests the remote 
+	2. Originate :: In the "originate" mode, the Asterisk server requests the remote
 		end-points to activate session-timers in addition to honoring such requests
 		made by the remote end-pints. In order to get as much protection as possible
 		against hanging SIP channels due to network or end-point failures, Asterisk
@@ -202,7 +200,7 @@
 	3. Refuse :: In the "refuse" mode, Asterisk acts as if it does not support session-
 		timers for inbound or outbound requests. If a remote end-point requests
 		session-timers in a dialog, then Asterisk ignores that request unless it's
-		noted as a requirement (Require: header), in which case the INVITE is 
+		noted as a requirement (Require: header), in which case the INVITE is
 		rejected with a 420 Bad Extension response.
 
 */
@@ -245,15 +243,15 @@
 #include "asterisk/utils.h"
 #include "asterisk/file.h"
 #include "asterisk/astobj.h"
-/* 
+/*
    Uncomment the define below,  if you are having refcount related memory leaks.
    With this uncommented, this module will generate a file, /tmp/refs, which contains
    a history of the ao2_ref() calls. To be useful, all calls to ao2_* functions should
-   be modified to ao2_t_* calls, and include a tag describing what is happening with 
+   be modified to ao2_t_* calls, and include a tag describing what is happening with
    enough detail, to make pairing up a reference count increment with its corresponding decrement.
    The refcounter program in utils/ can be invaluable in highlighting objects that are not
    balanced, along with the complete history for that object.
-   In normal operation, the macros defined will throw away the tags, so they do not 
+   In normal operation, the macros defined will throw away the tags, so they do not
    affect the speed of the program at all. They can be considered to be documentation.
 */
 /* #define  REF_DEBUG 1 */
@@ -317,9 +315,9 @@
 			<parameter name="Header" required="false" />
 		</syntax>
 		<description>
-			<para>SIPRemoveHeader() allows you to remove headers which were previously 
-			added with SIPAddHeader(). If no parameter is supplied, all previously added 
-			headers will be removed. If a parameter is supplied, only the matching headers 
+			<para>SIPRemoveHeader() allows you to remove headers which were previously
+			added with SIPAddHeader(). If no parameter is supplied, all previously added
+			headers will be removed. If a parameter is supplied, only the matching headers
 			will be removed.</para>
 			<para>For example you have added these 2 headers:</para>
 			<para>SIPAddHeader(P-Asserted-Identity: sip:foo at bar);</para>
@@ -581,13 +579,13 @@
 /* guard limit must be larger than guard secs */
 /* guard min must be < 1000, and should be >= 250 */
 #define EXPIRY_GUARD_SECS       15                /*!< How long before expiry do we reregister */
-#define EXPIRY_GUARD_LIMIT      30                /*!< Below here, we use EXPIRY_GUARD_PCT instead of 
+#define EXPIRY_GUARD_LIMIT      30                /*!< Below here, we use EXPIRY_GUARD_PCT instead of
 	                                                 EXPIRY_GUARD_SECS */
-#define EXPIRY_GUARD_MIN        500                /*!< This is the minimum guard time applied. If 
-                                                   GUARD_PCT turns out to be lower than this, it 
+#define EXPIRY_GUARD_MIN        500                /*!< This is the minimum guard time applied. If
+                                                   GUARD_PCT turns out to be lower than this, it
                                                    will use this time instead.
                                                    This is in milliseconds. */
-#define EXPIRY_GUARD_PCT        0.20                /*!< Percentage of expires timeout to use when 
+#define EXPIRY_GUARD_PCT        0.20                /*!< Percentage of expires timeout to use when
                                                     below EXPIRY_GUARD_LIMIT */
 #define DEFAULT_EXPIRY 900                          /*!< Expire slowly */
 
@@ -602,7 +600,7 @@
 
 #define CALLERID_UNKNOWN             "Anonymous"
 #define FROMDOMAIN_INVALID           "anonymous.invalid"
- 
+
 #define DEFAULT_MAXMS                2000             /*!< Qualification: Must be faster than 2 seconds by default */
 #define DEFAULT_QUALIFYFREQ          60 * 1000        /*!< Qualification: How often to check for the host to be up */
 #define DEFAULT_FREQ_NOTOK           10 * 1000        /*!< Qualification: How often to check, if the host is down... */
@@ -610,16 +608,17 @@
 #define DEFAULT_RETRANS              1000             /*!< How frequently to retransmit Default: 2 * 500 ms in RFC 3261 */
 #define MAX_RETRANS                  6                /*!< Try only 6 times for retransmissions, a total of 7 transmissions */
 #define DEFAULT_TIMER_T1                 500              /*!< SIP timer T1 (according to RFC 3261) */
-#define SIP_TRANS_TIMEOUT            64 * DEFAULT_TIMER_T1 /*!< SIP request timeout (rfc 3261) 64*T1 
+#define SIP_TRANS_TIMEOUT            64 * DEFAULT_TIMER_T1 /*!< SIP request timeout (rfc 3261) 64*T1
                                                       \todo Use known T1 for timeout (peerpoke)
                                                       */
 #define DEFAULT_TRANS_TIMEOUT        -1               /*!< Use default SIP transaction timeout */
+#define PROVIS_KEEPALIVE_TIMEOUT     60000            /*!< How long to wait before retransmitting a provisional response (rfc 3261 13.3.1.1) */
 #define MAX_AUTHTRIES                3                /*!< Try authentication three times, then fail */
 
 #define SIP_MAX_HEADERS              64               /*!< Max amount of SIP headers to read */
 #define SIP_MAX_LINES                64               /*!< Max amount of lines in SIP attachment (like SDP) */
 #define SIP_MIN_PACKET               4096             /*!< Initialize size of memory to allocate for packets */
-#define MAX_HISTORY_ENTRIES 	     50	              /*!< Max entires in the history list for a sip_pvt */
+#define MAX_HISTORY_ENTRIES		50	              /*!< Max entires in the history list for a sip_pvt */
 
 #define INITIAL_CSEQ                 101              /*!< Our initial sip sequence number */
 
@@ -641,7 +640,7 @@
 static const char config[] = "sip.conf";		/*!< Main configuration file */
 static const char notify_config[] = "sip_notify.conf";	/*!< Configuration file for sending Notify with CLI commands to reconfigure or reboot phones */
 
-#define RTP 	1
+#define RTP	1
 #define NO_RTP	0
 
 enum devicematchrules {
@@ -650,7 +649,7 @@
 	MATCH_LASTVIA,			/*!< Skip all via headers and go for the sender's real IP */
 };
 
-/*! \brief Authorization scheme for call transfers 
+/*! \brief Authorization scheme for call transfers
 
 \note Not a bitfield flag, since there are plans for other modes,
 	like "only allow transfers for authenticated devices" */
@@ -666,7 +665,7 @@
 	AST_FAILURE = -1,		/*!< Failure code */
 };
 
-/*! \brief States for the INVITE transaction, not the dialog 
+/*! \brief States for the INVITE transaction, not the dialog
 	\note this is for the INVITE that sets up the dialog
 */
 enum invitestates {
@@ -676,7 +675,7 @@
 	INV_EARLY_MEDIA = 3,    /*!< We got 18x message with to-tag back */
 	INV_COMPLETED = 4,	/*!< Got final response with error. Wait for ACK, then CONFIRMED */
 	INV_CONFIRMED = 5,	/*!< Confirmed response - we've got an ack (Incoming calls only) */
-	INV_TERMINATED = 6,	/*!< Transaction done - either successful (AST_STATE_UP) or failed, but done 
+	INV_TERMINATED = 6,	/*!< Transaction done - either successful (AST_STATE_UP) or failed, but done
 				     The only way out of this is a BYE from one side */
 	INV_CANCELLED = 7,	/*!< Transaction cancelled by client or server in non-terminated state */
 };
@@ -715,7 +714,7 @@
 };
 
 /*! \brief Type of subscription, based on the packages we do support, see \ref subscription_types */
-enum subscriptiontype { 
+enum subscriptiontype {
 	NONE = 0,
 	XPIDF_XML,
 	DIALOG_INFO_XML,
@@ -736,7 +735,7 @@
 	const char * const text;
 } subscription_types[] = {
 	{ NONE,		   "-",        "unknown",	             "unknown" },
- 	/* RFC 4235: SIP Dialog event package */
+	/* RFC 4235: SIP Dialog event package */
 	{ DIALOG_INFO_XML, "dialog",   "application/dialog-info+xml", "dialog-info+xml" },
 	{ CPIM_PIDF_XML,   "presence", "application/cpim-pidf+xml",   "cpim-pidf+xml" },  /* RFC 3863 */
 	{ PIDF_XML,        "presence", "application/pidf+xml",        "pidf+xml" },       /* RFC 3863 */
@@ -745,7 +744,7 @@
 };
 
 
-/*! \brief Authentication types - proxy or www authentication 
+/*! \brief Authentication types - proxy or www authentication
 	\note Endpoints, like Asterisk, should always use WWW authentication to
 	allow multiple authentications in the same call - to the proxy and
 	to the end point.
@@ -775,30 +774,30 @@
 
 /*! \brief States for outbound registrations (with register= lines in sip.conf */
 enum sipregistrystate {
-	REG_STATE_UNREGISTERED = 0,	/*!< We are not registered 
+	REG_STATE_UNREGISTERED = 0,	/*!< We are not registered
 		 *  \note Initial state. We should have a timeout scheduled for the initial
 		 * (or next) registration transmission, calling sip_reregister
 		 */
 
-	REG_STATE_REGSENT,	/*!< Registration request sent 
+	REG_STATE_REGSENT,	/*!< Registration request sent
 		 * \note sent initial request, waiting for an ack or a timeout to
 		 * retransmit the initial request.
 		*/
 
-	REG_STATE_AUTHSENT,	/*!< We have tried to authenticate 
+	REG_STATE_AUTHSENT,	/*!< We have tried to authenticate
 		 * \note entered after transmit_register with auth info,
 		 * waiting for an ack.
 		 */
 
 	REG_STATE_REGISTERED,	/*!< Registered and done */
 
-	REG_STATE_REJECTED,	/*!< Registration rejected *
+	REG_STATE_REJECTED,	/*!< Registration rejected
 		 * \note only used when the remote party has an expire larger than
 		 * our max-expire. This is a final state from which we do not
 		 * recover (not sure how correctly).
 		 */
 
-	REG_STATE_TIMEOUT,	/*!< Registration timed out *
+	REG_STATE_TIMEOUT,	/*!< Registration timed out
 		* \note XXX unused */
 
 	REG_STATE_NOAUTH,	/*!< We have no accepted credentials
@@ -810,7 +809,7 @@
 
 /*! \brief Modes in which Asterisk can be configured to run SIP Session-Timers */
 enum st_mode {
-        SESSION_TIMER_MODE_INVALID = 0, /*!< Invalid value */ 
+        SESSION_TIMER_MODE_INVALID = 0, /*!< Invalid value */
         SESSION_TIMER_MODE_ACCEPT,      /*!< Honor inbound Session-Timer requests */
         SESSION_TIMER_MODE_ORIGINATE,   /*!< Originate outbound and honor inbound requests */
         SESSION_TIMER_MODE_REFUSE       /*!< Ignore inbound Session-Timers requests */
@@ -823,8 +822,8 @@
         SESSION_TIMER_REFRESHER_UAS      /*!< Session is refreshed by the UAS */
 };
 
-/*! \brief Define some implemented SIP transports 
-	\note Asterisk does not support SCTP or UDP/DTLS 
+/*! \brief Define some implemented SIP transports
+	\note Asterisk does not support SCTP or UDP/DTLS
 */
 enum sip_transport {
 	SIP_TRANSPORT_UDP = 1,		/*!< Unreliable transport for SIP, needs retransmissions */
@@ -834,7 +833,7 @@
 
 /*! \brief definition of a sip proxy server
  *
- * For outbound proxies, a sip_peer will contain a reference to a 
+ * For outbound proxies, a sip_peer will contain a reference to a
  * dynamically allocated instance of a sip_proxy. A sip_pvt may also
  * contain a reference to a peer's outboundproxy, or it may contain
  * a reference to the sip_cfg.outboundproxy.
@@ -843,13 +842,13 @@
 	char name[MAXHOSTNAMELEN];      /*!< DNS name of domain/host or IP */
 	struct sockaddr_in ip;          /*!< Currently used IP address and port */
 	time_t last_dnsupdate;          /*!< When this was resolved */
-	enum sip_transport transport;	
+	enum sip_transport transport;
 	int force;                      /*!< If it's an outbound proxy, Force use of this outbound proxy for all outbound requests */
 	/* Room for a SRV record chain based on the name */
 };
 
 /*! \brief argument for the 'show channels|subscriptions' callback. */
-struct __show_chan_arg { 
+struct __show_chan_arg {
 	int fd;
 	int subscriptions;
 	int numchans;   /* return value */
@@ -863,7 +862,7 @@
 	CAN_CREATE_DIALOG_UNSUPPORTED_METHOD,
 };
 
-/*! \brief SIP Request methods known by Asterisk 
+/*! \brief SIP Request methods known by Asterisk
 
    \note Do _NOT_ make any changes to this enum, or the array following it;
    if you think you are doing the right thing, you are probably
@@ -904,7 +903,7 @@
 	structure and then route the messages according to the type.
 
       \note Note that sip_methods[i].id == i must hold or the code breaks */
-static const struct  cfsip_methods { 
+static const struct  cfsip_methods {
 	enum sipmethod id;
 	int need_rtp;		/*!< when this is the 'primary' use for a pvt structure, does it need RTP? */
 	char * const text;
@@ -913,7 +912,7 @@
 	{ SIP_UNKNOWN,	 RTP,    "-UNKNOWN-", 	CAN_CREATE_DIALOG },
 	{ SIP_RESPONSE,	 NO_RTP, "SIP/2.0",	CAN_NOT_CREATE_DIALOG },
 	{ SIP_REGISTER,	 NO_RTP, "REGISTER", 	CAN_CREATE_DIALOG },
- 	{ SIP_OPTIONS,	 NO_RTP, "OPTIONS", 	CAN_CREATE_DIALOG },
+	{ SIP_OPTIONS,	 NO_RTP, "OPTIONS", 	CAN_CREATE_DIALOG },
 	{ SIP_NOTIFY,	 NO_RTP, "NOTIFY", 	CAN_CREATE_DIALOG },
 	{ SIP_INVITE,	 RTP,    "INVITE", 	CAN_CREATE_DIALOG },
 	{ SIP_ACK,	 NO_RTP, "ACK", 	CAN_NOT_CREATE_DIALOG },
@@ -929,10 +928,10 @@
 	{ SIP_PING,	 NO_RTP, "PING", 	CAN_CREATE_DIALOG_UNSUPPORTED_METHOD }
 };
 
-/*!  Define SIP option tags, used in Require: and Supported: headers 
- 	We need to be aware of these properties in the phones to use 
+/*!  Define SIP option tags, used in Require: and Supported: headers
+	We need to be aware of these properties in the phones to use
 	the replace: header. We should not do that without knowing
-	that the other end supports it... 
+	that the other end supports it...
 	This is nothing we can configure, we learn by the dialog
 	Supported: header on the REGISTER (peer) or the INVITE
 	(other devices)
@@ -975,7 +974,7 @@
 	char * const text;	/*!< Text id, as in standard */
 } sip_options[] = {	/* XXX used in 3 places */
 	/* RFC3262: PRACK 100% reliability */
-	{ SIP_OPT_100REL,	NOT_SUPPORTED,	"100rel" },	
+	{ SIP_OPT_100REL,	NOT_SUPPORTED,	"100rel" },
 	/* RFC3959: SIP Early session support */
 	{ SIP_OPT_EARLY_SESSION, NOT_SUPPORTED,	"early-session" },
 	/* SIMPLE events:  RFC4662 */
@@ -1005,9 +1004,9 @@
 	/* RFC-ietf-sip-uri-list-subscribe-02.txt - subscription lists */
 	{ SIP_OPT_RECLISTSUB,	NOT_SUPPORTED,	"recipient-list-subscribe" },
 	/* RFC3891: Replaces: header for transfer */
-	{ SIP_OPT_REPLACES,	SUPPORTED,	"replaces" },	
+	{ SIP_OPT_REPLACES,	SUPPORTED,	"replaces" },
 	/* One version of Polycom firmware has the wrong label */
-	{ SIP_OPT_REPLACES,	SUPPORTED,	"replace" },	
+	{ SIP_OPT_REPLACES,	SUPPORTED,	"replace" },
 	/* RFC4412 Resource priorities */
 	{ SIP_OPT_RESPRIORITY,	NOT_SUPPORTED,	"resource-priority" },
 	/* RFC3329: Security agreement mechanism */
@@ -1069,18 +1068,18 @@
 	return "unknown";
 }
 
-/*! \brief SIP Methods we support 
+/*! \brief SIP Methods we support
 	\todo This string should be set dynamically. We only support REFER and SUBSCRIBE if we have
 	allowsubscribe and allowrefer on in sip.conf.
 */
 #define ALLOWED_METHODS "INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO"
 
-/*! \brief SIP Extensions we support 
+/*! \brief SIP Extensions we support
 	\note This should be generated based on the previous array
 		in combination with settings.
 	\todo We should not have "timer" if it's disabled in the configuration file.
 */
-#define SUPPORTED_EXTENSIONS "replaces, timer" 
+#define SUPPORTED_EXTENSIONS "replaces, timer"
 
 /*! \brief Standard SIP unsecure port for UDP and TCP from RFC 3261. DO NOT CHANGE THIS */
 #define STANDARD_SIP_PORT	5060
@@ -1096,13 +1095,13 @@
  * option. If you change this value, the signalling will be incorrect.
  */
 
-/*! \name DefaultValues Default values, set and reset in reload_config before reading configuration 
+/*! \name DefaultValues Default values, set and reset in reload_config before reading configuration
 
    These are default values in the source. There are other recommended values in the
    sip.conf.sample for new installations. These may differ to keep backwards compatibility,
-   yet encouraging new behaviour on new installations 
+   yet encouraging new behaviour on new installations
  */
-/*@{*/ 
+/*@{*/
 #define DEFAULT_CONTEXT		"default"	/*!< The default context for [general] section as well as devices */
 #define DEFAULT_MOHINTERPRET    "default"	/*!< The default music class */
 #define DEFAULT_MOHSUGGEST      ""
@@ -1143,13 +1142,13 @@
 #define DEFAULT_SDPOWNER "root"			/*!< Default SDP username field in (o=) header unless re-defined in sip.conf */
 #define DEFAULT_ENGINE "asterisk"               /*!< Default RTP engine to use for sessions */
 #endif
-/*@}*/ 
+/*@}*/
 
 /*! \name DefaultSettings
 	Default setttings are used as a channel setting and as a default when
-	configuring devices 
+	configuring devices
 */
-/*@{*/ 
+/*@{*/
 static char default_language[MAX_LANGUAGE];
 static char default_callerid[AST_MAX_EXTENSION];
 static char default_mwi_from[80];
@@ -1158,7 +1157,7 @@
 static int default_qualify;		/*!< Default Qualify= setting */
 static char default_vmexten[AST_MAX_EXTENSION];
 static char default_mohinterpret[MAX_MUSICCLASS];  /*!< Global setting for moh class to use when put on hold */
-static char default_mohsuggest[MAX_MUSICCLASS];	   /*!< Global setting for moh class to suggest when putting 
+static char default_mohsuggest[MAX_MUSICCLASS];	   /*!< Global setting for moh class to suggest when putting
                                                     *   a bridged channel on hold */
 static char default_parkinglot[AST_MAX_CONTEXT]; /*!< Parkinglot */
 static char default_engine[256];        /*!< Default RTP engine */
@@ -1167,14 +1166,14 @@
 static unsigned int default_transports;			/*!< Default Transports (enum sip_transport) that are acceptable */
 static unsigned int default_primary_transport;		/*!< Default primary Transport (enum sip_transport) for outbound connections to devices */
 
-/*@}*/ 
+/*@}*/
 
 /*! \name GlobalSettings
 	Global settings apply to the channel (often settings you can change in the general section
 	of sip.conf
 */
-/*@{*/ 
-/*! \brief a place to store all global settings for the sip channel driver 
+/*@{*/
+/*! \brief a place to store all global settings for the sip channel driver
 	These are settings that will be possibly to apply on a group level later on.
 	\note Do not add settings that only apply to the channel itself and can't
 	      be applied to devices (trunks, services, phones)
@@ -1200,7 +1199,7 @@
 	int notifyhold;			/*!< Send notifications on hold */
 	enum notifycid_setting notifycid; /*!< Send CID with ringing notifications */
 	enum transfermodes allowtransfer;	/*!< SIP Refer restriction scheme */
-	int allowsubscribe;	        /*!< Flag for disabling ALL subscriptions, this is FALSE only if all peers are FALSE 
+	int allowsubscribe;	        /*!< Flag for disabling ALL subscriptions, this is FALSE only if all peers are FALSE
 					    the global setting is in globals_flags[1] */
 	char realm[MAXHOSTNAMELEN]; 		/*!< Default realm */
 	int domainsasrealm;			/*!< Use domains lists as realms */
@@ -1254,7 +1253,7 @@
 static int global_min_se;                     /*!< Lowest threshold for session refresh interval  */
 static int global_max_se;                     /*!< Highest threshold for session refresh interval */
 
-/*@}*/ 
+/*@}*/
 
 /*! \brief Global list of addresses dynamic peers are not allowed to use */
 static struct ast_ha *global_contact_ha = NULL;
@@ -1311,7 +1310,7 @@
  * Incoming messages: we first store the data from the socket in data[],
  * adding a trailing \0 to make string parsing routines happy.
  * Then call parse_request() and req.method = find_sip_method();
- * to initialize the other fields. The \r\n at the end of each line is   
+ * to initialize the other fields. The \r\n at the end of each line is
  * replaced by \0, so that data[] is not a conforming SIP message anymore.
  * After this processing, rlPart1 is set to non-NULL to remember
  * that we can run get_header() on this kind of packet.
@@ -1326,7 +1325,7 @@
  * (which fills the first line to "METHOD uri SIP/2.0" or "SIP/2.0 code text"),
  * and then fill the rest with add_header() and add_line().
  * The \r\n at the end of the line are still there, so the get_header()
- * and similar functions don't work on these packets. 
+ * and similar functions don't work on these packets.
  * \endverbatim
  */
 struct sip_request {
@@ -1394,7 +1393,7 @@
 	SIP_DOMAIN_CONFIG,		/*!< This domain is from configuration */
 };
 
-/*! \brief Domain data structure. 
+/*! \brief Domain data structure.
 	\note In the future, we will connect this to a configuration tree specific
 	for this domain
 */
@@ -1426,7 +1425,7 @@
 };
 
 /*! \name SIPflags
-	Various flags for the flags field in the pvt structure 
+	Various flags for the flags field in the pvt structure
 	Trying to sort these up (one or more of the following):
 	D: Dialog
 	P: Peer/user
@@ -1434,7 +1433,7 @@
 	When flags are used by multiple structures, it is important that
 	they have a common layout so it is easy to copy them.
 */
-/*@{*/ 
+/*@{*/
 #define SIP_OUTGOING		(1 << 0)	/*!< D: Direction of the last transaction in this dialog */
 #define SIP_RINGING		(1 << 2)	/*!< D: Have sent 180 ringing */
 #define SIP_PROGRESS_SENT	(1 << 3)	/*!< D: Have sent 183 message progress */
@@ -1493,11 +1492,11 @@
 	(SIP_PROMISCREDIR | SIP_TRUSTRPID | SIP_SENDRPID | SIP_DTMF | SIP_REINVITE | \
 	 SIP_PROG_INBAND | SIP_USECLIENTCODE | SIP_NAT_FORCE_RPORT | SIP_G726_NONSTANDARD | \
 	 SIP_USEREQPHONE | SIP_INSECURE)
-/*@}*/ 
+/*@}*/
 
 /*! \name SIPflags2
 	a second page of flags (for flags[1] */
-/*@{*/ 
+/*@{*/
 /* realtime flags */
 #define SIP_PAGE2_RTCACHEFRIENDS	(1 << 0)	/*!< GP: Should we keep RT objects in memory for extended time? */
 #define SIP_PAGE2_RTAUTOCLEAR		(1 << 2)	/*!< GP: Should we clean memory from peers after expiry? */
@@ -1542,7 +1541,7 @@
 	SIP_PAGE2_UDPTL_DESTINATION | SIP_PAGE2_VIDEOSUPPORT_ALWAYS | SIP_PAGE2_PREFERRED_CODEC | \
 	SIP_PAGE2_RPID_IMMEDIATE | SIP_PAGE2_RPID_UPDATE | SIP_PAGE2_SYMMETRICRTP)
 
-/*@}*/ 
+/*@}*/
 
 /*! \brief debugging state
  * We store separately the debugging requests from the config file
@@ -1600,7 +1599,7 @@
 struct _map_x_s {
 	int x;
 	const char *s;
-};              
+};
 
 static const struct _map_x_s referstatusstrings[] = {
 	{ REFER_IDLE,		"<none>" },
@@ -1638,11 +1637,11 @@
 };
 
 
-/*! \brief Structure that encapsulates all attributes related to running 
+/*! \brief Structure that encapsulates all attributes related to running
  *   SIP Session-Timers feature on a per dialog basis.
  */
 struct sip_st_dlg {
-	int st_active;                          /*!< Session-Timers on/off */ 
+	int st_active;                          /*!< Session-Timers on/off */
 	int st_interval;                        /*!< Session-Timers negotiated session refresh interval */
 	int st_schedid;                         /*!< Session-Timers ast_sched scheduler id */
 	enum st_refresher st_ref;               /*!< Session-Timers session refresher */
@@ -1655,7 +1654,7 @@
 };
 
 
-/*! \brief Structure that encapsulates all attributes related to configuration 
+/*! \brief Structure that encapsulates all attributes related to configuration
  *   of SIP Session-Timers feature on a per user/peer basis.
  */
 struct sip_st_cfg {
@@ -1759,6 +1758,8 @@
 	int redircodecs;			/*!< Redirect codecs */
 	int maxcallbitrate;			/*!< Maximum Call Bitrate for Video Calls */	
 	int request_queue_sched_id;		/*!< Scheduler ID of any scheduled action to process queued requests */
+	int provisional_keepalive_sched_id; /*!< Scheduler ID for provisional responses that need to be sent out to avoid cancellation */
+	const char *last_provisional;   /*!< The last successfully transmitted provisonal response message */
 	int authtries;				/*!< Times we've tried to authenticate */
 	struct sip_proxy *outboundproxy;	/*!< Outbound proxy for this dialog. Use ref_proxy to set this instead of setting it directly*/
 	struct t38properties t38;		/*!< T38 settings */
@@ -1791,7 +1792,7 @@
 	int amaflags;				/*!< AMA Flags */
 	int pendinginvite;			/*!< Any pending INVITE or state NOTIFY (in subscribe pvt's) ? (seqno of this) */
 	int glareinvite;			/*!< A invite received while a pending invite is already present is stored here.  Its seqno is the
-						value. Since this glare invite's seqno is not the same as the pending invite's, it must be 
+						value. Since this glare invite's seqno is not the same as the pending invite's, it must be
 						held in order to properly process acknowledgements for our 491 response. */
 	struct sip_request initreq;		/*!< Latest request that opened a new transaction
 							within this dialog.
@@ -1809,7 +1810,7 @@
 
 	struct ast_dsp *dsp;			/*!< Inband DTMF Detection dsp */
 
-	struct sip_peer *relatedpeer;		/*!< If this dialog is related to a peer, which one 
+	struct sip_peer *relatedpeer;		/*!< If this dialog is related to a peer, which one
 							Used in peerpoke, mwi subscriptions */
 	struct sip_registry *registry;		/*!< If this is a REGISTER dialog, to which registry */
 	struct ast_rtp_instance *rtp;			/*!< RTP Session */
@@ -1821,8 +1822,8 @@
 	struct ast_variable *chanvars;		/*!< Channel variables to set for inbound call */

[... 4341 lines stripped ...]



More information about the asterisk-commits mailing list