summaryrefslogtreecommitdiff
path: root/res/res_pjsip.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-07-01 11:36:53 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-07-01 11:36:53 -0500
commit01a8d9844b50e98af9974a2367f7c6d6fa69774f (patch)
tree6ffaa430dc6966aea9fd384eea94faef4cf24739 /res/res_pjsip.c
parent4ad22164fefcdd14cde12b3a88a859104175212f (diff)
parente6e12c752cfb6ef1a0164c290ebc27b093f1041f (diff)
Merge "res_pjsip.c: Register PJMEDIA error code decoder."
Diffstat (limited to 'res/res_pjsip.c')
-rw-r--r--res/res_pjsip.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 12bb930b5..d99c1cf84 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"
@@ -4293,6 +4294,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;
@@ -4308,6 +4322,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;