From f8720bab9f1208c310447855e38a141c07750a41 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 20 Sep 2023 20:56:18 -0400 Subject: [PATCH] update to jambonz.cloud for saas --- db/seed-production-database-open-source.sql | 1 - lib/routes/api/register.js | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/db/seed-production-database-open-source.sql b/db/seed-production-database-open-source.sql index 49ceb8c..f050e25 100644 --- a/db/seed-production-database-open-source.sql +++ b/db/seed-production-database-open-source.sql @@ -27,7 +27,6 @@ values ('84e3db00-b172-4e46-b54b-a503fdb19e4a', 'https://public-apps.jambonz.cloud/call-status', 'POST'), ('d31568d0-b193-4a05-8ff6-778369bc6efe', 'https://public-apps.jambonz.cloud/hello-world', 'POST'), ('81844b05-714d-4295-8bf3-3b0640a4bf02', 'https://public-apps.jambonz.cloud/dial-time', 'POST'); - insert into applications (application_sid, account_sid, name, call_hook_sid, call_status_hook_sid, speech_synthesis_vendor, speech_synthesis_language, speech_synthesis_voice, speech_recognizer_vendor, speech_recognizer_language) VALUES ('7087fe50-8acb-4f3b-b820-97b573723aab', '9351f46a-678c-43f5-b8a6-d4eb58d131af', 'hello world', 'd31568d0-b193-4a05-8ff6-778369bc6efe', '84e3db00-b172-4e46-b54b-a503fdb19e4a', 'google', 'en-US', 'en-US-Wavenet-C', 'google', 'en-US'), diff --git a/lib/routes/api/register.js b/lib/routes/api/register.js index 8ab002e..96b38f9 100644 --- a/lib/routes/api/register.js +++ b/lib/routes/api/register.js @@ -296,20 +296,25 @@ router.post('/', async(req, res) => { const callStatusSid = uuid(); const helloWordSid = uuid(); const dialTimeSid = uuid(); + const echoSid = uuid(); - /* 3 webhooks */ - await promisePool.execute(insertWebookSql, [callStatusSid, - 'https://public-apps.jambonz.cloud/call-status', 'POST']); - await promisePool.execute(insertWebookSql, [helloWordSid, - 'https://public-apps.jambonz.cloud/hello-world', 'POST']); - await promisePool.execute(insertWebookSql, [dialTimeSid, - 'https://public-apps.jambonz.cloud/dial-time', 'POST']); + /* 4 webhooks */ + await promisePool.execute(insertWebookSql, + [callStatusSid, 'https://public-apps.jambonz.cloud/call-status', 'POST']); + await promisePool.execute(insertWebookSql, + [helloWordSid, 'https://public-apps.jambonz.cloud/hello-world', 'POST']); + await promisePool.execute(insertWebookSql, + [dialTimeSid, 'https://public-apps.jambonz.cloud/dial-time', 'POST']); + await promisePool.execute(insertWebookSql, + [echoSid, 'https://public-apps.jambonz.cloud/echo', 'POST']); /* 2 applications */ await promisePool.execute(insertApplicationSql, [uuid(), userProfile.account_sid, 'hello world', helloWordSid, callStatusSid, 'google', 'en-US', 'en-US-Wavenet-C', 'google', 'en-US']); await promisePool.execute(insertApplicationSql, [uuid(), userProfile.account_sid, 'dial time clock', dialTimeSid, callStatusSid, 'google', 'en-US', 'en-US-Wavenet-C', 'google', 'en-US']); + await promisePool.execute(insertApplicationSql, [uuid(), userProfile.account_sid, 'simple echo test', + echoSid, callStatusSid, 'google', 'en-US', 'en-US-Wavenet-C', 'google', 'en-US']); Object.assign(userProfile, { pristine: true,