定制 bandwidth/catapult-php-examples 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bandwidth/catapult-php-examples

最新稳定版本:v0.5.0

Composer 安装命令:

composer require bandwidth/catapult-php-examples

包简介

Catapult PHP Examples

README 文档

README

Example Applications For Bandwidth's App Platform

Built using the PHP SDK

Includes:

  • SMS Auto Replies

  • Call Transfers

  • Voice Reminders

  • Basic Voice Mail

  • Basic Conference

  • Advanced Conference

  • Keypad Simulator

  • BaML Call Transfers

  • SIP Domain & Endpoints *

          * coming soon
    

Setup

  1. Starters file credentials.json stores your Bandwidth Credentials, you should edit this first

  2. Each application has a application.json which includes information relative to the application. To run the app, please update this. You will also need to ensure numbers are in E.164 format and the Voices are valid for Catapult v1

  3. Under your Catapult Account we've used a seperate Application for each application listed. You can do so as well by logging into your Catapult Account and making the applications. You will need to ensure:

  4. Call URLs are setup properly this is the Callback URL please
    point this to the callback.php (each application has one)

  5. Make sure the numbers used in the application.json belong to the same application.

  6. To start testing please make sure you have ran an application once it will create all the table for these demos

Getting The Dependancies

to get the latest php-bandwidth SDK run the following:

composer update

Heroku

You'll need to create a Heroku application, then you can deploy :

heroku create "php-bandwidth-examples" git add * git commit -m 'updating php-bandwidth-examples!' git push heroku master

To run these examples on heroku you will need clearDB OR Postgres, which can be installed using:

heroku addons:add heroku-postgresql:dev

OR

heroku addons:add cleardb:ignite

currently Heroku is tested with Heroku Postgres

AWS

eb start git aws.push

for AWS you will need to set:

MYSQL_USER MYSQL_PASSWORD MYSQL_HOST MYSQL_DB

App 001 SMS Auto Replies

Requirements: A Number under your Catapult account

Setting up:

  1. use callback.php as the callback to your application under https://catapult.inetwork.com/pages/catapult.jsf
  2. Enter a valid number from your catapult account

Other: Make sure the number is also under this application

App 002 Call Transfers

Requirements: A listening and transfering number for your Catapult account

Setting up:

  1. use callback.php as the callback to your application under https://catapult.inetwork.com/pages/catapult.jsf
  2. Enter two valid numbers from your catapult account in application.json

App 003 Voice Reminders

Requirements: A number to use for voice reminders

Setting up:

  1. use callback.php as the callback to your application under https://catapult.inetwork.com/pages/catapult.jsf
  2. Enter a valid number for your voice reminders

App 004 Basic Voice Mail

Requirements: A number to use for voice reminders

Setting up:

  1. use callback.php as the callback to your application under https://catapult.inetwork.com/pages/catapult.jsf
  2. Enter a valid number for your voice mail

App 005 Basic Conference

Requirements: A number to use for the conference

Setting up:

  1. use callback.php as the callback to your application under https://catapult.inetwork.com/pages/catapult.jsf
  2. Enter valid attendees and initial from number in application.json

App 006 Advanced Conference

Requirements: A number to use for the conference

Setting up: Setup is similar to basic conference

App 007 Keypad Simulator

Keypad simulator is a quick way to simulate a fully capable keypad service it will provide an easy way to capture DTMF keys sequentially save them using SQLite and even perform transfers.

Setting up:

  1. Enter valid numerical sequences for your keypad
  2. Needs a valid incoming number
  3. Existing start and intermediatte speech texts

App 008 BaML Call Transfers

This will generate verbs in Bandwidth Markup Language the verbs will then be used to update your calls. In the log you will be able to see all the markup generated

Setting up: We have listed

  1. Enter a valid initial number and to number
  2. Initiate a call

App 009 SIP Domains

This application creates domains and endpoints using Catapult. It will provide an interface to do so. Through it you will be able to see step approach of creating these domains as well as integrating them with the endpoints.

As like the other interfaces you can also see the history of SIP calls made.

Setting Up:

  1. Specify valid names to the interface
  2. Use these domains in creating your endpoints

Docs

These applications are documented in the following way:

  • Steps (these are things that are absolutely needed for the application to run)
  • Important (things that we need)
  • Recommendation (these are branches that are optional however highly recommended)
  • Optional (implementors choice)

Other:

an Implementors Note will describe the segment and whether there are things they should be concerned with

a Tip is a hint on which objects to use

Validation will describe how to validate using the Catapult library

Even more

TO make sure these examples run on your RBDMS we have used a simple style guide:

  • underscores in all our table names
  • no infixes for the table names
  • reserved characters where applicable i.e "from" for postGresQL will be from for SQLite

Other Notes

  • Depending on how the callback is implemented some application records may take time to appear in the interface.

  • PHP's sleep/1 is added in multiple areas, this while commented for the examples use case, should be leveraged with how you build your applications. For more, you will find the sleep timeouts in application.json

These examples require:

Catapult PHP SDK >= 0.7.3 SQLite3 PHP 5.3.0 Apache HTTPd >= 2.2 OR nGinx

Deploying Anywhere: SQLite3

When using Heroku: PostGresQL ClearDB with MySQL

AWS: MySQL

Open external access via ngrock

As alternative to deployment to external hosting you can open external access to local web server via ngrock.

First instal ngrock on your computer. Run ngrock by

ngrok http 80 #you can use another free port if need 

You will see url like http://XXXXXXX.ngrok.io on console output. Use this link to access your app externally.

bandwidth/catapult-php-examples 适用场景与选型建议

bandwidth/catapult-php-examples 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25 次下载、GitHub Stars 达 7, 最近一次更新时间为 2015 年 03 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「sdk」 「bandwidth」 「catapult」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 bandwidth/catapult-php-examples 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 bandwidth/catapult-php-examples 我们能提供哪些服务?
定制开发 / 二次开发

基于 bandwidth/catapult-php-examples 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 17
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-21