summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--channels/chan_sip.c9
-rw-r--r--res/res_pjsip/config_transport.c10
2 files changed, 15 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 7b9cc6066..4bae39da0 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -30125,6 +30125,7 @@ static int sip_send_keepalive(const void *data)
struct sip_peer *peer = (struct sip_peer*) data;
int res = 0;
const char keepalive[] = "\r\n";
+ size_t count = sizeof(keepalive) - 1;
peer->keepalivesend = -1;
@@ -30135,12 +30136,12 @@ static int sip_send_keepalive(const void *data)
/* Send the packet out using the proper method for this peer */
if ((peer->socket.fd != -1) && (peer->socket.type == AST_TRANSPORT_UDP)) {
- res = ast_sendto(peer->socket.fd, keepalive, sizeof(keepalive), 0, &peer->addr);
+ res = ast_sendto(peer->socket.fd, keepalive, count, 0, &peer->addr);
} else if ((peer->socket.type & (AST_TRANSPORT_TCP | AST_TRANSPORT_TLS)) &&
peer->socket.tcptls_session) {
- res = sip_tcptls_write(peer->socket.tcptls_session, keepalive, sizeof(keepalive));
+ res = sip_tcptls_write(peer->socket.tcptls_session, keepalive, count);
} else if (peer->socket.type == AST_TRANSPORT_UDP) {
- res = ast_sendto(sipsock, keepalive, sizeof(keepalive), 0, &peer->addr);
+ res = ast_sendto(sipsock, keepalive, count, 0, &peer->addr);
}
if (res == -1) {
@@ -30154,7 +30155,7 @@ static int sip_send_keepalive(const void *data)
}
}
- if (res != sizeof(keepalive)) {
+ if (res != count) {
ast_log(LOG_WARNING, "sip_send_keepalive to %s returned %d: %s\n", ast_sockaddr_stringify(&peer->addr), res, strerror(errno));
}
diff --git a/res/res_pjsip/config_transport.c b/res/res_pjsip/config_transport.c
index 2f29456ab..a9a90ac92 100644
--- a/res/res_pjsip/config_transport.c
+++ b/res/res_pjsip/config_transport.c
@@ -917,6 +917,12 @@ static int transport_tls_method_handler(const struct aco_option *opt, struct ast
state->tls.method = PJSIP_SSL_UNSPECIFIED_METHOD;
} else if (!strcasecmp(var->value, "tlsv1")) {
state->tls.method = PJSIP_TLSV1_METHOD;
+#ifdef HAVE_PJSIP_TLS_TRANSPORT_PROTO
+ } else if (!strcasecmp(var->value, "tlsv1_1")) {
+ state->tls.method = PJSIP_TLSV1_1_METHOD;
+ } else if (!strcasecmp(var->value, "tlsv1_2")) {
+ state->tls.method = PJSIP_TLSV1_2_METHOD;
+#endif
} else if (!strcasecmp(var->value, "sslv2")) {
state->tls.method = PJSIP_SSLV2_METHOD;
} else if (!strcasecmp(var->value, "sslv3")) {
@@ -933,6 +939,10 @@ static int transport_tls_method_handler(const struct aco_option *opt, struct ast
static const char *tls_method_map[] = {
[PJSIP_SSL_UNSPECIFIED_METHOD] = "unspecified",
[PJSIP_TLSV1_METHOD] = "tlsv1",
+#ifdef HAVE_PJSIP_TLS_TRANSPORT_PROTO
+ [PJSIP_TLSV1_1_METHOD] = "tlsv1_1",
+ [PJSIP_TLSV1_2_METHOD] = "tlsv1_2",
+#endif
[PJSIP_SSLV2_METHOD] = "sslv2",
[PJSIP_SSLV3_METHOD] = "sslv3",
[PJSIP_SSLV23_METHOD] = "sslv23",