[Asterisk-Users] Call script after hangup

Brancaleoni Matteo mbrancaleoni at espia.it
Thu Sep 4 10:22:56 MST 2003


is to say... I don't know if you can write a sort of
exten => h,1,System("/home/frank/callscript.pl &")

but surely you can do
exten => h,1,System(/home/frank/callscript.sh)
where callscript.sh is

#!/bin/sh
/home/frank/callscript.pl &

Probably (and surely I think) there's a better method to fork
into the bg directly from perl... but I'm not a perl guru ;(

matteo.


Il gio, 2003-09-04 alle 19:17, Brancaleoni Matteo ha scritto:
> a stupid idea is... why don't lauch the script
> in the background ? so asterisk could close
> the chan (since lauching it into the bg * gets
> the control immediately back) .
> 
> just my 2 cents.
> 
> Matteo.
> 
> 
> Il gio, 2003-09-04 alle 16:29, Frank N. ha scritto:
> > 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 at beronet.com] 
> >         Sent: 4 septembre, 2003 09:42
> >         To: asterisk-users at 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 at lists.digium.com
> >                 [mailto:asterisk-users-admin at lists.digium.com]Im
> >                 Auftrag von Frank N.
> >                 Gesendet: Donnerstag, 4. September 2003 14:54
> >                 An: asterisk-users at 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
-- 
Brancaleoni Matteo <mbrancaleoni at espia.it>
Espia - Emmegi Srl




More information about the asterisk-users mailing list