Record call and automatic hungup


(Tunisie) #1

Hi i have a question if same one can help me.
I have inbound did come to extension.
My question is i want for exemple when same one call my did and after my agent with extension answer him.
I want first the call be recording and after 60sec asterisk hungup the call automatic and then asterisk heard the recording to only the caller.
Thank u i’am waiting any idea or suggestion


#2

I would write a custom context that sets an ‘absolute timeout’ of n seconds on the channel, then answers the call and sends it to wherever.


(Tunisie) #3

Please i appreciate your help.if you can write me this custom context


(Tunisie) #4

Please i appreciate your help.if you can write me this custom context


#5

No, but i’ll point you in the right direction :slight_smile:

https://wiki.freepbx.org/display/FDT/FreePBX+Dialplan+Customization

( The bit about incoming calls is what you need)

Read

and add 'Set(TIMEOUT(absolute)=seconds)'appropriately

Set(TIMEOUT(absolute)=seconds)


(Tunisie) #6

Thank for you anwser
Set(TIMEOUT(absolute)=seconds) this i have understand it mean i can set the time with second for automatic call termination.
But how can set the recordings with dialplan from the start of call untill the call termination and then play this recordings only to the caller and let him listen ?


#7

Those are all more general questions and all well covered in the same wiki.


(Tunisie) #8

thank you again
same thing like that it is correct ?

[test]
exten => 100,1,Answer()
exten => 100,n,Set(TIMEOUT(absolute)=60)
exten => 100,n,Dial(SIP/1000)
exten => 100,n,Record(/tmp/myrecord:gsm|5|60|skip)
exten => 100,n,Wait(3)
exten => 100,n,Playback(/tmp/myrecord)
exten => 100,n,Hangup()


(Dave Burgess) #9

Do what we’d have to do. Implement it and try it and see what happens.


(Tunisie) #10

ok i will try and i will post my log here


(Tunisie) #11

not working

-12-17 14:58:33] WARNING[4204]: pbx.c:8619 ast_context_verify_includes: Context ‘app-cf-toggle’ tries to include nonexistent context ‘app-cf-toggle-custom’
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [100@test:1] Answer(“SIP/1000-00000003”, “”) in new stack
– Executing [100@test:2] Set(“SIP/1000-00000003”, “TIMEOUT(absolute)=20”) in new stack
– Channel will hangup at 2020-12-17 14:59:03.203 UTC.
– Executing [100@test:3] Dial(“SIP/1000-00000003”, “SIP/2000”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/2000
– Incoming call: Got SIP response 405 “Method Not Allowed” back from 197.15.208.78:63306
– SIP/2000-00000004 is ringing
– SIP/2000-00000004 is ringing
– SIP/2000-00000004 answered SIP/1000-00000003
– Channel SIP/2000-00000004 joined ‘simple_bridge’ basic-bridge <29080453-338a-4506-a610-3ed9470f8c4c>
– Channel SIP/1000-00000003 joined ‘simple_bridge’ basic-bridge <29080453-338a-4506-a610-3ed9470f8c4c>

it just answer then dial extension and take timeout then hungup but notthing about record or playback

any help please


(Tunisie) #12

i have try this too but when i try to do a test call from extension to other and when i hungup from any extension nothing happen
no playback i listen after other side of extension when i hungup in second softphone.

exten => 1000,n,MixMonitor(${UNIQUEID}.wav,bi(mixmvar))

exten => 1000,n,Dial(SIP/2000,L(10000:2000:5000))

exten => 1000,n,StopMixMonitor(${mixmvar})

exten => 100,n,Wait(3)

exten => 1000,n,Playback(/var/spool/asterisk/monitor/${UNIQUEID}.wav)

exten => 1000,n,Hangup

Note x,y,z option in L option is used for disconnection of the call.

###############################################################

Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [100@test:1] MixMonitor(“SIP/1000-00000020”, “1608221629.32.wav,bi(mixmvar)”) in new stack
– Executing [100@test:2] Dial(“SIP/1000-00000020”, “SIP/2000,L(10000:2000:5000)”) in new stack
== Begin MixMonitor Recording SIP/1000-00000020
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/2000
[2020-12-17 16:13:49] WARNING[8446][C-00000019]: app_dial.c:2809 dial_exec_full: Invalid timeout specified: ‘L(10000:2000:5000)’. Setting timeout to infinite
– SIP/2000-00000021 is ringing
– SIP/2000-00000021 is ringing
– SIP/2000-00000021 answered SIP/1000-00000020
– Channel SIP/2000-00000021 joined ‘simple_bridge’ basic-bridge <742a5bce-e7ac-4f3a-9c2d-7c9b63e362f9>
– Channel SIP/1000-00000020 joined ‘simple_bridge’ basic-bridge <742a5bce-e7ac-4f3a-9c2d-7c9b63e362f9>
– Channel SIP/2000-00000021 left ‘simple_bridge’ basic-bridge <742a5bce-e7ac-4f3a-9c2d-7c9b63e362f9>
– Channel SIP/1000-00000020 left ‘simple_bridge’ basic-bridge <742a5bce-e7ac-4f3a-9c2d-7c9b63e362f9>
== Spawn extension (test, 100, 2) exited non-zero on ‘SIP/1000-00000020’
== MixMonitor close filestream (mixed)
== End MixMonitor Recording SIP/1000-00000020