--- res/res_pjsip/config_transport.c (Asterisk 18.0) +++ res/res_pjsip/config_transport.c (working copy) @@ -801,2 +801,3 @@ } +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 } else if (transport->type == AST_TRANSPORT_TLS) { @@ -831,2 +832,3 @@ } +#endif } else if ((transport->type == AST_TRANSPORT_WS) || (transport->type == AST_TRANSPORT_WSS)) { @@ -1168,2 +1170,3 @@ /*! \brief Helper function which turns a cipher name into an identifier */ +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 static pj_ssl_cipher cipher_name_to_id(const char *name) @@ -1187,2 +1190,3 @@ } +#endif @@ -1198,2 +1202,3 @@ */ +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 static int transport_cipher_add(struct ast_sip_transport_state *state, const char *name) @@ -1228,4 +1233,6 @@ } +#endif /*! \brief Custom handler for TLS cipher setting */ +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 static int transport_tls_cipher_handler(const struct aco_option *opt, struct ast_variable *var, void *obj) @@ -1256,3 +1263,5 @@ } +#endif +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 static void cipher_to_str(char **buf, const pj_ssl_cipher *ciphers, unsigned int cipher_num) @@ -1278,3 +1287,5 @@ } +#endif +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 static int transport_tls_cipher_to_str(const void *obj, const intptr_t *args, char **buf) @@ -1291,3 +1302,5 @@ } +#endif +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 static char *handle_pjsip_list_ciphers(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) @@ -1322,2 +1335,3 @@ } +#endif @@ -1521,3 +1535,5 @@ static struct ast_cli_entry cli_commands[] = { +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 AST_CLI_DEFINE(handle_pjsip_list_ciphers, "List available OpenSSL cipher names"), +#endif AST_CLI_DEFINE(ast_sip_cli_traverse_objects, "List PJSIP Transports", @@ -1633,3 +1649,5 @@ ast_sorcery_object_field_register_custom(sorcery, "transport", "method", "", transport_tls_method_handler, tls_method_to_str, NULL, 0, 0); +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 ast_sorcery_object_field_register_custom(sorcery, "transport", "cipher", "", transport_tls_cipher_handler, transport_tls_cipher_to_str, NULL, 0, 0); +#endif ast_sorcery_object_field_register_custom(sorcery, "transport", "local_net", "", transport_localnet_handler, localnet_to_str, localnet_to_vl, 0, 0);