From bdb8bd061bf79e25feb24a1e7595235160222b4f Mon Sep 17 00:00:00 2001
From: Anthony Minessale <anthony.minessale@gmail.com>
Date: Wed, 21 Oct 2009 23:09:41 +0000
Subject: [PATCH] add sip-force-extension

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15191 d0543943-73ff-0310-b7d9-9358b9ac24b2
---
 src/mod/endpoints/mod_sofia/sofia_reg.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c
index 471837bd8c..a6f52c651e 100644
--- a/src/mod/endpoints/mod_sofia/sofia_reg.c
+++ b/src/mod/endpoints/mod_sofia/sofia_reg.c
@@ -714,6 +714,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
 	char *dup_mwi_account = NULL;
 	char *mwi_user = NULL;
 	char *mwi_host = NULL;
+	char *var = NULL;
 	const char *from_user = NULL;
 	const char *from_host = NULL;
 	const char *reg_host = profile->reg_db_domain;
@@ -1008,6 +1009,11 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
 	}
   reg:
 
+
+	if (v_event && *v_event && (var = switch_event_get_header(*v_event, "sip-force-extension"))) {
+		to_user = var;
+	}
+
 	if (v_event && *v_event && (mwi_account = switch_event_get_header(*v_event, "mwi-account"))) {
 		dup_mwi_account = strdup(mwi_account);
 		switch_assert(dup_mwi_account != NULL);