File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class BotManager {
3131 async stopBot ( botId ) {
3232 try {
3333 logger . logInfo ( 'Stopping bot:' , botId ) ;
34- await recallService . deleteBot ( botId ) ;
34+ await recallService . leaveCall ( botId ) ;
3535 this . activeBots . delete ( botId ) ;
3636 } catch ( error ) {
3737 logger . logError ( 'Error stopping bot:' , error ) ;
Original file line number Diff line number Diff line change @@ -145,6 +145,18 @@ class RecallService {
145145 }
146146 }
147147
148+ async leaveCall ( botId ) {
149+ try {
150+ await axios . post ( `${ this . baseUrl } /api/v1/bot/${ botId } /leave_call/` , { } , {
151+ headers : this . headers
152+ } ) ;
153+ logger . logInfo ( 'Bot left call successfully' ) ;
154+ } catch ( error ) {
155+ logger . logError ( 'Error making bot leave call:' , error . response ?. data || error . message ) ;
156+ throw new Error ( 'Failed to make bot leave call. Please try again.' ) ;
157+ }
158+ }
159+
148160 async deleteBot ( botId ) {
149161 try {
150162 await axios . delete ( `${ this . baseUrl } /api/v1/bot/${ botId } /` , {
You can’t perform that action at this time.
0 commit comments