aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-23 22:14:29 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-23 22:14:29 +0000
commit043301a525e5e8f6b8fe67d1f07c0d7d59989a94 (patch)
treee15c26de28ee8ac83c240be62b2f24f732fc0ced /include
parenta1a8c370d226ca5d4abb00b428fef6abf49bbeb0 (diff)
Merged revisions 208464 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r208464 | kpfleming | 2009-07-23 16:57:24 -0500 (Thu, 23 Jul 2009) | 46 lines Rework of T.38 negotiation and UDPTL API to address interoperability problems Over the past couple of months, a number of issues with Asterisk negotiating (and successfully completing) T.38 sessions with various endpoints have been found. This patch attempts to address many of them, primarily focused around ensuring that the endpoints' MaxDatagram size is honored, and in addition by ensuring that T.38 session parameter negotiation is performed correctly according to the ITU T.38 Recommendation. The major changes here are: 1) T.38 applications in Asterisk (app_fax) only generate/receive IFP packets, they do not ever work with UDPTL packets. As a result of this, they cannot be allowed to generate packets that would overflow the other endpoints' MaxDatagram size after the UDPTL stack adds any error correction information. With this patch, the application is told the maximum *IFP* size it can generate, based on a calculation using the far end MaxDatagram size and the active error correction mode on the T.38 session. The same is true for sending *our* MaxDatagram size to the remote endpoint; it is computed from the value that the application says it can accept (for a single IFP packet) combined with the active error correction mode. 2) All treatment of T.38 session parameters as 'capabilities' in chan_sip has been removed; these parameters are not at all like audio/video stream capabilities. There are strict rules to follow for computing an answer to a T.38 offer, and chan_sip now follows those rules, using the desired parameters from the application (or channel) that wants to accept the T.38 negotiation. 3) chan_sip now stores and forwards ast_control_t38_parameters structures for tracking 'our' and 'their' T.38 session parameters; this greatly simplifies negotiation, especially for pass-through calls. 4) Since T.38 negotiation without specifying parameters or receiving the final negotiated parameters is not very worthwhile, the AST_CONTROL_T38 control frame has been removed. A note has been added to UPGRADE.txt about this removal, since any out-of-tree applications that use it will no longer function properly until they are upgraded to use AST_CONTROL_T38_PARAMETERS. Review: https://reviewboard.asterisk.org/r/310/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@208468 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/frame.h18
-rw-r--r--include/asterisk/udptl.h40
2 files changed, 27 insertions, 31 deletions
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
index 321a935c1..9d90a083f 100644
--- a/include/asterisk/frame.h
+++ b/include/asterisk/frame.h
@@ -311,7 +311,7 @@ enum ast_control_frame_type {
AST_CONTROL_HOLD = 16, /*!< Indicate call is placed on hold */
AST_CONTROL_UNHOLD = 17, /*!< Indicate call is left from hold */
AST_CONTROL_VIDUPDATE = 18, /*!< Indicate video frame update */
- AST_CONTROL_T38 = 19, /*!< T38 state change request/notification */
+ _XXX_AST_CONTROL_T38 = 19, /*!< T38 state change request/notification \deprecated This is no longer supported. Use AST_CONTROL_T38_PARAMETERS instead. */
AST_CONTROL_SRCUPDATE = 20, /*!< Indicate source of media has changed */
AST_CONTROL_T38_PARAMETERS = 24, /*!< T38 state change request/notification with parameters */
};
@@ -339,14 +339,14 @@ enum ast_control_t38_rate_management {
};
struct ast_control_t38_parameters {
- enum ast_control_t38 request_response; /*!< Request or response of the T38 control frame */
- unsigned int version; /*!< Supported T.38 version */
- unsigned int max_datagram; /*!< Maximum datagram size supported */
- enum ast_control_t38_rate rate; /*!< Maximum fax rate supported */
- enum ast_control_t38_rate_management rate_management; /*!< Rate management setting */
- unsigned int fill_bit_removal:1; /*!< Set if fill bit removal should be used */
- unsigned int transcoding_mmr:1; /*!< Set if MMR transcoding should be used */
- unsigned int transcoding_jbig:1; /*!< Set if JBIG transcoding should be used */
+ enum ast_control_t38 request_response; /*!< Request or response of the T38 control frame */
+ unsigned int version; /*!< Supported T.38 version */
+ unsigned int max_ifp; /*!< Maximum IFP size supported */
+ enum ast_control_t38_rate rate; /*!< Maximum fax rate supported */
+ enum ast_control_t38_rate_management rate_management; /*!< Rate management setting */
+ unsigned int fill_bit_removal:1; /*!< Set if fill bit removal can be used */
+ unsigned int transcoding_mmr:1; /*!< Set if MMR transcoding can be used */
+ unsigned int transcoding_jbig:1; /*!< Set if JBIG transcoding can be used */
};
#define AST_SMOOTHER_FLAG_G729 (1 << 0)
diff --git a/include/asterisk/udptl.h b/include/asterisk/udptl.h
index 74fcf357d..61b5e82d3 100644
--- a/include/asterisk/udptl.h
+++ b/include/asterisk/udptl.h
@@ -33,7 +33,7 @@
#include "asterisk/channel.h"
-enum {
+enum ast_t38_ec_modes {
UDPTL_ERROR_CORRECTION_NONE,
UDPTL_ERROR_CORRECTION_FEC,
UDPTL_ERROR_CORRECTION_REDUNDANCY
@@ -60,11 +60,11 @@ struct ast_udptl *ast_udptl_new(struct sched_context *sched, struct io_context *
struct ast_udptl *ast_udptl_new_with_bindaddr(struct sched_context *sched, struct io_context *io, int callbackmode, struct in_addr in);
-void ast_udptl_set_peer(struct ast_udptl *udptl, struct sockaddr_in *them);
+void ast_udptl_set_peer(struct ast_udptl *udptl, const struct sockaddr_in *them);
-void ast_udptl_get_peer(struct ast_udptl *udptl, struct sockaddr_in *them);
+void ast_udptl_get_peer(const struct ast_udptl *udptl, struct sockaddr_in *them);
-void ast_udptl_get_us(struct ast_udptl *udptl, struct sockaddr_in *us);
+void ast_udptl_get_us(const struct ast_udptl *udptl, struct sockaddr_in *us);
void ast_udptl_destroy(struct ast_udptl *udptl);
@@ -78,37 +78,33 @@ int ast_udptl_write(struct ast_udptl *udptl, struct ast_frame *f);
struct ast_frame *ast_udptl_read(struct ast_udptl *udptl);
-int ast_udptl_fd(struct ast_udptl *udptl);
+int ast_udptl_fd(const struct ast_udptl *udptl);
-int ast_udptl_setqos(struct ast_udptl *udptl, int tos, int cos);
+int ast_udptl_setqos(struct ast_udptl *udptl, unsigned int tos, unsigned int cos);
-void ast_udptl_set_m_type(struct ast_udptl* udptl, int pt);
+void ast_udptl_set_m_type(struct ast_udptl *udptl, unsigned int pt);
-void ast_udptl_set_udptlmap_type(struct ast_udptl* udptl, int pt,
- char* mimeType, char* mimeSubtype);
+void ast_udptl_set_udptlmap_type(struct ast_udptl *udptl, unsigned int pt,
+ char *mimeType, char *mimeSubtype);
-int ast_udptl_lookup_code(struct ast_udptl* udptl, int isAstFormat, int code);
+int ast_udptl_get_error_correction_scheme(const struct ast_udptl *udptl);
-void ast_udptl_offered_from_local(struct ast_udptl* udptl, int local);
+void ast_udptl_set_error_correction_scheme(struct ast_udptl *udptl, enum ast_t38_ec_modes ec);
-int ast_udptl_get_error_correction_scheme(struct ast_udptl* udptl);
+void ast_udptl_set_local_max_ifp(struct ast_udptl *udptl, unsigned int max_ifp);
-void ast_udptl_set_error_correction_scheme(struct ast_udptl* udptl, int ec);
+unsigned int ast_udptl_get_local_max_datagram(const struct ast_udptl *udptl);
-int ast_udptl_get_local_max_datagram(struct ast_udptl* udptl);
+void ast_udptl_set_far_max_datagram(struct ast_udptl *udptl, unsigned int max_datagram);
-void ast_udptl_set_local_max_datagram(struct ast_udptl* udptl, int max_datagram);
+unsigned int ast_udptl_get_far_max_datagram(const struct ast_udptl *udptl);
-int ast_udptl_get_far_max_datagram(struct ast_udptl* udptl);
-
-void ast_udptl_set_far_max_datagram(struct ast_udptl* udptl, int max_datagram);
-
-void ast_udptl_get_current_formats(struct ast_udptl* udptl,
- int* astFormats, int* nonAstFormats);
+unsigned int ast_udptl_get_far_max_ifp(const struct ast_udptl *udptl);
void ast_udptl_setnat(struct ast_udptl *udptl, int nat);
-int ast_udptl_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc);
+int ast_udptl_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags,
+ struct ast_frame **fo, struct ast_channel **rc);
int ast_udptl_proto_register(struct ast_udptl_protocol *proto);