Project "FreeSWITCH Source" received a push.

branch: master updated

       via: 13dc6058bc8492df89cbdd9ab8b48ac5ca7e2981 (commit)
      from: f734891d75d0c8a24ec815aeb8386e3b8646c162 (commit)


= COMMIT LOG ===========================================================
committer: Anthony Minessale
comments: 
pass custom headers backwards over sofia

diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h
index da92746..31cd058 100644
--- a/src/mod/endpoints/mod_sofia/mod_sofia.h
+++ b/src/mod/endpoints/mod_sofia/mod_sofia.h
@@ -96,8 +96,10 @@ typedef struct private_object private_object_t;
 #define SOFIA_MULTIPART_PREFIX_T "~sip_mp_"
 #define SOFIA_SIP_HEADER_PREFIX "sip_h_"
 #define SOFIA_SIP_RESPONSE_HEADER_PREFIX "sip_rh_"
+#define SOFIA_SIP_RESPONSE_HEADER_PREFIX_T "~sip_rh_"
 #define SOFIA_SIP_BYE_HEADER_PREFIX "sip_bye_h_"
 #define SOFIA_SIP_PROGRESS_HEADER_PREFIX "sip_ph_"
+#define SOFIA_SIP_PROGRESS_HEADER_PREFIX_T "~sip_ph_"
 #define SOFIA_SIP_HEADER_PREFIX_T "~sip_h_"
 #define SOFIA_DEFAULT_PORT "5060"
 #define SOFIA_DEFAULT_TLS_PORT "5061"
diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c
index e9d2cad..d1d6842 100644
--- a/src/mod/endpoints/mod_sofia/sofia.c
+++ b/src/mod/endpoints/mod_sofia/sofia.c
@@ -4147,7 +4147,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
 
 
 		if ((status == 180 || status == 183 || status == 200)) {
-			const char *x_freeswitch_support;
+			const char *x_freeswitch_support, *vval;
 
 			switch_channel_set_flag(channel, CF_MEDIA_ACK);
 
@@ -4163,6 +4163,20 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
 
 			sofia_glue_set_extra_headers(channel, sip, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
 
+			if (!(vval = switch_channel_get_variable(channel, "sip_copy_custom_headers")) || switch_true(vval)) {
+				switch_core_session_t *other_session;
+				
+				if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
+					switch_ivr_transfer_variable(session, other_session, SOFIA_SIP_PROGRESS_HEADER_PREFIX_T);
+					if (status == 200) {
+						switch_ivr_transfer_variable(session, other_session, SOFIA_SIP_RESPONSE_HEADER_PREFIX_T);
+					}
+					switch_core_session_rwunlock(other_session);
+				}
+			}
+			
+
+
 			sofia_update_callee_id(session, profile, sip, SWITCH_FALSE);
 
 			if (sofia_test_pflag(tech_pvt->profile, PFLAG_AUTOFIX_TIMING)) {
========================================================================

Summary of changes:
 src/mod/endpoints/mod_sofia/mod_sofia.h |    2 ++
 src/mod/endpoints/mod_sofia/sofia.c     |   16 +++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)

this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email
For more info, see http://blog.chomperstomp.com/?p=630 --
FreeSWITCH Source