diff options
author | Joshua Colp <jcolp@digium.com> | 2016-07-01 11:16:12 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-07-01 11:16:12 -0500 |
commit | 65d0c0beb12e28df23532a80b6fa8300b83da39c (patch) | |
tree | f731817b9207ad84bbca2c85234c1dfbe4c504ec | |
parent | 643086dbc995f5acc0060ca74cf8d75fa06fa06a (diff) | |
parent | 38a4e983dcf0d83006be1c50982fd62fdc6ea1a3 (diff) |
Merge "res_pjsip.c: Register PJMEDIA error code decoder." into 13
-rw-r--r-- | res/res_pjsip.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 4468975c9..07b82176a 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -24,6 +24,7 @@ #include <pjsip/sip_transaction.h> #include <pj/timer.h> #include <pjlib.h> +#include <pjmedia/errno.h> #include "asterisk/res_pjsip.h" #include "res_pjsip/include/res_pjsip_private.h" @@ -4258,6 +4259,19 @@ error: return AST_MODULE_LOAD_DECLINE; } +/* + * This is a place holder function to ensure that pjmedia_strerr() is at + * least directly referenced by this module to ensure that the loader + * linker will link to the function. If a module only indirectly + * references a function from another module, such as a callback parameter + * to a function, the loader linker has been known to miss the link. + */ +void never_called_res_pjsip(void); +void never_called_res_pjsip(void) +{ + pjmedia_strerror(0, NULL, 0); +} + static int load_module(void) { struct ast_threadpool_options options; @@ -4273,6 +4287,12 @@ static int load_module(void) goto error; } + /* Register PJMEDIA error codes for SDP parsing errors */ + if (pj_register_strerror(PJMEDIA_ERRNO_START, PJ_ERRNO_SPACE_SIZE, pjmedia_strerror) + != PJ_SUCCESS) { + ast_log(LOG_WARNING, "Failed to register pjmedia error codes. Codes will not be decoded.\n"); + } + if (ast_sip_initialize_system()) { ast_log(LOG_ERROR, "Failed to initialize SIP 'system' configuration section. Aborting load\n"); goto error; |