[asterisk-commits] lmadsen: tag 1.8.4.3 r324704 - in /tags/1.8.4.3: ./ channels/ channels/sip/ i...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jun 23 13:40:33 CDT 2011
Author: lmadsen
Date: Thu Jun 23 13:40:29 2011
New Revision: 324704
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=324704
Log:
Commit changes per AST-2011-008, AST-2011-009, AST-2011-010
Removed:
tags/1.8.4.3/asterisk-1.8.4.2-summary.html
tags/1.8.4.3/asterisk-1.8.4.2-summary.txt
Modified:
tags/1.8.4.3/.version
tags/1.8.4.3/ChangeLog
tags/1.8.4.3/channels/chan_iax2.c
tags/1.8.4.3/channels/chan_sip.c
tags/1.8.4.3/channels/sip/reqresp_parser.c
tags/1.8.4.3/include/asterisk/frame.h
tags/1.8.4.3/main/features.c
Modified: tags/1.8.4.3/.version
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4.3/.version?view=diff&rev=324704&r1=324703&r2=324704
==============================================================================
--- tags/1.8.4.3/.version (original)
+++ tags/1.8.4.3/.version Thu Jun 23 13:40:29 2011
@@ -1,1 +1,1 @@
-1.8.4.2
+1.8.4.3
Modified: tags/1.8.4.3/ChangeLog
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4.3/ChangeLog?view=diff&rev=324704&r1=324703&r2=324704
==============================================================================
--- tags/1.8.4.3/ChangeLog (original)
+++ tags/1.8.4.3/ChangeLog Thu Jun 23 13:40:29 2011
@@ -1,3 +1,9 @@
+2011-06-22 Leif Madsen <lmadsen at digium.com>
+
+ * Asterisk 1.8.4.3 Released.
+
+ * AST-2011-008, AST-2011-009, AST-2011-010
+
2011-06-02 Leif Madsen <lmadsen at digium.com>
* Asterisk 1.8.4.2 Released.
Modified: tags/1.8.4.3/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4.3/channels/chan_iax2.c?view=diff&rev=324704&r1=324703&r2=324704
==============================================================================
--- tags/1.8.4.3/channels/chan_iax2.c (original)
+++ tags/1.8.4.3/channels/chan_iax2.c Thu Jun 23 13:40:29 2011
@@ -5267,10 +5267,6 @@
/* these two cannot be sent, because they require a result */
errno = ENOSYS;
return -1;
- case AST_OPTION_FORMAT_READ:
- case AST_OPTION_FORMAT_WRITE:
- case AST_OPTION_MAKE_COMPATIBLE:
- return -1;
case AST_OPTION_OPRMODE:
errno = EINVAL;
return -1;
@@ -5287,7 +5283,16 @@
ast_mutex_unlock(&iaxsl[callno]);
return 0;
}
- default:
+ /* These options are sent to the other side across the network where
+ * they will be passed to whatever channel is bridged there. Don't
+ * do anything silly like pass an option that transmits pointers to
+ * memory on this machine to a remote machine to use */
+ case AST_OPTION_TONE_VERIFY:
+ case AST_OPTION_TDD:
+ case AST_OPTION_RELAXDTMF:
+ case AST_OPTION_AUDIO_MODE:
+ case AST_OPTION_DIGIT_DETECT:
+ case AST_OPTION_FAX_DETECT:
{
unsigned short callno = PTR_TO_CALLNO(c->tech_pvt);
struct chan_iax2_pvt *pvt;
@@ -5315,7 +5320,12 @@
ast_free(h);
return res;
}
- }
+ default:
+ return -1;
+ }
+
+ /* Just in case someone does a break instead of a return */
+ return -1;
}
static int iax2_queryoption(struct ast_channel *c, int option, void *data, int *datalen)
Modified: tags/1.8.4.3/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4.3/channels/chan_sip.c?view=diff&rev=324704&r1=324703&r2=324704
==============================================================================
--- tags/1.8.4.3/channels/chan_sip.c (original)
+++ tags/1.8.4.3/channels/chan_sip.c Thu Jun 23 13:40:29 2011
@@ -24188,7 +24188,8 @@
return -1;
}
- req.len = res;
+ /* req.data will have the correct length in case of nulls */
+ req.len = ast_str_strlen(req.data);
req.socket.fd = sipsock;
set_socket_transport(&req.socket, SIP_TRANSPORT_UDP);
req.socket.tcptls_session = NULL;
Modified: tags/1.8.4.3/channels/sip/reqresp_parser.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4.3/channels/sip/reqresp_parser.c?view=diff&rev=324704&r1=324703&r2=324704
==============================================================================
--- tags/1.8.4.3/channels/sip/reqresp_parser.c (original)
+++ tags/1.8.4.3/channels/sip/reqresp_parser.c Thu Jun 23 13:40:29 2011
@@ -1029,14 +1029,14 @@
only affects token based display-names there is no danger of brackets being in quotes */
if (first_bracket) {
parse = first_bracket;
- } else {
+ } else {
parse = tmp;
}
if ((second_bracket = strchr(parse, '>'))) {
*second_bracket++ = '\0';
if (out) {
- *out = first_bracket;
+ *out = (char *) parse;
}
if (residue) {
*residue = second_bracket;
@@ -1045,9 +1045,9 @@
}
if ((first_bracket)) {
- ast_log(LOG_WARNING, "No closing bracket found in '%s'\n", tmp);
+ ast_log(LOG_WARNING, "No closing bracket found in '%s'\n", tmp);
return -1;
- }
+ }
if (out) {
*out = tmp;
@@ -1076,6 +1076,7 @@
char name_no_quotes[] = "name not in quotes <sip:name:secret at host:port;transport=tcp?headers=testblah&headers2=blahblah>";
char no_end_bracket[] = "name not in quotes <sip:name:secret at host:port;transport=tcp?headers=testblah&headers2=blahblah";
char no_name_no_brackets[] = "sip:name at host";
+ char missing_start_bracket[] = "name not in quotes sip:name:secret at host:port;transport=tcp?headers=testblah&headers2=blahblah>";
char *uri = NULL;
switch (cmd) {
@@ -1137,6 +1138,13 @@
if (!(uri = get_in_brackets(no_name_no_brackets)) || (strcmp(uri, "sip:name at host"))) {
ast_test_status_update(test, "Test 7 failed. %s\n", uri);
+ res = AST_TEST_FAIL;
+ }
+
+ /* Test 8, no start bracket, but with ending bracket. */
+ if (!(uri = get_in_brackets(missing_start_bracket)) || !(strcmp(uri, in_brackets))) {
+
+ ast_test_status_update(test, "Test 8 failed. %s\n", uri);
res = AST_TEST_FAIL;
}
Modified: tags/1.8.4.3/include/asterisk/frame.h
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4.3/include/asterisk/frame.h?view=diff&rev=324704&r1=324703&r2=324704
==============================================================================
--- tags/1.8.4.3/include/asterisk/frame.h (original)
+++ tags/1.8.4.3/include/asterisk/frame.h Thu Jun 23 13:40:29 2011
@@ -403,45 +403,51 @@
#define AST_OPTION_FLAG_WTF 6
/*! Verify touchtones by muting audio transmission
- (and reception) and verify the tone is still present */
+ * (and reception) and verify the tone is still present
+ * Option data is a single signed char value 0 or 1 */
#define AST_OPTION_TONE_VERIFY 1
-/*! Put a compatible channel into TDD (TTY for the hearing-impared) mode */
+/*! Put a compatible channel into TDD (TTY for the hearing-impared) mode
+ * Option data is a single signed char value 0 or 1 */
#define AST_OPTION_TDD 2
-/*! Relax the parameters for DTMF reception (mainly for radio use) */
+/*! Relax the parameters for DTMF reception (mainly for radio use)
+ * Option data is a single signed char value 0 or 1 */
#define AST_OPTION_RELAXDTMF 3
-/*! Set (or clear) Audio (Not-Clear) Mode */
+/*! Set (or clear) Audio (Not-Clear) Mode
+ * Option data is a single signed char value 0 or 1 */
#define AST_OPTION_AUDIO_MODE 4
/*! Set channel transmit gain
- * Option data is a single signed char
- representing number of decibels (dB)
- to set gain to (on top of any gain
- specified in channel driver)
-*/
+ * Option data is a single signed char representing number of decibels (dB)
+ * to set gain to (on top of any gain specified in channel driver) */
#define AST_OPTION_TXGAIN 5
/*! Set channel receive gain
- * Option data is a single signed char
- representing number of decibels (dB)
- to set gain to (on top of any gain
- specified in channel driver)
-*/
+ * Option data is a single signed char representing number of decibels (dB)
+ * to set gain to (on top of any gain specified in channel driver) */
#define AST_OPTION_RXGAIN 6
-/* set channel into "Operator Services" mode */
+/* set channel into "Operator Services" mode
+ * Option data is a struct oprmode
+ *
+ * \note This option should never be sent over the network */
#define AST_OPTION_OPRMODE 7
-/*! Explicitly enable or disable echo cancelation for the given channel */
+/*! Explicitly enable or disable echo cancelation for the given channel
+ * Option data is a single signed char value 0 or 1
+ *
+ * \note This option appears to be unused in the code. It is handled, but never
+ * set or queried. */
#define AST_OPTION_ECHOCAN 8
/*! \brief Handle channel write data
* If a channel needs to process the data from a func_channel write operation
* after func_channel_write executes, it can define the setoption callback
* and process this option. A pointer to an ast_chan_write_info_t will be passed.
- * */
+ *
+ * \note This option should never be passed over the network. */
#define AST_OPTION_CHANNEL_WRITE 9
/* !
@@ -450,28 +456,38 @@
*/
#define AST_OPTION_T38_STATE 10
-/*! Request that the channel driver deliver frames in a specific format */
+/*! Request that the channel driver deliver frames in a specific format
+ * Option data is a format_t */
#define AST_OPTION_FORMAT_READ 11
-/*! Request that the channel driver be prepared to accept frames in a specific format */
+/*! Request that the channel driver be prepared to accept frames in a specific format
+ * Option data is a format_t */
#define AST_OPTION_FORMAT_WRITE 12
-/*! Request that the channel driver make two channels of the same tech type compatible if possible */
+/*! Request that the channel driver make two channels of the same tech type compatible if possible
+ * Option data is an ast_channel
+ *
+ * \note This option should never be passed over the network */
#define AST_OPTION_MAKE_COMPATIBLE 13
-/*! Get or set the digit detection state of the channel */
+/*! Get or set the digit detection state of the channel
+ * Option data is a single signed char value 0 or 1 */
#define AST_OPTION_DIGIT_DETECT 14
-/*! Get or set the fax tone detection state of the channel */
+/*! Get or set the fax tone detection state of the channel
+ * Option data is a single signed char value 0 or 1 */
#define AST_OPTION_FAX_DETECT 15
-/*! Get the device name from the channel */
+/*! Get the device name from the channel (Read only)
+ * Option data is a character buffer of suitable length */
#define AST_OPTION_DEVICE_NAME 16
-/*! Get the CC agent type from the channel */
+/*! Get the CC agent type from the channel (Read only)
+ * Option data is a character buffer of suitable length */
#define AST_OPTION_CC_AGENT_TYPE 17
-/*! Get or set the security options on a channel */
+/*! Get or set the security options on a channel
+ * Option data is an integer value of 0 or 1 */
#define AST_OPTION_SECURE_SIGNALING 18
#define AST_OPTION_SECURE_MEDIA 19
Modified: tags/1.8.4.3/main/features.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4.3/main/features.c?view=diff&rev=324704&r1=324703&r2=324704
==============================================================================
--- tags/1.8.4.3/main/features.c (original)
+++ tags/1.8.4.3/main/features.c Thu Jun 23 13:40:29 2011
@@ -3672,10 +3672,21 @@
break;
case AST_CONTROL_OPTION:
aoh = f->data.ptr;
- /* Forward option Requests */
+ /* Forward option Requests, but only ones we know are safe
+ * These are ONLY sent by chan_iax2 and I'm not convinced that
+ * they are useful. I haven't deleted them entirely because I
+ * just am not sure of the ramifications of removing them. */
if (aoh && aoh->flag == AST_OPTION_FLAG_REQUEST) {
- ast_channel_setoption(other, ntohs(aoh->option), aoh->data,
- f->datalen - sizeof(struct ast_option_header), 0);
+ switch (ntohs(aoh->option)) {
+ case AST_OPTION_TONE_VERIFY:
+ case AST_OPTION_TDD:
+ case AST_OPTION_RELAXDTMF:
+ case AST_OPTION_AUDIO_MODE:
+ case AST_OPTION_DIGIT_DETECT:
+ case AST_OPTION_FAX_DETECT:
+ ast_channel_setoption(other, ntohs(aoh->option), aoh->data,
+ f->datalen - sizeof(struct ast_option_header), 0);
+ }
}
break;
}
More information about the asterisk-commits
mailing list