Extensions_custom.conf send event to VMS

I am attempting to send a trigger to a VMS software to start and stop recording on a cameras and create a clip for the duration of the call. The first two steps of this works great; Call is placed, DIAL CURL event (Line 13) tells the camera to start recording, HANGUP CURL event (Line 36, very bottom) tells the camera to stop recording.

The last step of creating a clip of the recorded event after the call is where I am having trouble. The CURL event requires a “start” and “end” timestamp. I have tried to send the of the Dial and Hang-up events to a DB and create a variable to be set in the CLIP CURL events (Line 39) but with no success.

Just looking to get some more eyes on this and bounce some ideas around.


;Set Pseudo extension path
exten => 99,1,Set(Ext01=1001)
   ;Send event to log file
   same => n,Verbose("*** Recording On ***")
   ;Answer incoming call
   same => n,Answer
   same => n,NoOp(${SHELL(curl -X PUT "https://web.cloud-vms.com/api/v4/channel/" -H "accept: application/json" -H "Authorization: Acc eyJjYW1pZCI6IDUsICJjbW5ncmlkIjogNSwgImFjY2VzcyI6ICJhbGwiLCAidG9rZW4iOiAic2hhcmUuZXlKemFTSTZJREV6ZlEuNjQzZDU5TlBBVWNPcjZvcWlHNHFSdHd5b1pOenpFIiwgImFwaSI6ICJ3ZWIuY29kZWJsdWUuY29kZWJsdWUuY2xvdWQtdm1zLmNvbSIsICJjYW0iOiAiY2FtLmNvZGVibHVlLmNvZGVibHVlLmNsb3VkLXZtcy5jb20ifQ==" -H "Content-Type: application/json" -d "{ \"recording\": true, \"streaming\": true, \"rec_mode\": \"on\"}")})
   ;Transfer Call to destination or ring group
   ;timeout (seconds)
   ;g (continue script after)
   ;U (if call is answered, run PostAnswered below)
   same => n,Dial(local/${Ext01}@from-internal,300,gU(PostAnswered^1))
   ;Send event to log file
   same => n,Verbose("*** No Answer Recording Off ***")
   same => n,NoOp(${SHELL(curl -X PUT "https://web.cloud-vms.com/api/v4/channel/" -H "accept: application/json" -H "Authorization: Acc eyJjYW1pZCI6IDUsICJjbW5ncmlkIjogNSwgImFjY2VzcyI6ICJhbGwiLCAidG9rZW4iOiAic2hhcmUuZXlKemFTSTZJREV6ZlEuNjQ0hoTlBBVWNPcjZvcWlHNHFSdHd5b1pOenpFIiwgImFwaSI6ICJ3ZWIuY29kZWJsdWUuY29kZWJsdWUuY2xvdWQtdm1zLmNvbSIsICJjYW0iOiAiY2FtLmNvZGVibHVlLmNvZGVibHVlLmNsb3VkLXZtcy5jb20ifQ==" -H "Content-Type: application/json" -d "{ \"recording\": false, \"streaming\": false, \"rec_mode\": \"off\"}")})
   ;Send CREATE CLIP to VMS 
   same => n,NoOp(${SHELL(curl -X POST "https://web.cloud-vms.com/api/v4/clips/" -H "accept: application/json" -H "Authorization: Acc eyJjYW1pZCI6IDUsICJjbW5ncmlkIjogNSwgImFjY2VzcyI6ICJhbGwiLCAidG9rZW4iOiAic2hhcmUuZXlKemFTSTZJREV6ZlEuNjQzZDU5OWF0YmMxZmFiMDAud0hoTlBBVWNPcjZvcWlHNHFSdHd5b1pOenpFIiwgImFwaSI6ICJ3ZWIuY29kZWJsWQtdm1zLmNvbSIsICJjYW0iOiAiY2FtLmNvZGVibHVlLmNvZGVibHVlLmNsb3VkLXZtcy5jb20ifQ==" -H "Content-Type: application/json" -d "{ \"start\": \"2020-04-04T03:39:27\", \"end\": \"2020-04-04T03:39:47\", \"wait_for_data\": false, \"event_time\": null, \"group\": \"Lessons\", \"title\": \"Intro\"}")})
   ;HANGUP and exit script
   same => n,Hangup()
 exten => s,1,g(ARG=${SHELL(curl -X PUT "https://web.cloud-vms.com/api/v4/channel/" -H "accept: application/json" -H "Authorization: Acc eyJjYW1pZCI6IDUsICJjbW5ncmlkIjogNSwgImFjY2VzcyI6ICJhbGwiLCAidG9rZW4iOiAic2hhcmUuZXlKemFTSTZJREV6ZlEuNjQzZDU5OPcjZvcWlHNHFSdHd5b1pOenpFIiwgImFwaSI6ICJ3ZWIuY29kZWJsdWUuY29kZWJsdWUuY2xvdWQtdm1zLmNvbSIsICJjYW0iOiAiY2FtLmNvZGVibHVlLmNvZGVibHVlLmNsb3VkLXZtcy5jb20ifQ==" -H "Content-Type: application/json" -d "{ \"recording\": false, \"streaming\": false, \"rec_mode\": \"off\"}")})
   ;Send CREATE CLIP to VMS 
   same => n,NoOp(${SHELL(curl -X POST "https://web.cloud-vms.com/api/v4/clips/" -H "accept: application/json" -H "Authorization: Acc eyJjYW1pZCI6IDUsICJjbW5ncmlkIjogNSwgImFjY2VzcyI6ICJhbGwiLCAidG9rZW4iOiAic2hhcmUuZXlKemFTSTZJREV6ZlEuNjQzZDhoTlBBVWNPcjZvcWlHNHFSdHd5b1pOenpFIiwgImFwaSI6ICJ3ZWIuY29kZWJsdWUuY29kZWJsdWUuY2xvdWQtdm1zLmNvbSIsICJjYW0iOiAiY2FtLmNvZGVibHVlLmNvZGVibHVlLmNsb3VkLXZtcy5jb20ifQ==" -H "Content-Type: application/json" -d "{ \"start\": \"2020-04-04T03:39:27\", \"end\": \"2020-04-04T03:39:47\", \"wait_for_data\": false, \"event_time\": null, \"group\": \"Lessons\", \"title\": \"Intro\"}")})
   same => n,Return()

Asterisk doesn’t know about extension_custom.conf, unless you tell it about it, and you haven’t indicated that you have done that. Similarly for from-internal-addtional-custom. As for another current thread, I would speculate you are using FreePBX, but this is not the place of knowledge of the arcane details of FreePBX.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.