Make --with-pjproject-bundled the default for Asterisk 15
[asterisk/asterisk.git] / channels / chan_mgcp.c
index 0210e8a..6cac4bc 100644 (file)
 
 #include "asterisk.h"
 
-ASTERISK_REGISTER_FILE()
-
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <net/if.h>
 #include <fcntl.h>
 #include <netdb.h>
-#include <sys/signal.h>
 #include <signal.h>
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
@@ -1253,7 +1250,7 @@ static int mgcp_write(struct ast_channel *ast, struct ast_frame *frame)
                }
        } else {
                if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), frame->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) {
-                       struct ast_str *cap_buf = ast_str_alloca(64);
+                       struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
 
                        ast_log(LOG_WARNING, "Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n",
                                ast_format_get_name(frame->subclass.format),
@@ -1986,9 +1983,9 @@ static int process_sdp(struct mgcp_subchannel *sub, struct mgcp_request *req)
        int codec, codec_count=0;
        int iterator;
        struct mgcp_endpoint *p = sub->parent;
-       struct ast_str *global_buf = ast_str_alloca(64);
-       struct ast_str *peer_buf = ast_str_alloca(64);
-       struct ast_str *pvt_buf = ast_str_alloca(64);
+       struct ast_str *global_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
+       struct ast_str *peer_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
+       struct ast_str *pvt_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
 
        /* Get codec and RTP info from SDP */
        m = get_sdp(req, "m");
@@ -3971,7 +3968,7 @@ static struct ast_channel *mgcp_request(const char *type, struct ast_format_cap
        char tmp[256];
 
        if (!(ast_format_cap_iscompatible(cap, global_capability))) {
-               struct ast_str *cap_buf = ast_str_alloca(64);
+               struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
                ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format '%s'\n",
                        ast_format_cap_get_names(cap, &cap_buf));
                /*return NULL;*/
@@ -4863,11 +4860,11 @@ static int reload_config(int reload)
 static int load_module(void)
 {
        if (!(global_capability = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {
-               return AST_MODULE_LOAD_FAILURE;
+               return AST_MODULE_LOAD_DECLINE;
        }
        if (!(mgcp_tech.capabilities = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {
                ao2_ref(global_capability, -1);
-               return AST_MODULE_LOAD_FAILURE;
+               return AST_MODULE_LOAD_DECLINE;
        }
        ast_format_cap_append(global_capability, ast_format_ulaw, 0);
        ast_format_cap_append(mgcp_tech.capabilities, ast_format_ulaw, 0);
@@ -4876,7 +4873,7 @@ static int load_module(void)
                ast_log(LOG_WARNING, "Unable to create schedule context\n");
                ao2_ref(global_capability, -1);
                ao2_ref(mgcp_tech.capabilities, -1);
-               return AST_MODULE_LOAD_FAILURE;
+               return AST_MODULE_LOAD_DECLINE;
        }
 
        if (!(io = io_context_create())) {
@@ -4884,7 +4881,7 @@ static int load_module(void)
                ast_sched_context_destroy(sched);
                ao2_ref(global_capability, -1);
                ao2_ref(mgcp_tech.capabilities, -1);
-               return AST_MODULE_LOAD_FAILURE;
+               return AST_MODULE_LOAD_DECLINE;
        }
 
        if (reload_config(0)) {
@@ -4900,7 +4897,7 @@ static int load_module(void)
                ast_sched_context_destroy(sched);
                ao2_ref(global_capability, -1);
                ao2_ref(mgcp_tech.capabilities, -1);
-               return AST_MODULE_LOAD_FAILURE;
+               return AST_MODULE_LOAD_DECLINE;
        }
 
        ast_rtp_glue_register(&mgcp_rtp_glue);