]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_rtp_asterisk.c: Fix build failure when not building with pjproject.
authorGuido Falsi <madpilot@freebsd.org>
Fri, 17 Sep 2021 19:58:12 +0000 (21:58 +0200)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 21 Sep 2021 15:56:58 +0000 (10:56 -0500)
Some code has been added referencing symbols defined in a block
protected by #ifdef HAVE_PJPROJECT. Protect those code parts in
ifdef blocks too.

ASTERISK-29660

Change-Id: Ib18d4392d51ac80ca5481dabf6e498a4e3e49e6f

res/res_rtp_asterisk.c

index 6da4824db919ee0387c561425136ca025c164542..8ede400da868fcf88b25a75eb36b2864fe73ab36 100644 (file)
@@ -655,8 +655,10 @@ static BIO_METHOD *dtls_bio_methods;
 
 static int __rtp_sendto(struct ast_rtp_instance *instance, void *buf, size_t size, int flags, struct ast_sockaddr *sa, int rtcp, int *via_ice, int use_srtp);
 
+#ifdef HAVE_PJPROJECT
 static void stunaddr_resolve_callback(const struct ast_dns_query *query);
 static int store_stunaddr_resolved(const struct ast_dns_query *query);
+#endif
 
 #if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)
 static int dtls_bio_new(BIO *bio)
@@ -9026,6 +9028,7 @@ static int ast_rtp_bundle(struct ast_rtp_instance *child, struct ast_rtp_instanc
        return 0;
 }
 
+#ifdef HAVE_PJPROJECT
 static void stunaddr_resolve_callback(const struct ast_dns_query *query)
 {
        const int lowest_ttl = ast_dns_result_get_lowest_ttl(ast_dns_query_get_result(query));
@@ -9091,6 +9094,7 @@ static void clean_stunaddr(void) {
        memset(&stunaddr, 0, sizeof(stunaddr));
        ast_rwlock_unlock(&stunaddr_lock);
 }
+#endif
 
 #if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)
 /*! \pre instance is locked */
@@ -9189,7 +9193,9 @@ static char *handle_cli_rtp_set_debug(struct ast_cli_entry *e, int cmd, struct a
 
 static char *handle_cli_rtp_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
+#ifdef HAVE_PJPROJECT
        struct sockaddr_in stunaddr_copy;
+#endif
        switch (cmd) {
        case CLI_INIT:
                e->command = "rtp show settings";