]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Ensure bridge record error responses validate
authorKinsey Moore <kmoore@digium.com>
Tue, 15 Oct 2013 20:02:08 +0000 (20:02 +0000)
committerKinsey Moore <kmoore@digium.com>
Tue, 15 Oct 2013 20:02:08 +0000 (20:02 +0000)
This adds the list of expected errors to the /bridges/{bridgeId}/record
ARI documentation so that outbound 4xx errors validate properly.
Previously, this would result in a response validation failure.

(closes issue ASTERISK-22627)
Reported by: Joshua Colp

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@401018 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_ari_bridges.c
rest-api/api-docs/bridges.json

index d3b3a649d20469717b1c973d74758bf8a0cb4280..c0b8b0d5831dd1435e99a7586387c1a38542d4b3 100644 (file)
@@ -742,6 +742,9 @@ static void ast_ari_record_bridge_cb(
                break;
        case 500: /* Internal Server Error */
        case 501: /* Not Implemented */
+       case 400: /* Recording name invalid */
+       case 404: /* Bridge not found */
+       case 409: /* Bridge not in Stasis application; Recording already in progress */
                is_valid = 1;
                break;
        default:
index 640cf4c5d531593740311bd5ef615a04ca2ac1e6..48e5696c5430f6a2241d3eb3f1d87bea98dfe078 100644 (file)
                                                                ]
                                                        }
                                                }
+                                       ],
+                                       "errorResponses": [
+                                               {
+                                                       "code": 400,
+                                                       "reason": "Recording name invalid"
+                                               },
+                                               {
+                                                       "code": 404,
+                                                       "reason": "Bridge not found"
+                                               },
+                                               {
+                                                       "code": 409,
+                                                       "reason": "Bridge not in Stasis application; Recording already in progress"
+                                               }
                                        ]
                                }
                        ]