### EUnit Test Setup and Cleanup with FixtureDB Source: https://docs.2600hz.com/more/applications/core/fixture-db-couch-db-mock-for-testing/2600-hz-fixture-db This example demonstrates how to set up and clean up a test environment using FixtureDB within an EUnit test. It ensures the 'kazoo_config' application and the 'kazoo_data_link_sup' are started before the test and stopped afterward. ```erlang -spec render_test_() -> any(). render_test_() -> {setup ,fun setup/0 ,fun cleanup/1 ,fun(_ReturnOfSetup) -> [{"your awesome test" ,?_assertEqual(good, evil) } ] end }. setup() -> ?LOG_DEBUG(":: Setting up 2600Hz FixtureDB"), {ok, _} = application:ensure_all_started(kazoo_config), {ok, LinkPid} = kazoo_data_link_sup:start_link(), LinkPid. cleanup(LinkPid) -> _ = erlang:exit(LinkPid, normal), _ = application:stop(kazoo_config), ?LOG_DEBUG(":: Stopped Kazoo FixtureDB"). ``` -------------------------------- ### Initialize All Master Applications Source: https://docs.2600hz.com/developers/rest/account-actions-and-permissions/apps-store Installs all Monster applications from a specified directory into the system for the master account. Use this during initial system setup or after updates. ```bash sup crossbar_maintenance init_apps '/path/to/monster-ui/apps' 'http://your.api.{{SERVER}}:8000/v2' ``` -------------------------------- ### Start and Enable Services Source: https://docs.2600hz.com/sysadmin/applications/fax/postfix Starts the Postgrey service, reloads Postfix configuration, and enables Postgrey to start on boot. ```bash service postgrey start service postfix reload chkconfig --levels 345 postgrey on ``` -------------------------------- ### Setup Let's Encrypt Certificate Source: https://docs.2600hz.com/sysadmin/ref/configuration/ssl/easy-setup Run the certbot-auto script interactively to obtain and install an SSL certificate for your domain using the Apache plugin. ```bash certbot-auto --apache -d kazoo.mycompany.com ``` -------------------------------- ### Start Media Manager WhApp Source: https://docs.2600hz.com/sysadmin/ref/appendix/cent-os Start the media_mgr WhApp to get default media prompts. ```bash sup whapps_controller start_app media_mgr ``` -------------------------------- ### Enable and Start Apache HTTP Server Source: https://docs.2600hz.com/sysadmin/ref/getting-started/installation/via-cent-os-7 Enables the Apache HTTP server to start on boot and then starts the service. ```bash systemctl enable httpd systemctl start httpd ``` -------------------------------- ### Enable and Start HAProxy Service Source: https://docs.2600hz.com/sysadmin/ref/getting-started/installation/via-cent-os-7 These commands enable the HAProxy service to start on boot and then start the service immediately. ```bash systemctl enable kazoo-haproxy systemctl start kazoo-haproxy ``` -------------------------------- ### Start FreeSWITCH and Access CLI Source: https://docs.2600hz.com/sysadmin/ref/appendix/cent-os Start the FreeSWITCH service and then open the FreeSWITCH command-line interface. ```bash /sbin/service freeswitch start /usr/local/freeswitch/bin/fs_cli ``` -------------------------------- ### Enable services to start on boot Source: https://docs.2600hz.com/sysadmin/ref/getting-started/installation/via-rpm Configures HAProxy and FreeSWITCH to start automatically when the system boots up. ```bash chkconfig haproxy on ``` ```bash chkconfig freeswitch on ``` -------------------------------- ### Enable and Start FreeSWITCH Service Source: https://docs.2600hz.com/sysadmin/ref/getting-started/installation/via-cent-os-7 Enables the kazoo-freeswitch service to start on boot and then starts the service. ```bash systemctl enable kazoo-freeswitch systemctl start kazoo-freeswitch ``` -------------------------------- ### Install Dependencies Source: https://docs.2600hz.com/frontends/monsterui/dev-ref/getting-started Install all necessary project dependencies using npm. ```bash npm install ``` -------------------------------- ### Start HAProxy Service Source: https://docs.2600hz.com/sysadmin/ref/appendix/cent-os Starts the HAProxy service using the specified configuration file. ```bash haproxy -f /etc/haproxy/haproxy.cfg ``` -------------------------------- ### Install Kazoo-wrapped Kamailio Source: https://docs.2600hz.com/sysadmin/ref/getting-started/installation/via-cent-os-7 Installs the Kazoo-wrapped Kamailio package. ```bash yum install -y kazoo-kamailio ``` -------------------------------- ### Install Development Dependencies Source: https://docs.2600hz.com/sysadmin/ref/appendix/crossbar-haproxy Install necessary packages for building HAProxy from source RPM. ```bash yum install @development openssl-devel pcre-static pcre-devel ``` -------------------------------- ### Install Kazoo-wrapped FreeSWITCH Source: https://docs.2600hz.com/sysadmin/ref/getting-started/installation/via-cent-os-7 Installs the Kazoo-wrapped FreeSWITCH package. ```bash yum install -y kazoo-freeswitch ``` -------------------------------- ### Click-to-Call Connect Response Example Source: https://docs.2600hz.com/developers/rest/usage/click-to-call Example JSON response for initiating a Click-to-Call connection. ```json { "data": { "application_data": { "route": "{CONTACT}" }, "application_name": "transfer", "continue_on_fail": true, "custom_application_vars": { "contact": "{CONTACT}" }, "custom_channel_vars": { "account_id": "{ACCOUNT_ID}", "authorizing_id": "{C2C_ID}", "authorizing_type": "clicktocall", "auto_answer_loopback": true, "from_uri": "{EXTENSION}@{ACCOUNT_REALM}", "inherit_codec": false, "loopback_request_uri": "{CONTACT}@{ACCOUNT_REALM}", "request_uri": "{CONTACT}@{ACCOUNT_REALM}", "retain_cid": true }, "dial_endpoint_method": "single", "endpoints": [ { "invite_format": "loopback", "route": "{EXTENSION}", "to_did": "{EXTENSION}", "to_realm": "{ACCOUNT_REALM}" } ], "export_custom_channel_vars": [ "Account-ID", "Authorizing-ID", "Authorizing-Type", "Loopback-Request-URI", "From-URI", "Request-URI" ], "ignore_early_media": true, "loopback_bowout": "false", "outbound_call_id": "c2c-{C2C_ID}-{RANDOM}", "outbound_callee_id_name": "{EXTENSION}", "outbound_callee_id_number": "{EXTENSION}", "outbound_caller_id_name": "{C2C NAME}", "outbound_caller_id_number": "{CONTACT}", "simplify_loopback": "false", "start_control_process": "false", "timeout": 30 }, "node": "{NODE_HASH}", "request_id": "{REQUEST_ID}", "revision": "{REVISION}", "status": "success", "timestamp": "{TIMESTAMP}", "version": "4.3.1" } ``` -------------------------------- ### Get Sample Payloads of Function Events (Request Example) Source: https://docs.2600hz.com/developers/rest/call-control/advanced-features/pivot/functions An example request to get sample payloads for function events. This demonstrates the basic structure of the API call. ```bash curl -H 'Content-Type: application/json' 'http://{SERVER}:8000/v2/functions/samples' ``` -------------------------------- ### Build and Launch Development Server Source: https://docs.2600hz.com/frontends/monsterui/dev-ref/getting-started Use the gulp command to build the project and start the local development web server. ```bash gulp ``` -------------------------------- ### Signup Parameters Example Source: https://docs.2600hz.com/developers/rest/account-actions-and-permissions/accounts This JSON example shows additional parameters included in the account response metadata when an account is created via a Sign up method. It includes basic signup details. ```json { "metadata": { "signup": { "method": "hello", "email": "cool@beans.com", "email_is_verified": false, "user": { "id": "sdsdsddssdsdsdsdsdsd", "first_name": "John", "last_name": "Due" }, "metadata": { "uuid": "dkdld" } } }, "data": { "enabled": true, "id": "{ACCOUNT_ID}", "// ...": "" }, "status": "success" } ``` -------------------------------- ### Another Resource Configuration Example Source: https://docs.2600hz.com/call-control/routing/carriers/resources This example shows another resource configuration with identical weight_cost values for the resource and its classifier, similar to the initial state before prioritization. ```json { "name": "Carrier2", "weight_cost": 50, "classifiers":{ "did_us": { "enabled": true, "prefix": "", "suffix": "", "emergency": false, "weight_cost": 50 } } } ``` -------------------------------- ### Send GET Request to Crossbar API Source: https://docs.2600hz.com/events/websockets/blackhole-web-socket-api/api/crossbar-api-tunneling Example of a JSON payload to send a GET request to a Crossbar API endpoint via WebSocket. Ensure the auth_token has the 'api:tunnel' scope. ```json { "action": "api", "auth_token": "{AUTH_TOKEN}", "request_id": "{REQUEST_ID}", "data": { "verb": "get", "endpoint": "/v2/accounts/156e05e8a12fd138540cd2017a97e371/users" } } ``` -------------------------------- ### Erlang Shell Interaction with FixtureDB Source: https://docs.2600hz.com/more/applications/core/fixture-db-couch-db-mock-for-testing/2600-hz-fixture-db This snippet shows an example of an Erlang shell session after starting the FixtureDB shell. It includes starting the kazoo_config application and the kazoo_data_link_sup, demonstrating successful connections and loaded settings. ```erlang Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V8.3 (abort with ^G) (fixturedb@hes.2600hz.com)1> application:ensure_all_started(kazoo_config) 16:36:34.542 [info] Application lager started on node 'fixturedb@hes.2600hz.com' 16:36:34.542 [info] Application kazoo started on node 'fixturedb@hes.2600hz.com' 16:36:34.544 [info] Application zucchini started on node 'fixturedb@hes.2600hz.com' 16:36:34.587 [info] loaded configs from file /home/hesaam/work/2600hz/kazoo/rel/config-test.ini 16:36:34.588 [notice] loaded settings : [{amqp,[{uri,"amqp://guest:guest@127.0.0.1:5672"}]},{data,[{config,kazoo_fixturedb}]},{kazoo_fixturedb,[{driver,kazoo_fixturedb},{tag,local}]},{kazoo_apps,[{cookie,change_me}]},{ecallmgr,[{cookie,change_me}]},{log,[{syslog,none},{console,none},{file,none}]}] 16:36:34.615 [notice] setting zone to local 16:36:34.616 [info] Application kazoo_config started on node 'fixturedb@hes.2600hz.com' {ok,[crypto,inet_cidr,observer,syntax_tools,compiler, goldrush,lager,kazoo,zucchini,kazoo_config]} (fixturedb@hes.2600hz.com)2> (fixturedb@hes.2600hz.com)2> kazoo_data_link_sup:start_link(). 16:36:46.073 [info] Application asn1 started on node 'fixturedb@hes.2600hz.com' 16:36:46.073 [info] Application public_key started on node 'fixturedb@hes.2600hz.com' 16:36:46.089 [info] Application kazoo_fixturedb started on node 'fixturedb@hes.2600hz.com' 16:36:46.126 [info] waiting for first connection... 16:36:46.126 [info] adding connection 16:36:46.142 [info] start connection 16:36:46.142 [info] trying to connect kazoo_fixturedb 16:36:46.365 [info] connected to local: {"kazoo":"Willkommen","version":"0.0.0.0.0.0.0.1","features":["cool"],"vendor":{"name":"the Great FixtureDB Committee"}} {ok,<0.117.0>} (fixturedb@hes.2600hz.com)3> ``` -------------------------------- ### Get Dummy Plan Source: https://docs.2600hz.com/sysadmin/applications/core/fixture-db-maintenance Retrieves a dummy plan, useful when running in fixture_shell without starting kazoo_data and kazoo_fixturedb. ```Erlang dummy_plan(). ``` -------------------------------- ### Setup Kazoo yum repository Source: https://docs.2600hz.com/sysadmin/ref/getting-started/installation/via-rpm Adds the 2600hz.repo file to the system's yum configuration to enable installation of Kazoo packages. ```bash curl -o /etc/yum.repos.d/2600hz.repo http://repo.2600hz.com/2600hz.repo ``` -------------------------------- ### Resource Configuration Example Source: https://docs.2600hz.com/call-control/routing/carriers/resources This is a basic example of a resource configuration, omitting most fields. It includes a name, weight_cost, and a classifier with its own weight_cost. ```json { "name": "Carrier1", "weight_cost": 50, "classifiers":{ "did_us": { "enabled": true, "prefix": "", "suffix": "", "emergency": false, "weight_cost": 50 } } } ``` -------------------------------- ### Get Task Status (Success) Source: https://docs.2600hz.com/more/legacy-http-api/advanced-system-configuration/misc/tasks-background-jobs Example of a successful response when querying the status of a task. It includes details about the task's execution and progress. ```json { "auth_token": "{AUTH_TOKEN}", "data": { "_read_only": { "account_id": "{ACCOUNT_ID}", "auth_account_id": "{AUTH_ACCOUNT_ID}", "action": "list", "category": "number_management", "created": 63633924886, "failure_count": 0, "id": "{TASK_ID}", "node": "whistle_apps@qwd", "start_timestamp": 63633924909, "status": "executing", "success_count": 50, "csvs":["in.csv"] } }, "request_id": "{REQUEST_ID}", "revision": "{REVISION}", "status": "success" } ``` -------------------------------- ### Start FixtureDB Shell Source: https://docs.2600hz.com/more/applications/core/fixture-db-couch-db-mock-for-testing/2600-hz-fixture-db Use this command to start a shell with all core applications and dependencies for FixtureDB. Ensure you are in the 2600Hz project path. ```bash kazoo $ make fixture_shell ``` -------------------------------- ### Non-blocking Quickcall (GET) Source: https://docs.2600hz.com/developers/rest/call-control/advanced-features/quickcall Initiates a quickcall without waiting for confirmation of channel start. Use this when immediate feedback on call origination failure is not critical. ```bash curl -v -X GET \ -H "X-Auth-Token: {AUTH_TOKEN}" \ http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/{ENDPOINTS}/{ENDPOINT_ID}/quickcall/{NUMBER} ``` -------------------------------- ### Configure Environment Variables and Install System Updates Source: https://docs.2600hz.com/sysadmin/ref/getting-started/installation/via-cent-os-7 Sets up essential environment variables for IP address, hostname, and SignalWire token. It then updates the system and installs necessary packages like EPEL and yum-utils. ```bash # pre-configure custom defaults: export IP_ADDR=172.16.17.18 export _HOSTNAME=aio.kazoo.com export TOKEN=SIGNALWIRE_TOKEN # You can find the latest Release RPM here: https://packages.2600hz.com/centos/7/stable/2600hz-release/ # Currently, 4.3 is considered 'stable' so: # https://packages.2600hz.com/centos/7/stable/2600hz-release/4.3/2600hz-release-4.3-0.el7.centos.noarch.rpm export RELEASE_BASE=https://packages.2600hz.com/centos/7/stable/2600hz-release export RELEASE_VER=4.3 export META_PKG=2600hz-release-${RELEASE_VER}-0.el7.centos.noarch.rpm export LATEST_RELEASE=${RELEASE_BASE}/${RELEASE_VER}/${META_PKG} # Install all system updates yum update -y # Install Extra Packages for Enterprise Linux yum install -y epel-release # Install required packages yum install -y yum-utils psmisc ``` -------------------------------- ### Install FreeSWITCH Build Script Source: https://docs.2600hz.com/sysadmin/ref/appendix/debian This command initiates the FreeSWITCH build process from the installation script. ```bash ./scripts/install-freeswitch.sh ``` -------------------------------- ### Get Branded App Screenshot Source: https://docs.2600hz.com/developers/rest/account-actions-and-permissions/apps-store This example demonstrates how to retrieve a specific app screenshot that has been branded for a particular domain. This allows resellers to customize app visuals. ```APIDOC ## GET /v2/whitelabel/{{domain}}/apps_store/screenshot/{{screenshot_index}} ### Description Retrieves a specific app screenshot that has been branded for a given domain. ### Method GET ### Endpoint `/v2/whitelabel/{{domain}}/apps_store/screenshot/{{screenshot_index}}` ### Parameters #### Path Parameters - **domain** (string) - Required - The whitelabel domain. - **screenshot_index** (string) - Required - The index of the screenshot to retrieve. ### Response #### Success Response (200) - **(binary)** - The requested screenshot image. ``` -------------------------------- ### Get App Screenshot with Language Source: https://docs.2600hz.com/developers/rest/account-actions-and-permissions/apps-store This example shows how to retrieve a specific app screenshot for a given language. This is useful for displaying localized app visuals to users. ```APIDOC ## GET /v2/accounts/{{account_id}}/i18n/{{LANGUAGE_CODE}}/apps_store/{{app_id}}/screenshot/{{screenshot_index}} ### Description Retrieves a specific app screenshot for a given language. ### Method GET ### Endpoint `/v2/accounts/{{account_id}}/i18n/{{LANGUAGE_CODE}}/apps_store/{{app_id}}/screenshot/{{screenshot_index}}` ### Parameters #### Path Parameters - **account_id** (string) - Required - The account ID. - **LANGUAGE_CODE** (string) - Required - The language code (e.g., 'de-DE'). - **app_id** (string) - Required - The ID of the application. - **screenshot_index** (string) - Required - The index of the screenshot to retrieve. ### Response #### Success Response (200) - **(binary)** - The requested screenshot image. ``` -------------------------------- ### Example: Get Service Changes Summary Per Day with Date Range Source: https://docs.2600hz.com/developers/rest/usage/services Demonstrates fetching the daily service changes summary with specific 'created_from' and 'created_to' parameters. ```curl curl -v -X GET \ -H "X-Auth-Token: {AUTH_TOKEN}" \ http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/services/audit/summary?created_from=63742805754&created_to=63743140658 ``` -------------------------------- ### Start ecallmgr in Development Mode Source: https://docs.2600hz.com/sysadmin/ref/appendix/cent-os Navigate to the ecallmgr directory and start the ecallmgr service in development mode. ```bash cd /opt/kazoo/ecallmgr/./start-dev.sh ``` -------------------------------- ### Configure Per-Node CouchDB Ports Source: https://docs.2600hz.com/sysadmin/applications/tasks/database-compaction Set per-couch-node settings for admin and API ports if your setup varies from the default. This example shows how to set the admin port for a specific node. ```bash sup kapps_config set_node kazoo_couch admin_port 35986 couchdb@db001.host.com ``` -------------------------------- ### Run Kamailio Service Source: https://docs.2600hz.com/sysadmin/ref/appendix/cent-os Start the Kamailio service using the configured file. ```bash /opt/kamailio/sbin/kamailio -f /opt/kamailio/etc/kamailio.cfg ``` -------------------------------- ### Basic Monster UI Configuration Source: https://docs.2600hz.com/frontends/monsterui/dev-ref/quick-guides/configure-your-monster-ui-install A minimal configuration example for Monster UI, suitable for installations on the same server as Kazoo with default API locations. This sets up basic whitelabeling and navigation links. ```javascript define({ whitelabel: { companyName: '2600Hz', applicationTitle: 'Monster UI', callReportEmail: 'support@2600hz.com', nav: { help: 'http://wiki.2600hz.com' }, port: { loa: 'http://ui.zswitch.net/Editable.LOA.Form.pdf', resporg: 'http://ui.zswitch.net/Editable.Resporg.Form.pdf' } } }); ``` -------------------------------- ### Export Rates Source: https://docs.2600hz.com/more/legacy-http-api/advanced-system-configuration/connectivity/rates/system-administrators Initiates an export of all rates into a CSV file. This involves a PUT request to start the export task and subsequent GET requests to retrieve the task status and the CSV data. ```APIDOC ## PUT /v2/tasks?category=rates&action=export ### Description Initiates the export of all rates into a CSV file. ### Method PUT ### Endpoint `http://{SERVER}:8000/v2/tasks/?category=rates&action=export` ### Parameters #### Query Parameters - **category** (string) - Required - Must be 'rates'. - **action** (string) - Required - Must be 'export'. ### Request Example ```curl curl -v -X PUT \ -H "X-Auth-Token: {AUTH_TOKEN}" \ 'http://{SERVER}:8000/v2/tasks/?category=rates&action=export' ``` ### Response #### Success Response (200) - **data.auth_token** (string) - Authentication token for subsequent requests. - **data.data.id** (string) - The ID of the initiated export task. - **data.data.status** (string) - The status of the task, initially 'pending'. #### Response Example ```json { "auth_token": "{AUTH_TOKEN}", "data": { "_read_only": { "account_id": "{ACCOUNT_ID}", "action": "export", "auth_account_id": "{AUTH_ACCOUNT_ID}", "category": "rates", "created": 63652613701, "id": "{TASK_ID}", "status": "pending" } }, "request_id": "{REQUEST_ID}", "revision": "undefined", "status": "success" } ``` ## PATCH /v2/tasks/{TASK_ID} ### Description Used to check the status of an ongoing export task. ### Method PATCH ### Endpoint `http://{SERVER}:8000/v2/tasks/{TASK_ID}` ### Parameters #### Path Parameters - **TASK_ID** (string) - Required - The ID of the task to check. ## GET /v2/tasks/{TASK_ID} ### Description Retrieves the exported rates as a CSV file once the task has completed. ### Method GET ### Endpoint `http://{SERVER}:8000/v2/tasks/{TASK_ID}` ### Parameters #### Path Parameters - **TASK_ID** (string) - Required - The ID of the completed task. #### Query Parameters - **csv_name** (string) - Optional - Specifies the filename for the downloaded CSV (e.g., 'out.csv'). ### Request Example ```curl curl -v -X GET \ -o export.csv \ -H "Accept: text/csv" \ -H "X-Auth-Token: $AUTH_TOKEN" \ 'http://{SERVER}:8000/v2/tasks/{TASK_ID}?csv_name=out.csv' ``` ``` -------------------------------- ### Example Template with Catch-All Rules Source: https://docs.2600hz.com/developers/rest/authentication/token-restrictions This example demonstrates a template structure that includes specific rules for 'cb_user_auth' with 'admin' and 'user' privilege levels, as well as catch-all rules for other scenarios. ```json { "cb_user_auth": { "admin": { "RULES_FOR_ADMIN" }, "user": { "RULES_FOR_USER" } }, "_": { "admin": { "RULES_FOR_ADMIN" }, "_": { "CATCH_ALL_RULES" } } } ``` -------------------------------- ### Example: Get Service Changes Summary for 'user' Category with Date Range Source: https://docs.2600hz.com/developers/rest/usage/services Demonstrates fetching the daily service changes summary for the 'user' category with specific date range parameters. ```curl curl -v -X GET \ -H "X-Auth-Token: {AUTH_TOKEN}" \ http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/services/audit_summary/user?created_from=63742805754&created_to=63743140658 ``` -------------------------------- ### Configure FreeSWITCH Repository Source: https://docs.2600hz.com/sysadmin/ref/getting-started/installation/via-cent-os-7 Downloads and installs the FreeSWITCH repository configuration using provided SignalWire credentials. It then sets the system hostname and updates the /etc/hosts file. ```bash # Download and install updated FreeSWITCH repository echo "signalwire" > /etc/yum/vars/signalwireusername echo ${TOKEN} > /etc/yum/vars/signalwiretoken wget https://$(< /etc/yum/vars/signalwireusername):$(< /etc/yum/vars/signalwiretoken)@freeswitch.signalwire.com/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm rpm -i --replacefiles freeswitch-release-repo-0-1.noarch.rpm # Hostname setup hostnamectl set-hostname ${_HOSTNAME} echo "${IP_ADDR} ${_HOSTNAME} `hostname -s`" >> /etc/hosts echo "127.0.0.1 ${_HOSTNAME} `hostname -s`" >> /etc/hosts echo "::1 ${_HOSTNAME} `hostname -s`" >> /etc/hosts ``` -------------------------------- ### Full Token Restriction Rule Example Source: https://docs.2600hz.com/developers/rest/authentication/token-restrictions This JSON object defines a rule that allows GET, POST, and PATCH requests for all accounts, effectively restricting deletion or creation of sub-accounts for users. ```json { "cb_user_auth": { "user":{ "accounts":[ { "rules": { "*": ["GET", "POST", "PATCH"] } } ] } } } ``` -------------------------------- ### Configure, Compile, and Install FreeSWITCH Source: https://docs.2600hz.com/sysadmin/ref/appendix/cent-os Runs the configure script and compiles FreeSWITCH, including installing sounds, music on hold, and specific modules. ```bash ./configure -C && make all install sounds-install moh-install mod_erlang_event-install mod_shell_stream-install ``` -------------------------------- ### Get App Screenshot with Language and Whitelabel Source: https://docs.2600hz.com/developers/rest/account-actions-and-permissions/apps-store This example demonstrates how to retrieve a specific app screenshot, combining language-specific and whitelabel overrides. It shows the flexibility of the API in serving localized and branded content. ```APIDOC ## GET /v2/whitelabel/{{domain}}/i18n/{{LANGUAGE_CODE}}/apps_store/{{app_id}}/screenshot/{{screenshot_index}} ### Description Retrieves a specific app screenshot, applying whitelabel and language-specific overrides. ### Method GET ### Endpoint `/v2/whitelabel/{{domain}}/i18n/{{LANGUAGE_CODE}}/apps_store/{{app_id}}/screenshot/{{screenshot_index}}` ### Parameters #### Path Parameters - **domain** (string) - Required - The whitelabel domain. - **LANGUAGE_CODE** (string) - Required - The language code (e.g., 'de-DE'). - **app_id** (string) - Required - The ID of the application. - **screenshot_index** (string) - Required - The index of the screenshot to retrieve. ### Response #### Success Response (200) - **(binary)** - The requested screenshot image. ``` -------------------------------- ### Enable HAProxy to Start Automatically Source: https://docs.2600hz.com/sysadmin/ref/appendix/cent-os Configures HAProxy to start automatically on system boot using chkconfig. ```bash chkconfig haproxy on ``` -------------------------------- ### Setup NTPd for Time Synchronization Source: https://docs.2600hz.com/sysadmin/ref/getting-started/installation/via-cent-os-7 Installs and configures the Network Time Protocol daemon (NTPd) to ensure accurate time synchronization across the server, which is crucial for distributed systems like Kazoo. ```bash # Setup NTPd yum install -y ntp systemctl enable ntpd systemctl restart ntpd ``` -------------------------------- ### Start WhApps in Development Mode Source: https://docs.2600hz.com/sysadmin/ref/appendix/cent-os Navigate to the whistle_apps directory and start the WhApps services in development mode. ```bash cd /opt/kazoo/whistle_apps/ ./start-dev.sh ``` -------------------------------- ### Highlight Element with Custom Colors and Timer Source: https://docs.2600hz.com/frontends/monsterui/dev-ref/references/monster-ui/monster-ui-highlight This example shows how to highlight a jQuery element with custom start and end colors, a specified duration, and a callback function that executes upon completion. The callback logs a message to the console. ```javascript var target = $("#element_to_highlight"); monster.ui.highlight(target, { startColor: "#3B3", endColor: "#FFF", timer: 5000, callback: function() { console.log('Highlight complete.'); } }); ``` -------------------------------- ### Start Blackhole Application Source: https://docs.2600hz.com/sysadmin/applications/blackhole/f-administrating-blackhole Use this command to start the Blackhole application and add it to the list of startup applications. ```shell sup kazoo_apps_maintenance start_app blackhole ``` -------------------------------- ### Complex Group Consume Example: Three Classifiers Source: https://docs.2600hz.com/developers/rest/call-control/limits/allotments A more intricate 'group_consume' setup involving three classifiers (Class1, Class2, Class3), showcasing how consumption is aggregated and remaining free seconds are calculated across interdependent groups. ```json { "Class1": { "amount": 600, "group_consume": [ "Class2", "Class3" ] }, "Class2": { "amount": 120, "group_consume": [ "Class1" ] }, "Class3": { "amount": 300, "group_consume": [ "Class2" ] } } ``` -------------------------------- ### Configure BigCouch Erlang Node Settings Source: https://docs.2600hz.com/sysadmin/ref/appendix/debian Example configuration for BigCouch's 'vm.args' file, setting the Erlang node name, magic cookie for distributed communication, and other runtime parameters. This is crucial for clustered or distributed BigCouch setups. ```erlang # Each node in the system must have a unique name. A name can be short # (specified using -sname) or it can by fully qualified (-name). #Fqdn examle: bigcouch@example.com-name bigcouch@ # All nodes must share the same magic cookie for distributed Erlang to work. # Comment out this line if you synchronized the cookies by other means (using # the ~/.erlang.cookie file, for example). -setcookie # Tell SASL not to log progress reports -sasl errlog_type error # Use kernel poll functionality if supported by emulator +K true # Start a pool of asynchronous IO threads +A 16 # Comment this line out to enable the interactive Erlang shell on startup +Bd -noinput ``` -------------------------------- ### Failing Quick Call Request Example Source: https://docs.2600hz.com/developers/rest/call-control/advanced-features/quickcall This JSON object represents a failing Quick Call request. It is advisable to use POST requests for Quick Call to ensure the API blocks until the channel starts or the quickcall fails, providing immediate feedback on the call's status. ```json { "auth_token": "{AUTH_TOKEN}", "data": { "error_message": "DESTINATION_OUT_OF_ORDER", "request": { "app_name": "crossbar", "app_version": "4.0.0", "application_data": { "route": "{EXTENSION}" }, "application_name": "transfer", "continue_on_fail": false, "custom_channel_vars": { "account_id": "{ACCOUNT_ID}", "authorizing_id": "{DEVICE_ID}", "authorizing_type": "device", "inherit_codec": "false", "retain_cid": "true" }, "dial_endpoint_method": "simultaneous", "endpoints": [ { "codecs": [ "PCMU", "PCMA" ], "custom_channel_vars": { "account_id": "{ACCOUNT_ID}", "authorizing_id": "{DEVICE_ID}", "authorizing_type": "device", "auto_answer": true, "media_encryption_enforce_security": false, "sip_invite_domain": "{SIP_REALM}" }, "custom_sip_headers": { "x_kazoo_aor": "sip:{SIP_USERNAME}@{SIP_REALM}", "x_kazoo_invite_format": "contact" }, "ignore_completed_elsewhere": false, "invite_format": "contact", "outbound_call_id": "{CALL_ID}-quickcall", "presence_id": "{SIP_USERNAME}@{SIP_REALM}", "to_did": "{EXTENSION}", "to_realm": "{SIP_REALM}", "to_user": "{SIP_USERNAME}", "to_username": "{SIP_USERNAME}" } ], "event_category": "resource", "event_name": "originate_req", "export_custom_channel_vars": [ "Account-ID", "Retain-CID", "Authorizing-ID", "Authorizing-Type", "Outbound-Callee-ID-Number", "Outbound-Callee-ID-Name" ], "ignore_early_media": true, "media": "process", "msg_id": "{MSG_ID}", "node": "{NODE}", "outbound_callee_id_name": "{DEVICE_CALLER_ID_NAME}", "outbound_callee_id_number": "{DEVICE_CALLER_ID_NUMBER}", "outbound_caller_id_name": "Device QuickCall", "outbound_caller_id_number": "{EXTENSION}", "server_id": "{API_AMQP_QUEUE}", "system_log_id": "{LOG_ID}", "timeout": 30 } }, "error": "500", "message": "quickcall initiation failed", "node": "{NODE}", "request_id": "{REQUEST_ID}", "status": "error", "timestamp": "{TIMESTAMP}", "version": "4.2.2" } ``` -------------------------------- ### Example URL Construction with field_list Source: https://docs.2600hz.com/developers/rest/account-actions-and-permissions/other-account-features/storage Demonstrates how different `field_list` configurations can generate various URL structures by combining arguments, constants, and metadata fields. ```json {"_id":"abc123" ,"foo":"bar" ,"bing":"bang" } ``` ```json [{"arg":"account_id"}, {"arg":"id"}, {"arg":"attachment"}] ``` ```json [{"const":"?path="}, {"arg":"account_id"}, {"arg":"id"}, {"arg":"attachment"}] ``` ```json [{"field":"foo"}, {"arg":"attachment"}] ``` ```json [{"group":[{"arg":"account_id"}, {"const":"_"}, {"arg":"attachment"}]}] ``` -------------------------------- ### Enable and Start BigCouch Service Source: https://docs.2600hz.com/sysadmin/ref/getting-started/installation/via-cent-os-7 Enables the kazoo-bigcouch service to start on boot and then starts the service. ```bash systemctl enable kazoo-bigcouch systemctl start kazoo-bigcouch ``` -------------------------------- ### FreeSWITCH Installation and Configuration Source: https://docs.2600hz.com/sysadmin/ref/appendix/debian This script installs FreeSWITCH packages, fixes file ownership, and sets up music paths. It's crucial for preparing the FreeSWITCH environment. ```bash cd ~/src #move debug deb packages to a folder mkdir dbg mv *dbg*.deb dbg #install FreeSWITCH lib sudo dpkg -i libfreeswitch1_1.2.11~n20130730T132523Z-1~precise+1_amd64.deb #install other FreeSWITCH packages. sudo dpkg -i freeswitch* #Fix file and folder ownership ownership sudo chown -R freeswitch:daemon /etc/freeswitch/ #fix music paths cd /usr/share/freeswitch/sounds/music sudo ln -s default/8000 8000 sudo ln -s default/16000 16000 sudo ln -s default/32000 32000 sudo ln -s default/48000 48000 ``` -------------------------------- ### Enable and Start RabbitMQ Service Source: https://docs.2600hz.com/sysadmin/ref/getting-started/installation/via-cent-os-7 Ensures the kazoo-rabbitmq service starts automatically on boot and then starts the service. ```bash systemctl enable kazoo-rabbitmq systemctl start kazoo-rabbitmq ``` -------------------------------- ### Install cURL from Source Source: https://docs.2600hz.com/sysadmin/ref/appendix/cent-os Downloads, unpacks, configures, and installs cURL from source to a specified local prefix. ```bash wget http://curl.haxx.se/download/curl-7.20.1.tar.gz -P /usr/src/ tar -xzf /usr/src/curl-7.20.1.tar.gz -C /usr/src/ cd /usr/src/curl-7.20.1 ./configure --prefix=/usr/local && make && make install ```