{"_id":"544d3bcdb80812080035ba27","is_link":false,"project":"542dbe0ecb19820800c1f4d7","version":{"_id":"542ecc0a6b0eb6080066ca77","forked_from":"542dbe0fcb19820800c1f4da","project":"542dbe0ecb19820800c1f4d7","__v":31,"createdAt":"2014-10-03T16:17:14.165Z","releaseDate":"2014-10-03T16:17:14.165Z","categories":["542ecc0a6b0eb6080066ca78","542ef44f6b0eb6080066cb24","543bf3e22a30961a00b66eb3","5446952b82bd7e08002768a0","544821ae8d7af31a00dd41ce","544a7885f1aefa08006efc69","544c758e11845f0e001ed8de","544e5565b80812080035be55","544e558dbd51b9080037f8ca","5450b045a66f020800dba73d","5450eb6aa66f020800dba945","5450f39ea66f020800dba989","5450f877a66f020800dba9cf","54510356a66f020800dbaa17","5451274514af501a00b50c99","54513345a66f020800dbab24","54513cc014af501a00b50d24","54515eec14af501a00b50db9","54519b1d14af501a00b50ea9","54519b2aa66f020800dbacb4","54524f9704160008005b1d27","54538d2308d1800800473d95","54538d420c09721000a06a03","54538e5608d1800800473d9a","5453ea9547c30114004fb375","5453eb12b077c31c00067bcb","5453eb27b077c31c00067bcd","5453ed5db077c31c00067bde","548075cbe291c51a00e7e096","5922fa475c48c70f00f21453","59244fd41e32eb190028ad8d"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"__v":12,"category":{"_id":"543bf3e22a30961a00b66eb3","__v":21,"pages":["5489d5e61ea5330b007b5a51","5489e243d8dec60b00034297","5489e318aefb240b00d197ef","56cdf622e538330b0021ab5a"],"project":"542dbe0ecb19820800c1f4d7","version":"542ecc0a6b0eb6080066ca77","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-13T15:46:42.097Z","from_sync":false,"order":0,"slug":"inboundxml","title":"InboundXML"},"parentDoc":null,"user":"544a586d27b7fc140078db12","updates":["581969cefa9f680f003426c1"],"next":{"pages":[],"description":""},"createdAt":"2014-10-26T18:22:05.145Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"settings":"","try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":14,"body":"The `<Record> ` element is used to record audio during a call. It can occur anywhere within an InboundXML document but will only begin recording once it has been reached. This means, it would have to be the first element after `<Response>` for the entire call to be recorded. When the recording is complete, a URL of the recorded audio is created and submitted as a GET or POST to the action URL.\n\nSimilar to the `<Gather>` element, a timeout value sets how much silence to allow before the recording ends, maxLength sets how long the recording may be, and the finishOnKey is used to set which keys will end the recording. By default, the action and method specify that `<Record>` should make a POST to the URL of the current InboundXML document.\n\n_Note: no more than than 5 recordings may be attached to a call_\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"action\",\n    \"0-1\": \"URL where some parameters specific to <Record> will be sent for further processing.\",\n    \"1-0\": \"method\",\n    \"1-1\": \"Method used to request the action URL. Default value is POST. Available values are POST and GET.\",\n    \"2-0\": \"timeout\",\n    \"2-1\": \"The number of seconds `<Record>` should wait during silence before ending. Default timeout value is 5 seconds. Valid value is integer greater than or equal to 0.\",\n    \"3-0\": \"finishOnKey\",\n    \"3-1\": \"The key a caller can press to end the `<Record>`. Default value is #. Allowed values are digits from 0 to 9, # or *.\",\n    \"4-0\": \"maxLength\",\n    \"4-1\": \"The maximum length in seconds a recording should be. Default Value: 3600. Allowed Value: integer greater than or equal to 0\",\n    \"5-0\": \"transcribe\",\n    \"5-1\": \"Boolean value specifying if the recording should be transcribed. Default Value: false. Allowed Value: true or false.\",\n    \"6-0\": \"transcribeQuality\",\n    \"6-1\": \"Specifies the quality used to process the transcription. Default Value: autoAllowed Value: auto or hybrid.\",\n    \"7-0\": \"transcribeCallback\",\n    \"7-1\": \"A URL some parameters regarding the transcription will be passed to once it is completed. Allowed Value: Valid URL.\",\n    \"8-0\": \"playBeep\",\n    \"8-1\": \"Boolean value specifying if a beep should be played when the recording begins. Default Value: false. Allowed Value: true or false.\",\n    \"9-0\": \"direction\",\n    \"9-1\": \"Specifies which stream of call audio to record. “in” to record the incoming caller audio, “out” to record the out going caller audio, or “both” to record all audio on the call. “out” audio can only be captured if an outbound Dial is performed during the call. “in” blocks any subsequent XML elements until the inbound audio recording is finished (via finishOnKey or timeout). Default Value: both. Allowed Value: in, out, both.\",\n    \"10-0\": \"fileFormat\",\n    \"10-1\": \"The recording file format. Can be mp3 or wav. Default is mp3. Default Value: mp3. Allowed Value: mp3 or wav\",\n    \"11-0\": \"background\",\n    \"11-1\": \"Begin recording the call while continuing the execution of any other present InboundXML in the background (true) or block the execution of subsequent InboundXML until the record element finishes (via finishOnKey or timeout). Note that the timeout, finishOnKey, and playBeep attributes have no effect when the background is set to true. Default Value: true. Allowed Value: true or false\",\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Description\",\n    \"12-0\": \"trimSilence\",\n    \"12-1\": \"Trims all silence from the beginning of the recording. Allowed values are \\\"true\\\" or \\\"false\\\" - any other value will default to \\\"false\\\".\"\n  },\n  \"cols\": 2,\n  \"rows\": 13\n}\n[/block]\nThe following recording specific parameters are also forwarded to the action URL.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"Digits\",\n    \"0-1\": \"The key used to end the recording.\",\n    \"1-0\": \"RecordingDuration\",\n    \"1-1\": \"The length of the recording in seconds.\",\n    \"2-0\": \"RecordingSid\",\n    \"2-1\": \"Unique recording identifier.\",\n    \"3-0\": \"RecordingUrl\",\n    \"3-1\": \"A URL leading to an audio file of the recording.\",\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Description\",\n    \"4-0\": \"RecordingInterference\",\n    \"4-1\": \"Status if we detected any interference during recording. Can be true or false.\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]\nThe following recording transcription specific parameters are also forwarded to the transcribeCallback URL.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"Duration\",\n    \"0-1\": \"The duration of the recording that was transcribed.\",\n    \"1-0\": \"Price\",\n    \"1-1\": \"The cost of the transcription.\",\n    \"2-0\": \"TranscriptionStatus\",\n    \"2-1\": \"The status of the transcription.\",\n    \"3-0\": \"TranscriptionSid\",\n    \"3-1\": \"An alphanumeric string identifying the transcription.\",\n    \"4-0\": \"RecordingUrl\",\n    \"4-1\": \"A URL leading to an audio file of the recording.\",\n    \"5-0\": \"TranscriptionUrl\",\n    \"5-1\": \"A URL containing the transcription.\",\n    \"6-0\": \"TranscriptionText\",\n    \"6-1\": \"The text of the transcription.\"\n  },\n  \"cols\": 2,\n  \"rows\": 7\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Nesting\",\n  \"body\": \"In addition to the default `<Response>` element, the `<Record>` element cannot be nested within any other verbs besides the default `<Response>` element. The `<Record>` element cannot nest any other elements within itself.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples\"\n}\n[/block]\nThe InboundXML below will prompt the caller for their name and then forward the recorded name to the action URL using the POST method.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<Response>\\n  <Say>Please state your name.</Say>\\n    <Record background=\\\"false\\\" action=\\\"http://webhookr.com/telapi-inboundxml-recording-action-example\\\" method=\\\"POST\\\" finishOnKey=\\\"#\\\"/>\\n</Response>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"record","type":"basic","title":"<Record>"}
The `<Record> ` element is used to record audio during a call. It can occur anywhere within an InboundXML document but will only begin recording once it has been reached. This means, it would have to be the first element after `<Response>` for the entire call to be recorded. When the recording is complete, a URL of the recorded audio is created and submitted as a GET or POST to the action URL. Similar to the `<Gather>` element, a timeout value sets how much silence to allow before the recording ends, maxLength sets how long the recording may be, and the finishOnKey is used to set which keys will end the recording. By default, the action and method specify that `<Record>` should make a POST to the URL of the current InboundXML document. _Note: no more than than 5 recordings may be attached to a call_ [block:parameters] { "data": { "0-0": "action", "0-1": "URL where some parameters specific to <Record> will be sent for further processing.", "1-0": "method", "1-1": "Method used to request the action URL. Default value is POST. Available values are POST and GET.", "2-0": "timeout", "2-1": "The number of seconds `<Record>` should wait during silence before ending. Default timeout value is 5 seconds. Valid value is integer greater than or equal to 0.", "3-0": "finishOnKey", "3-1": "The key a caller can press to end the `<Record>`. Default value is #. Allowed values are digits from 0 to 9, # or *.", "4-0": "maxLength", "4-1": "The maximum length in seconds a recording should be. Default Value: 3600. Allowed Value: integer greater than or equal to 0", "5-0": "transcribe", "5-1": "Boolean value specifying if the recording should be transcribed. Default Value: false. Allowed Value: true or false.", "6-0": "transcribeQuality", "6-1": "Specifies the quality used to process the transcription. Default Value: autoAllowed Value: auto or hybrid.", "7-0": "transcribeCallback", "7-1": "A URL some parameters regarding the transcription will be passed to once it is completed. Allowed Value: Valid URL.", "8-0": "playBeep", "8-1": "Boolean value specifying if a beep should be played when the recording begins. Default Value: false. Allowed Value: true or false.", "9-0": "direction", "9-1": "Specifies which stream of call audio to record. “in” to record the incoming caller audio, “out” to record the out going caller audio, or “both” to record all audio on the call. “out” audio can only be captured if an outbound Dial is performed during the call. “in” blocks any subsequent XML elements until the inbound audio recording is finished (via finishOnKey or timeout). Default Value: both. Allowed Value: in, out, both.", "10-0": "fileFormat", "10-1": "The recording file format. Can be mp3 or wav. Default is mp3. Default Value: mp3. Allowed Value: mp3 or wav", "11-0": "background", "11-1": "Begin recording the call while continuing the execution of any other present InboundXML in the background (true) or block the execution of subsequent InboundXML until the record element finishes (via finishOnKey or timeout). Note that the timeout, finishOnKey, and playBeep attributes have no effect when the background is set to true. Default Value: true. Allowed Value: true or false", "h-0": "Attribute", "h-1": "Description", "12-0": "trimSilence", "12-1": "Trims all silence from the beginning of the recording. Allowed values are \"true\" or \"false\" - any other value will default to \"false\"." }, "cols": 2, "rows": 13 } [/block] The following recording specific parameters are also forwarded to the action URL. [block:parameters] { "data": { "0-0": "Digits", "0-1": "The key used to end the recording.", "1-0": "RecordingDuration", "1-1": "The length of the recording in seconds.", "2-0": "RecordingSid", "2-1": "Unique recording identifier.", "3-0": "RecordingUrl", "3-1": "A URL leading to an audio file of the recording.", "h-0": "Attribute", "h-1": "Description", "4-0": "RecordingInterference", "4-1": "Status if we detected any interference during recording. Can be true or false." }, "cols": 2, "rows": 5 } [/block] The following recording transcription specific parameters are also forwarded to the transcribeCallback URL. [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "Duration", "0-1": "The duration of the recording that was transcribed.", "1-0": "Price", "1-1": "The cost of the transcription.", "2-0": "TranscriptionStatus", "2-1": "The status of the transcription.", "3-0": "TranscriptionSid", "3-1": "An alphanumeric string identifying the transcription.", "4-0": "RecordingUrl", "4-1": "A URL leading to an audio file of the recording.", "5-0": "TranscriptionUrl", "5-1": "A URL containing the transcription.", "6-0": "TranscriptionText", "6-1": "The text of the transcription." }, "cols": 2, "rows": 7 } [/block] [block:callout] { "type": "info", "title": "Nesting", "body": "In addition to the default `<Response>` element, the `<Record>` element cannot be nested within any other verbs besides the default `<Response>` element. The `<Record>` element cannot nest any other elements within itself." } [/block] [block:api-header] { "type": "basic", "title": "Examples" } [/block] The InboundXML below will prompt the caller for their name and then forward the recorded name to the action URL using the POST method. [block:code] { "codes": [ { "code": "<Response>\n <Say>Please state your name.</Say>\n <Record background=\"false\" action=\"http://webhookr.com/telapi-inboundxml-recording-action-example\" method=\"POST\" finishOnKey=\"#\"/>\n</Response>", "language": "xml" } ] } [/block]