[Freeswitch-svn] [commit] r8972 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Wed Jul 9 18:39:48 EDT 2008


Author: mikej
Date: Wed Jul  9 18:39:48 2008
New Revision: 8972

Modified:
   freeswitch/trunk/src/switch_core_codec.c

Log:
report based on the codec we actually set.

Modified: freeswitch/trunk/src/switch_core_codec.c
==============================================================================
--- freeswitch/trunk/src/switch_core_codec.c	(original)
+++ freeswitch/trunk/src/switch_core_codec.c	Wed Jul  9 18:39:48 2008
@@ -76,16 +76,16 @@
 
 	if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
 		switch_channel_event_set_data(session->channel, event);
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-name", "%s", codec->implementation->iananame);
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-rate", "%d", codec->implementation->actual_samples_per_second);
-		if (codec->implementation->actual_samples_per_second != codec->implementation->samples_per_second) {
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-reported-read-codec-rate", "%d", codec->implementation->samples_per_second);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-name", "%s", session->read_codec->implementation->iananame);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-rate", "%d", session->read_codec->implementation->actual_samples_per_second);
+		if (session->read_codec->implementation->actual_samples_per_second != session->read_codec->implementation->samples_per_second) {
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-reported-read-codec-rate", "%d", session->read_codec->implementation->samples_per_second);
 		}
 		switch_event_fire(&event);
 	}
 
-	switch_channel_set_variable(channel, "read_codec", codec->implementation->iananame);
-	switch_snprintf(tmp, sizeof(tmp), "%d", codec->implementation->actual_samples_per_second);
+	switch_channel_set_variable(channel, "read_codec", session->read_codec->implementation->iananame);
+	switch_snprintf(tmp, sizeof(tmp), "%d", session->read_codec->implementation->actual_samples_per_second);
 	switch_channel_set_variable(channel, "read_rate", tmp);
 
 
@@ -140,17 +140,17 @@
 
 	if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
 		switch_channel_event_set_data(session->channel, event);
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-name", "%s", codec->implementation->iananame);
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-rate", "%d", codec->implementation->actual_samples_per_second);
-		if (codec->implementation->actual_samples_per_second != codec->implementation->samples_per_second) {
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-name", "%s", session->write_codec->implementation->iananame);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-rate", "%d", session->write_codec->implementation->actual_samples_per_second);
+		if (session->write_codec->implementation->actual_samples_per_second != session->write_codec->implementation->samples_per_second) {
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-reported-write-codec-rate", "%d",
-									codec->implementation->actual_samples_per_second);
+									session->write_codec->implementation->actual_samples_per_second);
 		}
 		switch_event_fire(&event);
 	}
 
-	switch_channel_set_variable(channel, "write_codec", codec->implementation->iananame);
-	switch_snprintf(tmp, sizeof(tmp), "%d", codec->implementation->actual_samples_per_second);
+	switch_channel_set_variable(channel, "write_codec", session->write_codec->implementation->iananame);
+	switch_snprintf(tmp, sizeof(tmp), "%d", session->write_codec->implementation->actual_samples_per_second);
 	switch_channel_set_variable(channel, "write_rate", tmp);
 
 	return SWITCH_STATUS_SUCCESS;



More information about the Freeswitch-svn mailing list