Beginner: How can a script be called after a calling user hangup? What's wrong with this: [incoming] exten => s,1,Playback,welcome exten => s,2,Record,msgfile:gsm exten => h,1,Goto(callscript,1,1) [callscript] exten => 1,1,Wait,5 exten => 1,2,System("SomeScript") Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20030904/e0eac7fe/attachment.htm
Hi Frank, why you so complicated ? Try following: [incoming] exten => s,1,Playback,welcome exten => s,2,Record,msgfile:gsm exten => h,1,System(/home/frank/callscript.pl) as sample ... :-) Regards, Thomas. -----Urspr?ngliche Nachricht----- Von: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com]Im Auftrag von Frank N. Gesendet: Donnerstag, 4. September 2003 14:54 An: asterisk-users@lists.digium.com Betreff: [Asterisk-Users] Call script after hangup Beginner: How can a script be called after a calling user hangup? What's wrong with this: [incoming] exten => s,1,Playback,welcome exten => s,2,Record,msgfile:gsm exten => h,1,Goto(callscript,1,1) [callscript] exten => 1,1,Wait,5 exten => 1,2,System("SomeScript") Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20030904/2ea3d760/attachment.htm
Thomas, your suggestion does work better. However, I doesn't solve my problem. Here is callscript.pl: #!/usr/bin/perl print "waiting...\n"; sleep 5; `cp /usr/src/asterisk/sample.call /var/spool/asterisk/outgoing`; print "call created\n"; The problem is the incoming and outgoing calls are made on the same channel (Zap/1). I believe the porblem is that, since the incoming call is not "closed" before the outgoing call is created, the outgoing call does not work. I was hoping the delay would solve this problem... but obviously it doesn't. Do you have any suggestions? Thank you. -----Original Message----- From: Thomas Haeger [mailto:thomas.haeger@beronet.com] Sent: 4 septembre, 2003 09:42 To: asterisk-users@lists.digium.com Subject: AW: [Asterisk-Users] Call script after hangup Hi Frank, why you so complicated ? Try following: [incoming] exten => s,1,Playback,welcome exten => s,2,Record,msgfile:gsm exten => h,1,System(/home/frank/callscript.pl) as sample ... :-) Regards, Thomas. -----Urspr?ngliche Nachricht----- Von: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com]Im Auftrag von Frank N. Gesendet: Donnerstag, 4. September 2003 14:54 An: asterisk-users@lists.digium.com Betreff: [Asterisk-Users] Call script after hangup Beginner: How can a script be called after a calling user hangup? What's wrong with this: [incoming] exten => s,1,Playback,welcome exten => s,2,Record,msgfile:gsm exten => h,1,Goto(callscript,1,1) [callscript] exten => 1,1,Wait,5 exten => 1,2,System("SomeScript") Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20030904/1dd352ab/attachment.htm
That makes perfect sense. It works perfectly. Thanks to you and Matteo who suggested the same solution. -----Original Message----- From: Alastair Maw [mailto:asterisk@almaw.com] Sent: 4 septembre, 2003 11:28 To: asterisk-users@lists.digium.com Subject: Re: [Asterisk-Users] Call script after hangup Frank N. wrote:> I believe the porblem is that, since the incoming call is not "closed" > before the outgoing call is created, the outgoing call does not work. > I was hoping the delay would solve this problem... but obviously itdoesn't. No - it still won't relinquish the call until the hangup handler has completed. What you need to do is to have the AGI script return, such that the call exits. Then five seconds later, copy the file. You could do this by setting up a BASH script which executed the Perl in the background. I.e. #!/bin/sh /path/to/script/foo.pl & Make sense? -- Alastair Maw <al.maw@mxtelecom.com> MX Telecom - Systems Analyst http://www.mxtelecom.com _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users