summaryrefslogtreecommitdiff
path: root/res/res_pjsip_t38.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-09-19 11:13:21 +0000
committerJoshua Colp <jcolp@digium.com>2016-10-23 13:53:55 +0000
commit403c4f58338e226c066956865218eeec64d71ed1 (patch)
treeb29bea4bbff01f80ff9eb3194f5ec08a19526f54 /res/res_pjsip_t38.c
parente03364c40aa073b69ca8c6652fd17a91908b9aaf (diff)
pjsip: Support dual stack automatically.
This change adds support for dual stack automatically. No configuration is required and the IP address and version in the SIP messages and SDP will be automatically changed based on the transport over which the message is being sent. RTP usage has also been changed to listen on both IPv4 and IPv6 simultaneously to allow media to flow, and to allow ICE support on both simultaneously. This also allows failover between IPv6 and IPv4 to work as expected. ASTERISK-26309 #close Change-Id: I235a421d8f9a326606d861b449fa6fe3a030572d
Diffstat (limited to 'res/res_pjsip_t38.c')
-rw-r--r--res/res_pjsip_t38.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c
index 150336a08..b052cc428 100644
--- a/res/res_pjsip_t38.c
+++ b/res/res_pjsip_t38.c
@@ -51,11 +51,8 @@ ASTERISK_REGISTER_FILE()
/*! \brief The number of seconds after receiving a T.38 re-invite before automatically rejecting it */
#define T38_AUTOMATIC_REJECTION_SECONDS 5
-/*! \brief Address for IPv4 UDPTL */
-static struct ast_sockaddr address_ipv4;
-
-/*! \brief Address for IPv6 UDPTL */
-static struct ast_sockaddr address_ipv6;
+/*! \brief Address for UDPTL */
+static struct ast_sockaddr address;
/*! \brief T.38 state information */
struct t38_state {
@@ -259,8 +256,7 @@ static int t38_initialize_session(struct ast_sip_session *session, struct ast_si
return 0;
}
- if (!(session_media->udptl = ast_udptl_new_with_bindaddr(NULL, NULL, 0,
- session->endpoint->media.t38.ipv6 ? &address_ipv6 : &address_ipv4))) {
+ if (!(session_media->udptl = ast_udptl_new_with_bindaddr(NULL, NULL, 0, &address))) {
return -1;
}
@@ -922,8 +918,7 @@ static int load_module(void)
{
CHECK_PJSIP_SESSION_MODULE_LOADED();
- ast_sockaddr_parse(&address_ipv4, "0.0.0.0", 0);
- ast_sockaddr_parse(&address_ipv6, "::", 0);
+ ast_sockaddr_parse(&address, "::", 0);
if (ast_sip_session_register_supplement(&t38_supplement)) {
ast_log(LOG_ERROR, "Unable to register T.38 session supplement\n");