Skip to content

Commit

Permalink
fix: hangup handling outside the function
Browse files Browse the repository at this point in the history
  • Loading branch information
ShlomoCode committed Feb 24, 2023
1 parent 45eeb20 commit 64043fa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ npm i yemot-router2

**5.1.0**
כל הפרמטרים שמתחילים במילה Api (פרמטרים אוטומטיים של ימות), לדוגמה `ApiExtension`, `ApiPhone`, כן מוזרקים אוטומטית לאובייקט הCall.

**5.1.1**
תוקן באג שבו ניתוק מחוץ לפונקציה (לדוגמה השמעת id_list_message, יציאה מהשלוחה ואז ניתוק) היה מפעיל את הפונקציה.
</details>

<details>
Expand Down
4 changes: 4 additions & 0 deletions lib/yemot_router.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ function YemotRouter (options = {}) {
let currentCall = activeCalls[callId];
if (!currentCall) {
isNewCall = true;
if (req.query.hangup === 'yes') {
logger(callId, '👋 call is hangup (outside the function)');
return res.json({ message: 'hangup' });
}
currentCall = new Call(callId, eventsEmitter, ops);
activeCalls[callId] = currentCall;
logger(callId, `📞 new call from ${req.query.ApiPhone}`);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yemot-router2",
"version": "5.1.0",
"version": "5.1.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 64043fa

Please sign in to comment.