Issue: Agent Automatically Logs Out After Executing Record Dialplan

I have created a Record button in the agent panel. When a user clicks the button, the following Asterisk dialplan is executed:

exten => *3001,1,NoOp(Record Video)
same => n,Answer()
same => n,Record(/usr/ictbroadcast/resources/video_test.wav,0,30,k)
same => n,Hangup()

Problem:

After some time, my agent automatically logs out. I am not sure what is causing this issue.
Asterisk Logs:

== Using SIP VIDEO CoS mark 6
== Using SIP RTP CoS mark 5

0x7feff41c3410 – Strict RTP learning after remote address set to: 182.191.65.62:55143
– Executing [*3001@ib_user_1:1] NoOp(“SIP/web_1213-0000004c”, “Record Video”) in new stack
– Executing [*3001@ib_user_1:2] Answer(“SIP/web_1213-0000004c”, “”) in new stack
0x7feff41c3410 – Strict RTP learning after ICE completion
0x7feff41c3410 – Strict RTP learning after remote address set to: 182.191.65.62:55143
0x7feff41018b0 – Strict RTP learning after ICE completion
0x7feff41018b0 – Strict RTP learning after remote address set to: 182.191.65.62:49874
– Executing [*3001@ib_user_1:3] Record(“SIP/web_1213-0000004c”, “/usr/ictbroadcast/resources/video_test.wav,0,30,k”) in new stack
– <SIP/web_1213-0000004c> Playing ‘beep.alaw’ (language ‘en’)
0x7feff41018b0 – Strict RTP switching to RTP target address 182.191.65.62:49874 as source
– Got SIP INFO response 415 “Unsupported Media Type” back from host ‘182.191.65.62:5060’

[Feb 13 06:56:07] NOTICE[510308]: chan_sip.c:29058 handle_request_register: Registration from ‘sip:5098@96.30.194.230’ failed for ‘2.57.121.218:62293’ - Wrong password

0x7feff41018b0 – Strict RTP learning complete - Locking on source address 182.191.65.62:49874
reach-sp*CLI>

[Feb 13 06:56:11] NOTICE[510308]: chan_sip.c:29058 handle_request_register: Registration from ‘sip:5099@96.30.194.230’ failed for ‘2.57.121.218:49860’ - Wrong password
– Executing [*3001@ib_user_1:4] Hangup(“SIP/web_1213-0000004c”, “”) in new stack
== Spawn extension (ib_user_1, *3001, 4) exited non-zero on ‘SIP/web_1213-0000004c’

Observations:

The agent logs out automatically after executing the Record() function.
There is a SIP INFO response 415 "Unsupported Media Type" error.

Questions:

Could the unsupported media type (415 error) be causing the agent to log out?
Is the Record() application in Asterisk affecting SIP session stability?
Could strict RTP learning or incorrect codec negotiation be related to this issue?
Do the registration failures indicate an issue with agent authentication?

I would appreciate any insights on diagnosing and resolving this issue.

You have instructed Record to record for a maximum of 30 seconds. After 30 seconds the channel would exit Record, and go to Hangup and be hung up. Your output does not contain a timestamp, but that is likely what is happening.

I want to enable call recording in Asterisk such that recording starts when the call is connected and stops when the call is terminated
please advise on the necessary updates and configurations required to achieve this functionality?

Per the documentation[1] if a maximum is not specified or it is set to 0 then there is no maximum duration.

[1] Record - Asterisk Documentation

I need to capture the agent’s screen when a call is connected and stop the recording when the call is disconnected.

Implementation:
Currently, I have the following configuration to start recording when the call is connected:

exten => *3001,1,NoOp(Record Video)
same => n,Record(/usr/ictbroadcast/resources/video_test.h264,0,0,k)

Questions:

Is this configuration correct for initiating the recording?
any additional configuration required for h264 codec?
What additional steps or configurations are required to stop the recording upon call hangup?
Can anyone provide guidance on the best approach to achieve this?

Any assistance would be appreciated.

I don’t believe you can record video.

Record is synchronous. The channel cannot be doing anything else.

There is nothing after the Record in the dialplan, so once the recording is complete, the calling channel will be hung up.

To record audio, you would normally use MixMonitor(), which is asynchronous. This should be followed by the dialplan that actully implements the call.

Video in Asterisk when it comes to recording and other aspects is extremely barebones, if you use it you are generally on your own.

thatnks for your response
How can we implement screen capturing to monitor an agent’s activity, ensuring that only the agent’s screen is captured while call is connected?
Any assistance would be appreciated

You would really want to do that on the software on the agent side…

yes, screen capture process should be handled on the agent’s side