new(security.gblib): SMS Auth.
This commit is contained in:
parent
1a5f76f2ac
commit
36a9a8eb1d
1 changed files with 18 additions and 15 deletions
|
@ -354,7 +354,10 @@ export class GBConversationalService {
|
||||||
|
|
||||||
// tslint:disable:no-unsafe-any due to Nexmo.
|
// tslint:disable:no-unsafe-any due to Nexmo.
|
||||||
public async sendSms(min: GBMinInstance, mobile: string, text: string): Promise<any> {
|
public async sendSms(min: GBMinInstance, mobile: string, text: string): Promise<any> {
|
||||||
let botNumber = process.env.BOT_NUMBER;
|
|
||||||
|
let botNumber = min.core.getParam<string>(min.instance, 'Bot Number', null);
|
||||||
|
if (botNumber) {
|
||||||
|
|
||||||
|
|
||||||
GBLog.info(`Sending SMS from ${botNumber} to ${mobile} with text: '${text}'.`);
|
GBLog.info(`Sending SMS from ${botNumber} to ${mobile} with text: '${text}'.`);
|
||||||
const accountSid = process.env.TWILIO_ACCOUNT_SID;
|
const accountSid = process.env.TWILIO_ACCOUNT_SID;
|
||||||
|
@ -370,7 +373,7 @@ export class GBConversationalService {
|
||||||
})
|
})
|
||||||
|
|
||||||
GBLogEx.info(min, `SMS sent, return: ${msg.sid}.`);
|
GBLogEx.info(min, `SMS sent, return: ${msg.sid}.`);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!min.instance.smsKey && min.instance.smsSecret) {
|
if (!min.instance.smsKey && min.instance.smsSecret) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue