File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed
voice/user-input-dtmf-slim Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change 66
77$ app = new \Slim \App ;
88
9- $ app ->add (function (Request $ request , Response $ response , $ next ) {
10- // Nexmo may send a GET or a POST request, depending on your account
11- // settings. Reject anything that isn't a GET/POST
12- if (!in_array ($ request ->getMethod (), ['GET ' , 'POST ' ])) {
13- return $ response ->withStatus (404 );
14- }
15-
16- return $ next ($ request , $ response );
17- });
18-
19- $ app ->any ('/webhooks/answer ' , function (Request $ request , Response $ response ) {
9+ $ app ->get ('/webhooks/answer ' , function (Request $ request , Response $ response ) {
2010 $ uri = $ request ->getUri ();
2111 $ ncco = [
2212 [
3424 return $ response ->withJson ($ ncco );
3525});
3626
37- $ app ->any ('/webhooks/dtmf ' , function (Request $ request , Response $ response ) {
27+ $ app ->post ('/webhooks/dtmf ' , function (Request $ request , Response $ response ) {
3828 $ params = $ request ->getParsedBody ();
3929
40- // Fall back to reading the query string if the body is empty
41- if (!isset ($ params ['dtmf ' ])) {
42- $ params = $ request ->getQueryParams ();
43- }
44-
4530 $ ncco = [
4631 [
4732 'action ' => 'talk ' ,
You can’t perform that action at this time.
0 commit comments