char *geoloc_routing_hdr_value = NULL;
char *geoloc_uri = NULL;
int rc = 0;
- RAII_VAR(struct ast_str *, buf, ast_str_create(1024), ast_free);
+ RAII_VAR(struct ast_str *, buf, NULL, ast_free);
pjsip_generic_string_hdr *geoloc_hdr = NULL;
pjsip_generic_string_hdr *geoloc_routing_hdr = NULL;
SCOPE_ENTER(3, "%s\n", session_name);
"Done.\n", session_name,
PJSTR_PRINTF_VAR(geoloc_hdr->hvalue));
} else {
- SCOPE_EXIT_LOG_RTN_VALUE(0, LOG_NOTICE, "%s: Endpoint has no geoloc_incoming_call_profile. "
+ SCOPE_EXIT_RTN_VALUE(0, "%s: Endpoint has no geoloc_incoming_call_profile. "
"Done.\n", session_name);
}
}
}
}
+ buf = ast_str_create(1024);
+ if (!buf) {
+ SCOPE_EXIT_LOG_RTN_VALUE(0, LOG_WARNING, "%s: Unable to allocate buf\n", session_name);
+ }
+
if (config_profile->precedence != AST_GEOLOC_PRECED_DISCARD_CONFIG) {
config_eprofile = ast_geoloc_eprofile_create_from_profile(config_profile);
if (!config_eprofile) {
RAII_VAR(struct ast_geoloc_eprofile *, config_eprofile, NULL, ao2_cleanup);
RAII_VAR(struct ast_geoloc_eprofile *, incoming_eprofile, NULL, ao2_cleanup);
struct ast_geoloc_eprofile *final_eprofile = NULL;
- RAII_VAR(struct ast_str *, buf, ast_str_create(1024), ast_free);
+ RAII_VAR(struct ast_str *, buf, NULL, ast_free);
struct ast_datastore *ds = NULL; /* The channel cleans up ds */
pjsip_msg_body *orig_body = NULL;
pjsip_generic_string_hdr *geoloc_hdr = NULL;
const char *uri;
SCOPE_ENTER(3, "%s\n", session_name);
- if (!buf) {
- SCOPE_EXIT_LOG_RTN(LOG_WARNING, "%s: Unable to allocate buf\n",
- session_name);
- }
-
if (!endpoint) {
SCOPE_EXIT_LOG_RTN(LOG_WARNING, "%s: Session has no endpoint. Skipping.\n",
session_name);
}
if (ast_strlen_zero(endpoint->geoloc_outgoing_call_profile)) {
- SCOPE_EXIT_LOG_RTN(LOG_NOTICE, "%s: Endpoint has no geoloc_outgoing_call_profile. "
- "Skipping.\n", session_name);
+ SCOPE_EXIT_RTN("%s: Endpoint has no geoloc_outgoing_call_profile. Skipping.\n",
+ session_name);
}
config_profile = ast_geoloc_get_profile(endpoint->geoloc_outgoing_call_profile);
ast_geoloc_eprofile_refresh_location(final_eprofile);
}
+ buf = ast_str_create(1024);
+ if (!buf) {
+ SCOPE_EXIT_LOG_RTN(LOG_WARNING, "%s: Unable to allocate buf\n", session_name);
+ }
+
if (final_eprofile->format == AST_GEOLOC_FORMAT_URI) {
uri = ast_geoloc_eprofile_to_uri(final_eprofile, channel, &buf, session_name);
if (!uri) {