Skip to content

Commit

Permalink
add timeout for ring
Browse files Browse the repository at this point in the history
  • Loading branch information
Bettman66 committed Nov 6, 2020
1 parent e41b587 commit 59f1ca3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ <h6 class="translate sub-title">state settings</h6>
<h6 class="translate sub-title">Ring settings</h6>
<div class="input-field col s1 m6 l2" id="_ringtimeout">
<input type="text" id="ringtimeout" class="value" />
<label class="translate" for="ringtimeout">RingTimeout:</label>
<label class="translate" for="ringtimeout">Ring timeout:</label>
</div>
<div class="row"></div>
<div class="row">
Expand Down
14 changes: 14 additions & 0 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,20 @@
},
"native": {}
},
{
"_id": "CALL_PROGRESS",
"type": "state",
"common": {
"name": "CALL_PROGRESS",
"desc": "Call is active",
"type": "boolean",
"role": "indicator",
"read": true,
"write": false,
"def": false
},
"native": {}
},
{
"_id": "CALL_1",
"type": "state",
Expand Down
3 changes: 3 additions & 0 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ function BaresipClient(adapter) {
case ('CALL_ESTABLISHED'):
clearTimeout(tout_timeout);
tout_timeout = null;
adapter.setState('CALL_PROGRESS', false, true);
adapter.setForeignState(adapter.config.call_active, true, true);
adapter.setState('CALL_ACTIVE', true, true);
adapter.setForeignState(adapter.config.call_established, true, true);
Expand All @@ -183,6 +184,7 @@ function BaresipClient(adapter) {
}, 1000);
break;
case ('CALL_PROGRESS'):
adapter.setState('CALL_PROGRESS', true, true);
clearTimeout(tout_timeout);
tout_timeout = setTimeout(() => {
tout_timeout = null;
Expand All @@ -191,6 +193,7 @@ function BaresipClient(adapter) {
break;
case ('CALL_CLOSED'):
dtmf = '';
adapter.setState('CALL_PROGRESS', false, true);
adapter.setState('CALL_1', false, true);
adapter.setState('CALL_2', false, true);
adapter.setState('CALL_3', false, true);
Expand Down

0 comments on commit 59f1ca3

Please sign in to comment.