From 1d210c92542a070629e017098c6fe83f4e852f66 Mon Sep 17 00:00:00 2001
From: Brian West <brian@freeswitch.org>
Date: Sat, 1 May 2010 19:50:53 -0500
Subject: [PATCH]  MODENDP-303

---
 src/mod/endpoints/mod_sofia/sofia_glue.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c
index e2d6f0fa4e..3875fd2154 100644
--- a/src/mod/endpoints/mod_sofia/sofia_glue.c
+++ b/src/mod/endpoints/mod_sofia/sofia_glue.c
@@ -164,7 +164,11 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32
 	}
 
 	if (!sr) {
-		sr = "sendrecv";
+		if ((var_val = switch_channel_get_variable(tech_pvt->channel, "media_audio_mode"))) { 
+			sr=var_val; 
+		} else {
+			sr = "sendrecv";
+		}
 	}
 
 	if (!tech_pvt->owner_id) {