From b0cdad5d5d81fac140609046e426877f6db9cae0 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 18 Apr 2013 16:44:40 -0500 Subject: [PATCH] add geolocation header parser --- src/mod/endpoints/mod_sofia/sofia.c | 2 ++ src/mod/endpoints/mod_sofia/sofia_glue.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 9b88c4e5fb..9af181dd73 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -8702,6 +8702,8 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia switch_channel_set_variable(channel, "push_channel_name", "true"); } else if (!strcasecmp(un->un_name, "X-FS-Support")) { tech_pvt->x_freeswitch_support_remote = switch_core_session_strdup(session, un->un_value); + } else if (!strcasecmp(un->un_name, "Geolocation")) { + switch_channel_set_variable(channel, "sip_geolocation", un->un_value); } else if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2) || !strcasecmp(un->un_name, "User-to-User")) { if (!zstr(un->un_value)) { char new_name[512] = ""; diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 2755b9d0ee..39e75016ef 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -569,6 +569,10 @@ char *sofia_glue_get_extra_headers(switch_channel_t *channel, const char *prefix for (; hi; hi = hi->next) { const char *name = (char *) hi->name; char *value = (char *) hi->value; + + if (!strcasecmp(name, "sip_geolocation")) { + stream.write_function(&stream, "Geolocation: %s\r\n", value); + } if (!strncasecmp(name, prefix, strlen(prefix))) { if ( !exclude_regex || !(proceed = switch_regex_perform(name, exclude_regex, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {