MP_Addon_CalculatorsCallRail_Webhook::prepare_call_data( array $data )
Prepare call data.
Contents
Parameters Parameters
- $data
-
(array) (Required) call rail data { Call rail from webhook. @type string "answered", @type string "business_phone_number", @type string "call_type", @type string "company_id", @type string "company_name", @type string "company_time_zone", @type string "created_at", @type string "customer_city", @type string "customer_country", @type string "customer_name", @type string "customer_phone_number", @type string "customer_state", @type string "device_type", @type string "direction", @type string "duration", @type bool "first_call", @type string "formatted_call_type", @type string "formatted_customer_location", @type string "formatted_business_phone_number", @type string "formatted_customer_name", @type int "prior_calls", @type string "formatted_customer_name_or_phone_number", @type string "formatted_customer_phone_number", @type string "formatted_duration", @type string "formatted_tracking_phone_number", @type string "formatted_tracking_source", @type string "formatted_value", @type int "good_lead_call_id", @type string "good_lead_call_time", @type int "id", @type string "lead_status", @type string "note", @type string "recording", @type int "recording_duration", @type string "source", @type string "source_name", @type string "start_time", @type array "tags", @type int "total_calls", @type string "tracking_phone_number", @type string "transcription", @type string "value": "", @type bool "voicemail", @type array "waveforms", @type int "tracker_id", @type string "keywords": "", @type string "medium", @type string "referring_url", @type string "landing_page_url", @type string "last_requested_url", @type string "referrer_domain", @type array "conversational_transcript", @type string "utm_source", @type string "utm_medium", @type string "utm_term", @type string "utm_content", @type string "utm_campaign", @type string "utma", @type string "utmb", @type string "utmc", @type string "utmv", @type string "utmz", @type string "ga", @type string "fbclid", @type string "gclid", @type array "integration_data", @type string "keywords_spotted", @type string "recording_player", @type array "speaker_percent", @type array "call_highlights", @type string "agent_email", @type string "campaign", @type string "msclkid", @type string "keypad_entries", @type string "recording_redirect", @type string "callercity", @type string "callercountry", @type string "callername", @type string "callernum", @type string "callerstate", @type string "callsource", @type array "custom", @type string "datetime", @type string "destinationnum", @type string "ip", @type string "kissmetrics_id", @type string "landingpage", @type string "referrer", @type string "referrermedium", @type int "score", @type string "tag": "", @type string "trackingnum", @type string "timestamp", @type int "person_id", @type string "person_resource_id", @type string "resource_id", @type string "company_resource_id", @type string "tracker_resource_id" } @return array $call { Call data. @type string 'start_time' @type string 'customer_phone_number' @type string 'formatted_call_type' @type string 'recording' @type string 'formatted_duration' @type string 'conversational_transcript' @type string 'agent_email' @type string 'device_type' @type string 'call_highlights' @type string 'resource_id' @type string 'id' @type string 'note' @type string 'formatted_tracking_source' @type string 'source_name' @type string 'tags' @type string 'keywords' @type string 'referring_url' @type string 'landing_page_url' @type string 'last_requested_url' @type string 'referrer_domain' @type string 'keywords_spotted' @type string 'keypad_entries' }
Source Source
File: calculator-callrail-add-on/inc/MP_Addon_CalculatorsCallRail_Webhook.php
protected function prepare_call_data( $data ) {
$call = array(
'start_time' => isset( $data['start_time'] ) ? $data['start_time'] : '',
'customer_phone_number' => isset( $data['customer_phone_number'] ) ? $data['customer_phone_number'] : '',
'formatted_call_type' => isset( $data['formatted_call_type'] ) ? $data['formatted_call_type'] : '',
'recording' => isset( $data['recording'] ) ? $data['recording'] : '',
'formatted_duration' => isset( $data['formatted_duration'] ) ? $data['formatted_duration'] : '',
'conversational_transcript' => isset( $data['conversational_transcript'] ) ? $data['conversational_transcript'] : '',
'agent_email' => isset( $data['agent_email'] ) ? $data['agent_email'] : '',
'device_type' => isset( $data['device_type'] ) ? $data['device_type'] : '',
'call_highlights' => isset( $data['call_highlights'] ) ? $data['call_highlights'] : '',
'resource_id' => isset( $data['resource_id'] ) ? $data['resource_id'] : '',
'id' => isset( $data['id'] ) ? $data['id'] : '',
'note' => isset( $data['note'] ) ? $data['note'] : '',
'formatted_tracking_source' => isset( $data['formatted_tracking_source'] ) ? $data['formatted_tracking_source'] : '',
'source_name' => isset( $data['source_name'] ) ? $data['source_name'] : '',
'tags' => isset( $data['tags'] ) ? $data['tags'] : '',
'keywords' => isset( $data['keywords'] ) ? $data['keywords'] : '',
'referring_url' => isset( $data['referring_url'] ) ? $data['referring_url'] : '',
'landing_page_url' => isset( $data['landing_page_url'] ) ? $data['landing_page_url'] : '',
'last_requested_url' => isset( $data['last_requested_url'] ) ? $data['last_requested_url'] : '',
'referrer_domain' => isset( $data['referrer_domain'] ) ? $data['referrer_domain'] : '',
'keywords_spotted' => isset( $data['keywords_spotted'] ) ? $data['keywords_spotted'] : '',
'keypad_entries' => isset( $data['keypad_entries'] ) ? $data['keypad_entries'] : '',
);
return $call;
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |