Skip to content

Commit bcaa78d

Browse files
committed
[latest] fix: notify IVR app on caller hangup + fix recording events for local type
- sip_session.rs: stop_app() on caller BYE to trigger IVR on_session_end - cleanup(): defensive stop_app() for RTP-timeout etc. - event_loop.rs: fix double on_exit (cancel_token + AppAction::Exit) - executor.rs: map ExitReason::Cancelled to EndReason::Hangup - config.rs: remove recording_type gate so local recordings fire events - sipflow_upload.rs: emit RecordingMetadataAvailable after sipflow upload - cc submodule: fix dev-console init script for configurable apiPrefix
1 parent 9c001e3 commit bcaa78d

4 files changed

Lines changed: 17 additions & 4 deletions

File tree

src/addons/cc

Submodule cc updated from eb41cb5 to bc0bf29

src/call/app/event_loop.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ impl AppEventLoop {
5454
action = self.handle_next_event().await?;
5555
}
5656
AppAction::Exit => {
57-
self.app.on_exit(ExitReason::Normal).await?;
5857
break;
5958
}
6059
AppAction::Hangup { reason, code } => {
@@ -120,14 +119,16 @@ impl AppEventLoop {
120119
&self.context
121120
).await
122121
}
123-
None => Ok(AppAction::Exit),
122+
None => {
123+
self.app.on_exit(ExitReason::Normal).await?;
124+
Ok(AppAction::Exit)
125+
}
124126
}
125127
}
126128
Some(timer_id) = self.fired_timer_rx.recv() => {
127129
self.app.on_timeout(timer_id, &mut self.controller, &self.context).await
128130
}
129131
_ = self.cancel_token.cancelled() => {
130-
self.app.on_exit(ExitReason::Cancelled).await?;
131132
Ok(AppAction::Exit)
132133
}
133134
}

src/call/app/ivr/executor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,7 @@ impl CallApp for StepIvrApp {
995995
}
996996
}
997997
crate::call::app::ExitReason::Error(e) => EndReason::Error(e),
998+
crate::call::app::ExitReason::Cancelled => EndReason::Hangup,
998999
_ => EndReason::Normal,
9991000
};
10001001
let session_id = self

src/proxy/proxy_call/sip_session.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,6 +2586,12 @@ impl SipSession {
25862586
.collect();
25872587
self.pending_hangup.extend(callee_ids);
25882588
self.cancel_token.cancel();
2589+
if self.app_runtime.is_running() {
2590+
let _ = self
2591+
.app_runtime
2592+
.stop_app(Some("caller_hangup".to_string()))
2593+
.await;
2594+
}
25892595
}
25902596
_ => {}
25912597
}
@@ -7133,6 +7139,11 @@ impl SipSession {
71337139

71347140
self.stop_caller_ingress_monitor().await;
71357141

7142+
// Ensure the running app (IVR/voicemail/queue) is notified of session end.
7143+
if self.app_runtime.is_running() {
7144+
let _ = self.app_runtime.stop_app(None).await;
7145+
}
7146+
71367147
if self.media.recording_state.is_active() {
71377148
let _ = self.stop_recording().await;
71387149
}

0 commit comments

Comments
 (0)