Skip to content

Commit

Permalink
Merge pull request #2 from ExoAbhishek/CCM-2956/dtmf-impl
Browse files Browse the repository at this point in the history
impl dtmf method in crmwebphone
  • Loading branch information
ExoAbhishek authored Jun 27, 2024
2 parents 2c72cad + 978d48b commit c421948
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
12 changes: 11 additions & 1 deletion output/ExotelWebPhoneSDK.js

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": "exotel-ip-calling-crm-websdk",
"version": "1.0.0",
"version": "1.1.0",
"description": "Exotel's crm websdk for IP calling integration",
"main": "output/ExotelCRMWebSDK.js",
"scripts": {
Expand Down
11 changes: 11 additions & 0 deletions src/ExotelWebPhoneSDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,15 @@ export default class ExotelWebPhoneSDK {
this.#call?.callDetails()
);
}

SendDTMF = (digit: string) => {
const regex = /^[0-9]$/g;
if (!digit.match(regex)) {
return console.error(`Invalid dtmf input: ${digit}`);
}
if(!this.#call) {
return console.error(`Cannot send dtmf input when there is no call in-progress`);
}
this.#call.sendDTMF(digit);
}
}

0 comments on commit c421948

Please sign in to comment.