Ensure bridge record error responses validate
authorKinsey Moore <kmoore@digium.com>
Tue, 15 Oct 2013 20:03:19 +0000 (20:03 +0000)
committerKinsey Moore <kmoore@digium.com>
Tue, 15 Oct 2013 20:03:19 +0000 (20:03 +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
........

Merged revisions 401018 from http://svn.asterisk.org/svn/asterisk/branches/12

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

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

index d3b3a64..c0b8b0d 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 640cf4c..48e5696 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"
+                                               }
                                        ]
                                }
                        ]