{"id":619,"date":"2017-10-17T14:32:26","date_gmt":"2017-10-17T19:32:26","guid":{"rendered":"https:\/\/voip-communications.net\/vcw\/?page_id=619"},"modified":"2017-11-15T11:59:57","modified_gmt":"2017-11-15T17:59:57","slug":"phone-call-bridge","status":"publish","type":"page","link":"https:\/\/voip-communications.net\/vcw\/phone-services\/phone-call-bridge\/","title":{"rendered":"Phone call bridge"},"content":{"rendered":"<p>Phone call bridge allows you programmatically\u00a0start a phone call between two phone numbers. This tool is an alternative to \u201c<a href=\"https:\/\/voip-communications.net\/vcw\/phone-services\/click-to-call\/\">Click to Call<\/a>\u201d in cases where the user doesn\u2019t have a mic on his computer or just prefer a more private phone call.<\/p>\n<h3>URL:<\/h3>\n<p>https:\/\/voip-communications.net\/api-v2\/index.php\/pcall\/callbridge<\/p>\n<h3>Method:<\/h3>\n<p>POST<\/p>\n<h3>Authentication:<\/h3>\n<p>Basic<\/p>\n<h3>Parameters:<\/h3>\n<ul>\n<li><strong>token\u00a0<span style=\"color: #ff0000;\">(required)<\/span><\/strong>: token associated with your endpoint; The phone call will take the Caller ID and the recording options from the endpoint associated.<\/li>\n<li><strong>phone_a\u00a0<span style=\"color: #ff0000;\">(required)<\/span><\/strong>: First phone number to call (as soon as the phone call is answered,\u00a0<span style=\"color: #008000;\"><strong>\u201cphone_b\u201d<\/strong><\/span>\u00a0will be called)<\/li>\n<li><strong>phone_b\u00a0<span style=\"color: #ff0000;\">(required)<\/span><\/strong>: Second phone number to call after\u00a0<span style=\"color: #008000;\"><strong>\u201cphone_a\u201d<\/strong><\/span>\u00a0has answered the phone call.<\/li>\n<li><strong>call_date<\/strong>\u00a0(optional): Date to make the phone call with format YYYY-MM-DD HH:MM (keep in mind, the system check for scheduled phone calls every 5 minutes); If not provided, the system will make the call immediately. So, if you schedule a call <a href=\"https:\/\/voip-communications.net\/vcw\/phone-services\/phone-call-scheduled-listdelete\/\">[click here]<\/a> to see the API methods to list and delete scheduled\u00a0calls or <a href=\"https:\/\/voip-communications.net\/vcw\/phone-services\/requested-phone-calls\/\">[Click here]<\/a> to see all requested phone calls.<\/li>\n<li><strong>play_url<\/strong>\u00a0(optional): Url to an MP3 or WAV (WAVE PCM, 8000 Hz 16 bit or 11025 Hz 16 bit PCM) file to be played to\u00a0<span style=\"color: #008000;\"><strong>\u201cphone_a\u201d<\/strong><\/span>\u00a0when the phone call is answered. Url must be accessible from the internet.<\/li>\n<li><strong>msg<\/strong>\u00a0(optional): If specified, when\u00a0<span style=\"color: #008000;\"><strong>\u201cphone_a\u201d<\/strong><\/span>\u00a0answers the phone call the system will play the message indicated (after play the file indicated by\u00a0<span style=\"color: #008000;\"><strong>\u201cplay_url\u201d<\/strong><\/span>) and then call\u00a0<span style=\"color: #008000;\"><strong>\u201cphone_b\u201d<\/strong><\/span><\/li>\n<li><strong>msg_lang<\/strong><span style=\"font-weight: inherit;\">\u00a0(optional): If\u00a0<\/span><span style=\"color: #008000;\"><strong>\u201cmsg\u201d<\/strong><\/span><span style=\"font-weight: inherit;\">\u00a0is specified you must indicate the language to be used to play the message (see table below with possible values);<\/span><\/li>\n<li><strong>dialtone_url<\/strong> (optional): If specified, instead of hearing\u00a0the &#8220;Ringing tone&#8221; of <strong>&#8220;phone_b&#8221;<\/strong>, the person in <strong>&#8220;phone_a&#8221;<\/strong> will hear the audio (MP3\/WAV &#8211; WAVE PCM, 8000 Hz 16 bit or 11025 Hz 16 bit PCM) indicated; So dialtone_url must be an\u00a0Url accessible from the internet.<\/li>\n<\/ul>\n<table>\n<tbody>\n<tr>\n<td width=\"50%\"><strong>Language<\/strong><\/td>\n<td width=\"50%\"><strong>Value<\/strong><\/td>\n<\/tr>\n<tr>\n<td>English \u2013 British<\/td>\n<td>en-GB<\/td>\n<\/tr>\n<tr>\n<td>English \u2013 USA<\/td>\n<td>en-US<\/td>\n<\/tr>\n<tr>\n<td>French<\/td>\n<td>fr-FR<\/td>\n<\/tr>\n<tr>\n<td>German<\/td>\n<td>de-DE<\/td>\n<\/tr>\n<tr>\n<td>Italian<\/td>\n<td>it-IT<\/td>\n<\/tr>\n<tr>\n<td>Portuguese<\/td>\n<td>pt-BR<\/td>\n<\/tr>\n<tr>\n<td>Russian<\/td>\n<td>ru-RU<\/td>\n<\/tr>\n<tr>\n<td>Spanish<\/td>\n<td>es-ES<\/td>\n<\/tr>\n<tr>\n<td>Spanish \u2013 USA<\/td>\n<td>es-US<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>It is your current Endpoints \/ Token list:<\/h3>\n<div class=\"row-fluid\">\n\t\t<div class=\"alert alert-info\"><a href=\"https:\/\/voip-communications.net\/vcw\/user-login\/\">[Click here]<\/a> to Login\/Register to see a list of your Endpoint\/Token<\/div>\n\t<\/div>\n<h3>HTTP Response Codes:<\/h3>\n<p>200: Success<br \/>\n400: Invalid request<br \/>\n401: Invalid API\u00a0credentials<\/p>\n<h3>Response data:<\/h3>\n<p>You will get a JSON like this.<\/p>\n<pre>{\r\n    \"data\": {\r\n             \"token\": \"172805ndWT3J1Um4ySzRVWnpwMkZLZVAzSUSy9JRHUvdXVCVm9EdkszcGZhaTlySGc9PQ=as=\",\r\n             \"phone_a\": \"12818387270\",\r\n             \"phone_b\": \"17134533521\",\r\n             \"play_url\" : \"https:\/\/example.com\/file.mp3\",\r\n             \"msg\": \"good morning, please wait a moment to connect your call\",\r\n             \"msg_lang\": \"en-US\",\r\n             \"code\": 200,\r\n             \"code_desc\": \"\",\r\n             \"callid\": \"4812659e8ee99a8167613597768\"\r\n    }\r\n}<\/pre>\n<p>Please note <span style=\"color: #008000;\"><strong>&#8220;callid&#8221;<\/strong><\/span>\u00a0in the response; It is a unique code for the process, and it is required to cancel the request (just if it is a scheduled phone call bridge). <a href=\"https:\/\/voip-communications.net\/vcw\/phone-services\/phone-call-scheduled-listdelete\/\">[click here]<\/a> to see API methods to list\/delete\u00a0scheduled calls.<\/p>\n<h3>Curl Example<\/h3>\n<pre>curl -u YOUR_API_KEY:YOUR_API_PASSWORD\r\n     --data\"token=YOUR_ENDPOINT_TOKEN&amp;phone_a=18323456789&amp;phone_b=17134567890&amp;msg=HI&amp;msg_lang=en-US\"\r\n     https:\/\/voip-communications.net\/api-v2\/index.php\/pcall\/callbridge<\/pre>\n<h3>PHP Example<\/h3>\n<pre>$service_url = \"https:\/\/voip-communications.net\/api-v2\/index.php\/pcall\/callbridge\";\r\n$curl = curl_init($service_url);\r\ncurl_setopt($curl, CURLOPT_USERPWD, \"YOUR_API_KEY:YOUR_API_PASSWORD\");\r\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n$post_fields = array(\"token\" =&gt; \"ENDPOINT_TOKEN\",\r\n                     \"phone_a\" =&gt; \"18323456789\",\r\n                     \"phone_b\" =&gt; \"17134567890\",\r\n                     \"play_url\" =&gt; \"https:\/\/example.com\/file.wav\",\r\n                     \"msg\" =&gt; \"Please wait\",\r\n                     \"msg_lang\" =&gt; \"en-US\");\r\ncurl_setopt($curl, CURLOPT_POST, true);\r\ncurl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post_fields));\r\n$curl_response = curl_exec($curl);\r\nif ($curl_response !== false) {\r\n    $http_code = curl_getinfo($curl,CURLINFO_HTTP_CODE);\r\n    if ($http_code == \"200\") {\r\n        $result = json_decode($curl_response,true);\r\n        print_r($result);\r\n    }\r\n}\r\ncurl_close($curl);<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Phone call bridge allows you programmatically\u00a0start a phone call between two phone numbers. This tool is an alternative to \u201cClick to Call\u201d in cases where the user doesn\u2019t have a mic on his computer or just prefer a more private phone call. URL: https:\/\/voip-communications.net\/api-v2\/index.php\/pcall\/callbridge Method: POST Authentication: Basic Parameters: token\u00a0(required): token associated with your endpoint; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":24,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/voip-communications.net\/vcw\/wp-json\/wp\/v2\/pages\/619"}],"collection":[{"href":"https:\/\/voip-communications.net\/vcw\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/voip-communications.net\/vcw\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/voip-communications.net\/vcw\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/voip-communications.net\/vcw\/wp-json\/wp\/v2\/comments?post=619"}],"version-history":[{"count":64,"href":"https:\/\/voip-communications.net\/vcw\/wp-json\/wp\/v2\/pages\/619\/revisions"}],"predecessor-version":[{"id":787,"href":"https:\/\/voip-communications.net\/vcw\/wp-json\/wp\/v2\/pages\/619\/revisions\/787"}],"up":[{"embeddable":true,"href":"https:\/\/voip-communications.net\/vcw\/wp-json\/wp\/v2\/pages\/24"}],"wp:attachment":[{"href":"https:\/\/voip-communications.net\/vcw\/wp-json\/wp\/v2\/media?parent=619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}