add generic keepalive system and implement it in sofia to send MESSAGE or INFO packets in-dialog at specified interval.

Adds app: enable_keepalive 0|<seconds>
This app can be run in the dialplan or with execute_on_* type variables for B-legs.

Adds sofia param: keepalive-method  : defaults to MESSAGE can also be "INFO"
This param sets which SIP method to use.
This commit is contained in:
Anthony Minessale
2014-04-16 06:02:44 +05:00
parent ae69c5a7b0
commit a4a792488b
7 changed files with 82 additions and 1 deletions

View File

@@ -231,8 +231,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
session->read_frame_count = (session->read_impl.actual_samples_per_second / session->read_impl.samples_per_packet) * session->track_duration;
msg.message_id = SWITCH_MESSAGE_HEARTBEAT_EVENT;
msg.numeric_arg = session->track_duration;
switch_core_session_receive_message(session, &msg);
switch_event_create(&event, SWITCH_EVENT_SESSION_HEARTBEAT);
switch_channel_event_set_data(session->channel, event);
switch_event_fire(&event);