diff --git a/res/res_pjsip_geolocation.c b/res/res_pjsip_geolocation.c index 422c56d5f9..0053943dcb 100644 --- a/res/res_pjsip_geolocation.c +++ b/res/res_pjsip_geolocation.c @@ -602,10 +602,13 @@ static void handle_outgoing_request(struct ast_sip_session *session, struct pjsi uri = ast_strdupa(ast_str_buffer(buf)); ast_str_reset(buf); ast_str_set(&buf, 0, "<%s>", uri); + if (!ast_strlen_zero(final_eprofile->location_source)) { + ast_str_append(&buf, 0, ";loc-src=%s", final_eprofile->location_source); + } uri = ast_strdupa(ast_str_buffer(buf)); - ast_trace(4, "%s: Using URI '%s'\n", session_name, uri); + /* It's almost impossible for add header to fail but you never know */ geoloc_hdr = ast_sip_add_header2(tdata, "Geolocation", uri); if (geoloc_hdr == NULL) {