Search the Community
Showing results for tags 'pivot'.
-
What is Pivot? Pivot enables you to generate real-time KAZOO callflows via a REST API. This means your web application can tell phone calls what to do, during the call! Some examples use cases: Checking an external account balance before allowing a call Routing an incoming call based on custom logic Present menu items and respond to selections based on information in your database How does it work? When you add the Pivot module to your call flow, you provide Pivot with a callback URL to your webserver. From then on, when KAZOO receives a phone call for a Pivot-enabled phone number, KAZOO sends an HTTP request to your webserver asking it for a new callflow. Along with the request, KAZOO passes information about the call, such as the originating number. Your web application will then generate a new callflow, which KAZOO will run. Since your new callflow can itself contain another Pivot, you have the ability to make completely dynamic callflows. What does a request look like? When a call comes in to a configured Pivot number, we'll make a request to your web script with the following information: What does a response look like? When responding to the above request, your script might analyze the Caller ID of the caller and decide to identify the caller automatically and play their account balance, then connect them to customer support. Returned body: What are the variables for setting a Pivot Callflow? The dialog box for editing a callflow in Pivot is shown below: Is there a way to debug my Pivot routine? Yes. in the application there is a tab called Live Debug. It will list all recent calls that trigger a request to your http servier. If you click on "View Details" you can see the code that was both sent and returned. Is there a way to chain multiple Pivot requests together? Yes, it is possible to pass variables to multiple Pivot transactions. To do this you will want to use the set CAV (Custom Application Vars) option, and sent the results to a second Pivot. In the second Pivot add a query to see if a variable is set and access it that way.
-
- pivot
- realtime call control
-
(and 1 more)
Tagged with:
-
I have recently started to explore Kazoo for one of our official projects. Our goal is below To make an Outbound call to the PSTN number using Flowroute as Carrier at Kazoo from a web app After answering the call, run an IVR which instructions need to fetch from a web server using Pivot While trying to do a POC for this, first I was facing some difficulties due to the lack of specific documentation. Then I have started to communicate with the 2600hz developer forum and finally, I am able to meet my goal after applying suggestions from the forum. Now I am decided to document every step that I follow which may be helpful for others to implement the same flow. The following tasks need to be done which I will describe in detail later Setup Flowroute as a resource in Kazoo Setup an extension in callflows that has a Pivot as the action Create a clicktocall endpoint that connects to the created extension in step 2 Use created clicktocall endpoint in step 3 for making the PSTN call Prerequisite I have used kazoo crossbar API to accomplish my task. Almost for every request to Crossbar API, an authentication credential is required. Crossbar provides a number of ways of authenticating a request. The most common way is to authenticate as a user and receive a token usable on subsequent requests. In this method, you provide the credentials of your user just for login and crossbar will generate an authentication token in response. User credential is the MD5 hash of USERNAME:PASSWORD. For generating MD5 of a text in terminal I have used md5sum (in Linux) or md5 (in macOS) as following where I assume john as USERNAME and 12345 is PASSWORD. echo-n 'john:12345 | md5sum Output : 82a2dc91686ec828a67152d45a5c5ef7 Then I have called user_auth API to get an authentication token. Details of user_auth API request is as below URL : https://{SERVER}:8000/v2/user_auth Method : PUT Header : "Content-Type: application/json" Request Body : { "data": { "credentials": "82a2dc91686ec828a67152d45a5c5ef7", "account_name": "YOUR_ACCOUNT_NAME" }, "method": "[md5 | sha1]" } Use your generated MD5 output for the value of the credential and replace "YOUR_ACCOUNT_NAME" with your actual Kazoo Account Name. If the request body is correct, then it will give below success response { "auth_token": "{AUTH_TOKEN}", "data": { "account_id": "{ACCOUNT_ID}", "apps": [], "is_reseller": true, "language": "en-US", "owner_id": "{OWNER_ID}", "reseller_id": "{RESELLER_ID}" }, "node": "{API_NODE}", "request_id": "{REQUEST_ID}", "revision": "{REVISION}", "status": "success", "timestamp": "{TIMESTAMP}", "version": "{VERSION}", } Here{AUTH_TOKEN}, the authentication token, is a long list of characters that you need to use in future requests. Step 1: Setup Flowroute as a resource in Kazoo First, we need to add flowroute as a resource in the kazoo. There are two levels of resources, global (or system-wide), and per-account (or local). I have used local resources. URL : http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/resources *** Please replace {ACCOUNT_ID} with your actual ACCOUNT_ID Method: PUT Header : 1 . "Content-Type: application/json" 2 . “X-Auth-Token: {AUTH_TOKEN}" *** Replace {AUTH_TOKEN} with the actual AUTH_TOKEN that you retrieved from user_auth API described in the above prerequisite section. Request Body { "data": { "name": "flowroute", "format_from_uri": true, "rules": [ ".{7,}" ], "flags": [ "Use_Flowroute" ], "formatters": { "from": [{ "regex": "\\+?1?(\\d{10})$", "direction": "outbound" }], "diversion":[{ "match_invite_format":true, "direction":"outbound" }], "outbound_caller_id_number": [{ "value": "YOUR_CALLER_ID_NUMBER" }], "outbound_caller_id_name": [{ "value": "YOUR_CALLER_ID_NAME" }] }, "gateways": [{ "caller_id_type": "external", "channel_selection": "ascending", "codecs": ["PCMU", "PCMA","OPUS"], "custom_sip_headers": {}, "emergency": false, "enabled": true, "endpoint_type": "sip", "format_from_uri": true, "invite_format": "route", "password": "YOUR_FLOWROUTE_PASSWORD", "prefix": "YOUR_FLOWROUTE_TECH_PREFIX*", "progress_timeout": "30", "realm": "us-east-nj.sip.flowroute.com", "server": "us-east-nj.sip.flowroute.com", "skype_rr": false, "suffix": "", "username": "YOUR_FLOWROUTE_USER_NAME" }] } } *** Replace YOUR_FLOWROUTE_USER_NAME with your actual Flowroute user name *** Replace YOUR_FLOWROUTE_PASSWORD with your actual Flowroute password *** Replace YOUR_FLOWROUTE_TECH_PREFIX with your actual Flowroute Tech Prefix followed by * *** Replace YOUR_CALLER_ID_NUMBER with your desired caller_id_number *** Replace YOUR_CALLER_ID_NAME with your desired caller_id_name *** If you use different Flowroute PoP other than “us-east-nj.sip.flowroute.com” then use your preferred PoP in “realm” and “server” fields. Step 2: Setup an extension in callflows that has a Pivot as the action URL : http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/callflows *** Please replace {ACCOUNT_ID} with your actual ACCOUNT_ID Method: PUT Header : 1 . "Content-Type: application/json" 2 . “X-Auth-Token: {AUTH_TOKEN}" *** Replace {AUTH_TOKEN} with the actual AUTH_TOKEN that you retrieved from user_auth API described in above prerequisite section. Request Body { "data": { "numbers": ["1"], "flow": { "data": { "method": "GET", "req_timeout": "60", "req_format": "kazoo", "voice_url": "YOUR_PIVOT_API_URL", "debug": false }, "module": "pivot" } } } *** Replace "YOUR_PIVOT_API_URL" with your actual pivot API URL. Step 3: Create a clicktocall endpoint that connects to the created callflow of mentioned extension (value of numbers key in the request body) in step 2 Click-to-call allows you to create URLs that can be POSTed to with a phone number or SIP URI and create a phone call from the provided contact information to a destination you have pre-determined. I have created an clicktocall endpoint and connected it to the created extension in step 2 URL : http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/clicktocall *** Please replace {ACCOUNT_ID} with your actual ACCOUNT_ID Method: PUT Header : 1 . "Content-Type: application/json" 2 . “X-Auth-Token: {AUTH_TOKEN}" *** Replace {AUTH_TOKEN} with the actual AUTH_TOKEN that you retrieved from user_auth API described in above prerequisite section. Request Body { "data": { "name": "call_1", "auth_required": false, "extension":"1", "caller_id_number":"YOUR_CALLER_ID_NUMBER" } } *** Replace YOUR_CALLER_ID_NUMBER with your desired caller_id_number Response { "auth_token":"{AUTH_TOKEN}", "data": { "auth_required": false, "custom_application_vars": {}, "extension": "{EXTENSION}", "id": "{C2C_ID}", "name": "{NAME}" }, "node": "{NODE_HASH}", "request_id": "{REQUEST_ID}", "revision": "{REVISION}", "status": "success", "timestamp": "{TIMESTAMP}", "version": "4.3.1" } We will use this "{C2C_ID}" in step 4 to make the actual outbound call Step 4: Use created clicktocall endpoint in step 3 for making the PSTN call URL : http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}/connect?contact={CONTACT} *** Please replace {ACCOUNT_ID} with your actual ACCOUNT_ID , {C2C_ID} with the ID you got at step 3 and {CONTACT} with the PSTN number you want to call For example, if you want to make a call at the number 12223334444 then your URL should be as below http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}/connect?contact=12223334444 Method: GET Header : 1 . "Content-Type: application/json" 2 . “X-Auth-Token: {AUTH_TOKEN}" *** Replace {AUTH_TOKEN} with the actual AUTH_TOKEN that you retrieved from user_auth API described in the above prerequisite section. You should receive a phone call now at the number you have called from your API and After answering the call, an IVR should be played whose callflow instructions will be fetched from your Pivot URL.
-
Overview Pivot enables you to generate real-time KAZOO callflows via a REST API. This means your web application can tell phone calls what to do, during the call! Some examples use cases: Checking an external account balance before allowing a call Routing an incoming call based on custom logic Present menu items and respond to selections based on information in your database Here’s how it works:When you add the Pivot module to your call flow, you provide Pivot with a callback URL to your webserver. From then on, when KAZOO receives a phone call for a Pivot-enabled phone number, KAZOO sends an HTTP request to your webserver asking it for a new callflow. Along with the request, KAZOO passes information about the call, such as the originating number. Your web application will then generate a new callflow, which KAZOO will run. Since your new callflow can itself contain another Pivot, you have the ability to make completely dynamic callflows. Features Routing a call based on accounts in a remote system Here’s an example where PIVOT is used to check if a customer record exists in Zendesk based on the incoming phone number. If so, the caller is connected to support. If not, the caller is played an audio message. Create a Call Flow based on a menu selection. Here’s an example Call Flow where a menu is presented to the caller. Once a selection is made, PIVOT makes a request to your webserver, passing along the menu item selected by the caller. Your webserver then returns a new Call Flow based on the menu selections. View full File
-
Overview Pivot enables you to generate real-time KAZOO callflows via a REST API. This means your web application can tell phone calls what to do, during the call! Some examples use cases: Checking an external account balance before allowing a call Routing an incoming call based on custom logic Present menu items and respond to selections based on information in your database Here’s how it works:When you add the Pivot module to your call flow, you provide Pivot with a callback URL to your webserver. From then on, when KAZOO receives a phone call for a Pivot-enabled phone number, KAZOO sends an HTTP request to your webserver asking it for a new callflow. Along with the request, KAZOO passes information about the call, such as the originating number. Your web application will then generate a new callflow, which KAZOO will run. Since your new callflow can itself contain another Pivot, you have the ability to make completely dynamic callflows. Features Routing a call based on accounts in a remote system Here’s an example where PIVOT is used to check if a customer record exists in Zendesk based on the incoming phone number. If so, the caller is connected to support. If not, the caller is played an audio message. Create a Call Flow based on a menu selection. Here’s an example Call Flow where a menu is presented to the caller. Once a selection is made, PIVOT makes a request to your webserver, passing along the menu item selected by the caller. Your webserver then returns a new Call Flow based on the menu selections.
-
What is Pivot? Pivot enables you to generate real-time KAZOO callflows via a REST API. This means your web application can tell phone calls what to do, during the call! Some examples use cases: Checking an external account balance before allowing a call Routing an incoming call based on custom logic Present menu items and respond to selections based on information in your database How does it work? When you add the Pivot module to your call flow, you provide Pivot with a callback URL to your webserver. From then on, when KAZOO receives a phone call for a Pivot-enabled phone number, KAZOO sends an HTTP request to your webserver asking it for a new callflow. Along with the request, KAZOO passes information about the call, such as the originating number. Your web application will then generate a new callflow, which KAZOO will run. Since your new callflow can itself contain another Pivot, you have the ability to make completely dynamic callflows. What does a request look like? When a call comes in to a configured Pivot number, we'll make a request to your web script with the following information: What does a response look like? When responding to the above request, your script might analyze the Caller ID of the caller and decide to identify the caller automatically and play their account balance, then connect them to customer support. Returned body: What are the variables for setting a Pivot Callflow? The dialog box for editing a callflow in Pivot is shown below: Is there a way to debug my Pivot routine? Yes. in the application there is a tab called Live Debug. It will list all recent calls that trigger a request to your http servier. If you click on "View Details" you can see the code that was both sent and returned. Is there a way to chain multiple Pivot requests together? Yes, it is possible to pass variables to multiple Pivot transactions. To do this you will want to use the set CAV (Custom Application Vars) option, and sent the results to a second Pivot. In the second Pivot add a query to see if a variable is set and access it that way. View full File
-
- pivot
- realtime call control
-
(and 1 more)
Tagged with: