twilio 打电话_使用Twilio,Okta和JavaScript为您的公司构建电话系统

twilio 打电话

If you've ever worked for a company with more than a few employees, you've probably seen some interesting phone systems.

如果您曾经在一家拥有多名员工的公司工作过,那么您可能已经看过一些有趣的电话系统。

When I used to work at Cisco, everyone was given a dedicated Cisco desk phone that hooked up to a server somewhere in the company and each employee was assigned a unique phone number and extension.

当我以前在思科工作时,每个人都获得了专用的Cisco台式电话,该电话连接到公司某处的服务器,并且为每个员工分配了唯一的电话号码和分机号。

I never really liked that setup. It annoyed me that I had this big, clunky desk phone taking up space, collecting dust, and generally not being useful.

我从未真正喜欢过这种设置。 令我烦恼的是,我的这款笨重笨拙的台式电话占用了空间,积满了灰尘并且通常没有用。

The one time I did actually want to use my desk phone I couldn't figure out how to dial a number to the outside world and spent a frustrating half-hour accidentally calling other departments before I gave up and used my cell.

有一次我确实确实想使用台式电话,但我不知道如何拨打电话到外面的世界,花了一个令人沮丧的半小时不小心打电话给其他部门,然后才放弃使用我的手机。

Not too long after my Cisco experience I joined a smaller company. They didn't have desk phones -- they paid for a fancy Software-as-a-Service solution that gave each employee a dedicated company phone number when they joined and would just forward all of the calls you got to your cell phone.

在思科工作了不久之后,我加入了一家较小的公司。 他们没有台式电话-他们花钱购买了一套精美的软件即服务解决方案,该解决方案为每位员工加入时提供了专用的公司电话号码,并将您接到的所有电话转接到手机上。

I liked this a lot -- I used my cell phone for everything but could still share my company number in my email signature, give it to clients, put it on a business card, etc. The learning curve was low and it was simple.

我非常喜欢-我用手机来做所有事情,但仍然可以在电子邮件签名中共享公司号码,提供给客户,将其放在名片上等。学习曲线很简单。

The only problem with that system is that it cost a ton of money. I asked one of the IT guys how much they paid for the service and it was $50/mo/employee -- yikes.

该系统的唯一问题是,它花费了一大笔钱。 我问一个IT人士,他们为这项服务支付了多少钱,月薪是50美元/月/员工。

If you're at all interested in learning how to build your own simple phone system for employees, read on! Today I'm going to show you step-by-step how I built mine using two simple (and cheap!) API services and a little bit of JavaScript.

如果您有兴趣学习如何为员工构建自己的简单电话系统,请继续阅读! 今天,我将逐步向您展示如何使用两个简单( 且便宜 !)的API服务和一些JavaScript来构建我的我的。

我们正在建设什么 ( What We're Building )

The phone system we're going to design today will be simple. The requirements are basic:

我们今天要设计的电话系统将非常简单。 要求是基本的:

  • Each employee who joins the company should get a dedicated company phone number

    每位加入公司的员工都应获得专用的公司电话号码

  • That company phone number should forward all calls and text messages it receives to the employee's cell phone. This way, an employee gets a company number for business use but won't need any special hardware or software to use it.

    该公司电话号码应将收到的所有电话和短信转发给员工的手机。 这样,员工可以获得公司编号供商业使用,而无需任何特殊的硬件或软件即可使用它。

  • The system should also be dirt cheap. We should pay for phone numbers but not much else.

    该系统也应该便宜。 我们应该为电话号码付费,但别无其他。

Make sense? Great!

合理? 大!

开始使用 ( Get Started )

The first thing you'll need to do is sign up for both Twilio and Okta.

您需要做的第一件事就是同时注册TwilioOkta

Twilio is an API service that allows you to do everything communications related:

Twilio是一项API服务,可让您进行与通信相关的所有操作:

  • Send and receive text messages

    发送和接收短信
  • Send and receive phone calls

    发送和接听电话
  • Send and receive faxes

    发送和接收传真
  • Purchase phone numbers

    购买电话号码
  • Etc.

    等等。

Okta is an API service that allows you to store user accounts for the applications you build. Okta allows you to do anything authentication related:

Okta是一项API服务,可让您存储所构建应用程序的用户帐户。 Okta允许您执行与身份验证相关的任何操作:

  • Store user accounts (for both internal employees and external users)

    商店用户帐户(适用于内部员工和外部用户)
  • Log users into web apps, mobile apps, and API services

    将用户登录到Web应用程序,移动应用程序和API服务
  • Handle things like password reset, multi-factor authentication, social login, etc.

    处理诸如密码重置,多因素身份验证,社交登录等操作。
  • Synchronize with Active Directory, HR systems, and other "corporate" tools to handle single sign-on and centralize your users in one secure location

    与Active Directory,HR系统和其他“公司”工具同步,以处理单点登录并将用户集中在一个安全的位置

创建一个Twilio帐户 (Create a Twilio Account)

To get started with Twilio, go create an account now.

要开始使用Twilio,请立即创建一个帐户

Once you've created an account, log into the Twilio Dashboard and you'll see your API keys listed there. Your Twilio keys are called an Account SID and an Auth Token. Take note of these two values and store them someplace, you will need them later when we work with the Twilio APIs.

创建帐户后,登录到Twilio仪表板 ,您将在此处看到API密钥。 您的Twilio密钥称为Account SIDAuth Token 。 请注意这两个值并将它们存储在某个位置,稍后在使用Twilio API时将需要它们。

We'll be using Twilio to handle all of the telephony related functionality for our phone system. I'm not affiliated with them at all, but love their service. It's incredibly cheap, easy to use, and fun.

我们将使用Twilio来处理电话系统中与电话相关的所有功能。 我完全不隶属于他们,但是热爱他们的服务。 它非常便宜,易于使用且有趣。

Twilio typically charges $1/mo for most phone numbers, < 1 cent per minute for most phone calls, and < 1 cent per SMS message sent. It's a very cheap service, and seeing that most employees won't be using their dedicated company number to make calls (just to receive them), the cost to run our phone system will be very low.

Twilio通常会对大多数电话号码收取$ 1 / mo的费用,对于大多数电话来说,每分钟收取的费用<1美分,对于所发送的SMS消息,收取的费用<1美分。 这是一项非常便宜的服务,并且看到大多数员工不会使用他们专用的公司电话来拨打电话(只是接听电话),因此运行电话系统的成本将非常低。

For more info about Twilio's pricing, visit their website.

有关Twilio定价的更多信息,请访问其网站

创建一个Okta帐户 (Create an Okta Account)

Okta is what we'll be using to store all of our employee data for this example application.

Okta将用于存储此示例应用程序的所有员工数据。

  1. The reason I'm showcasing Okta here is because Okta is probably the largest and most well-known identity company. They've been around for a long time, many companies use Okta to store employee (and user) accounts, and their APIs are simple to use.

    我在这里展示Okta的原因是因为Okta可能是最大和最知名的身份识别公司。 它们已经存在了很长时间,许多公司使用Okta来存储员工(和用户)帐户,并且它们的API易于使用。

Okta is also very cheap. The Okta free tier allows you to have up to 1,000 active monthly users for no cost, which makes the service 100% free for most smaller businesses. If you want to learn more about Okta's pricing you can visit their pricing page.

Okta也很便宜。 Okta免费套餐可让您免费拥有多达1,000名每月活跃用户 ,这使得该服务对于大多数小型企业都是100%免费的。 如果您想进一步了解Okta的定价,请访问其定价页面

To get started with Okta, go create an account now and log into your dashboard. Once you're logged into the Okta dashboard, copy down the Org URL from the top-right corner of the page (as pictured below).

要开始使用Okta,请立即创建一个帐户并登录到仪表板。 登录Okta仪表板后,从页面右上角复制组织URL(如下图所示)。

You'll need this value later.

您稍后将需要此值。

You'll also want to hover over the API dropdown menu and select the Tokens option from the dropdown -- this will take you to the token management page (pictured below).

您还需要将鼠标悬停在API下拉菜单上,然后从下拉菜单中选择Tokens选项-这将带您进入令牌管理页面(如下图所示)。

Click the Create Token button to create a new token and name it whatever you want. Tokens allow you to access Okta and keep track of which application is making what types of requests. I typically like to name my tokens the same name as my project.

单击“ 创建令牌”按钮以创建新令牌,并根据需要命名。 令牌使您可以访问Okta并跟踪哪个应用程序正在发出什么类型的请求。 我通常喜欢将令牌命名为与项目相同的名称。

In this case, I've named my token "simple-phone-system" (pictured below).

在这种情况下,我将令牌命名为“简单电话系统”(如下图所示)。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值