diff --git a/constants.h b/constants.h index fa9e5b36..3209b2e6 100644 --- a/constants.h +++ b/constants.h @@ -347,7 +347,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define VOMP_CODEC_CHANGEYOURCODECTO 0xff /* in milliseconds of inactivity */ -#define VOMP_CALL_TIMEOUT 120000 +// 20 seconds to start ringing +#define VOMP_CALL_DIAL_TIMEOUT 5000 +// 60 seconds to answer +#define VOMP_CALL_RING_TIMEOUT 60000 +// 2 minutes of zero network traffic +#define VOMP_CALL_NETWORK_TIMEOUT 120000 +// force state packet interval #define VOMP_CALL_STATUS_INTERVAL 1000 #define DEFAULT_MONITOR_SOCKET_NAME "org.servalproject.servald.monitor.socket" diff --git a/vomp.c b/vomp.c index 5672ed28..fb6f5f2c 100644 --- a/vomp.c +++ b/vomp.c @@ -1567,18 +1567,15 @@ static void vomp_process_tick(struct sched_ent *alarm) struct vomp_call_state *call = (struct vomp_call_state *)alarm; - /* See if any calls need to begin expiring - (current timeout is set at 2 minutes) */ - if (call->local.statecreate_time+VOMP_CALL_TIMEOUT)last_activity+VOMP_CALL_TIMEOUTremote.state < VOMP_STATE_RINGINGOUT && call->create_time + VOMP_CALL_DIAL_TIMEOUT < now) || + (call->local.state < VOMP_STATE_INCALL && call->create_time + VOMP_CALL_RING_TIMEOUT < now) || + (call->last_activity+VOMP_CALL_NETWORK_TIMEOUT