Skip to content

Commit

Permalink
add hangup object
Browse files Browse the repository at this point in the history
  • Loading branch information
Bettman66 committed Mar 1, 2021
1 parent bbcfa83 commit 8c7bc95
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
14 changes: 14 additions & 0 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,20 @@
},
"native": {}
},
{
"_id": "hangup",
"type": "state",
"common": {
"name": "hangup",
"desc": "",
"type": "boolean",
"role": "button.hangup",
"read": true,
"write": true,
"def": false
},
"native": {}
},
{
"_id": "CALLING_NUMBER",
"type": "state",
Expand Down
9 changes: 5 additions & 4 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ function BaresipClient(adapter) {
adapter.log.debug('stateChange ' + id + ': ' + JSON.stringify(state));

var dp = (id.split('.'));
if (dp[2] == 'ring1button') {id = adapter.config.ring1} else
if (dp[2] == 'ring2button') {id = adapter.config.ring2} else
if (dp[2] == 'ring3button') {id = adapter.config.ring3} else
if (dp[2] == 'ring4button') {id = adapter.config.ring4};
if (dp[2] == 'ring1button') { id = adapter.config.ring1 } else
if (dp[2] == 'ring2button') { id = adapter.config.ring2 } else
if (dp[2] == 'ring3button') { id = adapter.config.ring3 } else
if (dp[2] == 'ring4button') { id = adapter.config.ring4 } else
if (dp[2] == 'hangup') { send2baresip('hangup', '') };

switch (id) {
case (adapter.config.ring1):
Expand Down

0 comments on commit 8c7bc95

Please sign in to comment.