summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/res_http_post.c19
-rw-r--r--res/res_pjsip/pjsip_configuration.c2
-rw-r--r--res/res_pjsip_outbound_registration.c22
-rw-r--r--res/res_pjsip_registrar.c2
-rw-r--r--res/res_pjsip_transport_websocket.c1
5 files changed, 32 insertions, 14 deletions
diff --git a/res/res_http_post.c b/res/res_http_post.c
index 3f0a58e36..9f5b1837a 100644
--- a/res/res_http_post.c
+++ b/res/res_http_post.c
@@ -55,6 +55,9 @@
#ifdef GMIME_TYPE_CONTENT_TYPE
#define AST_GMIME_VER_24
#endif
+#if GMIME_MAJOR_VERSION >= 3
+#define AST_GMIME_VER_30
+#endif
/* just a little structure to hold callback info for gmime */
struct mime_cbinfo {
@@ -84,7 +87,11 @@ static void post_raw(GMimePart *part, const char *post_dir, const char *fn)
stream = g_mime_stream_fs_new(fd);
+#ifdef AST_GMIME_VER_30
+ content = g_mime_part_get_content(part);
+#else
content = g_mime_part_get_content_object(part);
+#endif
g_mime_data_wrapper_write_to_stream(content, stream);
g_mime_stream_flush(stream);
@@ -107,7 +114,11 @@ static GMimeMessage *parse_message(FILE *f)
g_object_unref(stream);
- message = g_mime_parser_construct_message(parser);
+ message = g_mime_parser_construct_message(parser
+#ifdef AST_GMIME_VER_30
+ , NULL
+#endif
+ );
g_object_unref(parser);
@@ -486,7 +497,11 @@ static int reload(void)
static int load_module(void)
{
- g_mime_init(0);
+ g_mime_init(
+#ifndef AST_GMIME_VER_30
+ 0
+#endif
+ );
__ast_http_post_load(0);
diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index 4e12b04cc..d3ff1f32b 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -1994,7 +1994,7 @@ int ast_res_pjsip_initialize_configuration(void)
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "max_audio_streams", "1", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, media.max_audio_streams));
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "max_video_streams", "1", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, media.max_video_streams));
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "bundle", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.bundle));
- ast_sorcery_object_field_register(sip_sorcery, "endpoint", "webrtc", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.webrtc));
+ ast_sorcery_object_field_register(sip_sorcery, "endpoint", "webrtc", "no", OPT_YESNO_T, 1, FLDSET(struct ast_sip_endpoint, media.webrtc));
if (ast_sip_initialize_sorcery_transport()) {
ast_log(LOG_ERROR, "Failed to register SIP transport support with sorcery\n");
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index 8a840ff05..7b605b982 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -459,7 +459,7 @@ static int line_identify_relationship(void *obj, void *arg, int flags)
struct sip_outbound_registration_state *state = obj;
pjsip_param *line = arg;
- return !pj_strcmp2(&line->value, state->client_state->line) ? CMP_MATCH | CMP_STOP : 0;
+ return !pj_strcmp2(&line->value, state->client_state->line) ? CMP_MATCH : 0;
}
static struct pjsip_param *get_uri_option_line(const void *uri)
@@ -558,20 +558,21 @@ static int handle_client_registration(void *data)
{
RAII_VAR(struct sip_outbound_registration_client_state *, client_state, data, ao2_cleanup);
pjsip_tx_data *tdata;
- pjsip_regc_info info;
- char server_uri[PJSIP_MAX_URL_SIZE];
- char client_uri[PJSIP_MAX_URL_SIZE];
if (client_state->status == SIP_REGISTRATION_STOPPED
|| pjsip_regc_register(client_state->client, PJ_FALSE, &tdata) != PJ_SUCCESS) {
return 0;
}
- pjsip_regc_get_info(client_state->client, &info);
- ast_copy_pj_str(server_uri, &info.server_uri, sizeof(server_uri));
- ast_copy_pj_str(client_uri, &info.client_uri, sizeof(client_uri));
- ast_debug(1, "Outbound REGISTER attempt %u to '%s' with client '%s'\n",
- client_state->retries + 1, server_uri, client_uri);
+ if (DEBUG_ATLEAST(1)) {
+ pjsip_regc_info info;
+
+ pjsip_regc_get_info(client_state->client, &info);
+ ast_log(LOG_DEBUG, "Outbound REGISTER attempt %u to '%.*s' with client '%.*s'\n",
+ client_state->retries + 1,
+ (int) info.server_uri.slen, info.server_uri.ptr,
+ (int) info.client_uri.slen, info.client_uri.ptr);
+ }
if (client_state->support_path) {
pjsip_supported_hdr *hdr;
@@ -987,7 +988,8 @@ static void sip_outbound_registration_state_destroy(void *obj)
struct sip_outbound_registration_state *state = obj;
ast_debug(3, "Destroying registration state for registration to server '%s' from client '%s'\n",
- state->registration->server_uri, state->registration->client_uri);
+ state->registration ? state->registration->server_uri : "",
+ state->registration ? state->registration->client_uri : "");
ao2_cleanup(state->registration);
if (!state->client_state) {
diff --git a/res/res_pjsip_registrar.c b/res/res_pjsip_registrar.c
index 2db753889..a4ce54769 100644
--- a/res/res_pjsip_registrar.c
+++ b/res/res_pjsip_registrar.c
@@ -123,7 +123,7 @@ static int registrar_find_contact(void *obj, void *arg, int flags)
const struct registrar_contact_details *details = arg;
pjsip_uri *contact_uri = pjsip_parse_uri(details->pool, (char*)contact->uri, strlen(contact->uri), 0);
- return (pjsip_uri_cmp(PJSIP_URI_IN_CONTACT_HDR, details->uri, contact_uri) == PJ_SUCCESS) ? CMP_MATCH | CMP_STOP : 0;
+ return (pjsip_uri_cmp(PJSIP_URI_IN_CONTACT_HDR, details->uri, contact_uri) == PJ_SUCCESS) ? CMP_MATCH : 0;
}
/*! \brief Internal function which validates provided Contact headers to confirm that they are acceptable, and returns number of contacts */
diff --git a/res/res_pjsip_transport_websocket.c b/res/res_pjsip_transport_websocket.c
index cdda8c196..1429cceed 100644
--- a/res/res_pjsip_transport_websocket.c
+++ b/res/res_pjsip_transport_websocket.c
@@ -365,6 +365,7 @@ static void websocket_cb(struct ast_websocket *session, struct ast_variable *par
if (ast_sip_push_task_synchronous(serializer, transport_create, &create_data)) {
ast_log(LOG_ERROR, "Could not create WebSocket transport.\n");
+ ast_taskprocessor_unreference(serializer);
ast_websocket_unref(session);
return;
}