mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-17 14:58:34 +00:00
refactor some more rtp stuff
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7169 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
8345331ff9
commit
79dc86658b
7 files changed
+80
-101
No files matched your search
@@ -2647,9 +2647,21 @@ static switch_status_t conf_api_sub_dtmf(conference_member_t * member, switch_st
|
||||
{
|
||||
switch_event_t *event;
|
||||
char *dtmf = (char *) data;
|
||||
char *p = dtmf;
|
||||
char *p;
|
||||
switch_dtmf_t _dtmf = { 0, SWITCH_DEFAULT_DTMF_DURATION };
|
||||
int tmp;
|
||||
|
||||
if ((p = strchr(dtmf, '+'))) {
|
||||
tmp = atoi(p);
|
||||
if (tmp > 0) {
|
||||
if (member->orig_read_codec && member->orig_read_codec->implementation) {
|
||||
_dtmf.duration = tmp * (member->orig_read_codec->implementation->samples_per_second / 1000);
|
||||
} else {
|
||||
_dtmf.duration = tmp * (member->conference->rate / 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (member == NULL) {
|
||||
stream->write_function(stream, "Invalid member!\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
@@ -2664,7 +2676,8 @@ static switch_status_t conf_api_sub_dtmf(conference_member_t * member, switch_st
|
||||
switch_mutex_lock(member->flag_mutex);
|
||||
switch_core_session_kill_channel(member->session, SWITCH_SIG_BREAK);
|
||||
|
||||
while(p && *p) {
|
||||
p = dtmf;
|
||||
while(p && *p && is_dtmf(*p)) {
|
||||
_dtmf.digit = *p;
|
||||
switch_core_session_send_dtmf(member->session, &_dtmf);
|
||||
p++;
|
||||
|
||||
@@ -202,7 +202,7 @@ SWITCH_STANDARD_APP(bcast_function)
|
||||
continue;
|
||||
}
|
||||
if (ready == SEND_TYPE_RTP) {
|
||||
switch_rtp_write_frame(rtp_session, read_frame, 0);
|
||||
switch_rtp_write_frame(rtp_session, read_frame);
|
||||
} else {
|
||||
bytes = read_frame->packetlen;
|
||||
switch_socket_sendto(socket, audio_addr, 0, read_frame->packet, &bytes);
|
||||
|
||||
Reference in new issue
Block a user