add some goodies to sofia

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6003 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-10-19 21:06:09 +00:00
parent b312192e56
commit cf87d918cf
6 changed files with 52 additions and 6 deletions
+8 -4
View File
@@ -43,8 +43,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_read_codec(switch_core_s
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->samples_per_second);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-actual-read-codec-rate", "%d", codec->implementation->actual_samples_per_second);
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_fire(&event);
}
@@ -70,8 +72,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_write_codec(switch_core_
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->samples_per_second);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-actual-write-codec-rate", "%d", codec->implementation->actual_samples_per_second);
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-reported-write-codec-rate", "%d", codec->implementation->actual_samples_per_second);
}
switch_event_fire(&event);
}