mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
rtp timeout
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6093 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -259,6 +259,7 @@ struct sofia_profile {
|
||||
time_t started;
|
||||
uint32_t session_timeout;
|
||||
uint32_t max_proceeding;
|
||||
uint32_t rtp_timeout_sec;
|
||||
#ifdef SWITCH_HAVE_ODBC
|
||||
char *odbc_dsn;
|
||||
char *odbc_user;
|
||||
|
||||
@@ -893,6 +893,11 @@ switch_status_t config_sofia(int reload, char *profile_name)
|
||||
if (v_max_proceeding >= 0) {
|
||||
profile->max_proceeding = v_max_proceeding;
|
||||
}
|
||||
} else if (!strcasecmp(var, "rtp-timeout-sec")) {
|
||||
int v = atoi(val);
|
||||
if (v >= 0) {
|
||||
profile->rtp_timeout_sec = v;
|
||||
}
|
||||
} else if (!strcasecmp(var, "manage-presence")) {
|
||||
if (switch_true(val)) {
|
||||
profile->pflags |= PFLAG_PRESENCE;
|
||||
|
||||
@@ -937,6 +937,8 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
||||
switch_rtp_flag_t flags;
|
||||
switch_status_t status;
|
||||
char tmp[50];
|
||||
uint32_t rtp_timeout_sec = tech_pvt->profile->rtp_timeout_sec;
|
||||
|
||||
assert(tech_pvt != NULL);
|
||||
|
||||
|
||||
@@ -1061,6 +1063,20 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
||||
}
|
||||
|
||||
|
||||
if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_timeout_sec"))) {
|
||||
int v = atoi(val);
|
||||
if (v >= 0) {
|
||||
rtp_timeout_sec = v;
|
||||
}
|
||||
}
|
||||
|
||||
if (rtp_timeout_sec) {
|
||||
uint32_t packets;
|
||||
packets = (tech_pvt->read_codec.implementation->samples_per_second * rtp_timeout_sec) /
|
||||
tech_pvt->read_codec.implementation->samples_per_frame;
|
||||
|
||||
switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, packets);
|
||||
}
|
||||
|
||||
if (tech_pvt->te) {
|
||||
switch_rtp_set_telephony_event(tech_pvt->rtp_session, tech_pvt->te);
|
||||
|
||||
Reference in New Issue
Block a user