RE: [Asterisk-Users] Call script after hangup

2003-09-05 Thread Frank N.
That makes perfect sense. It works perfectly.
Thanks to you and Matteo who suggested the same solution.


-Original Message-
From: Alastair Maw [mailto:[EMAIL PROTECTED]
Sent: 4 septembre, 2003 11:28
To: [EMAIL PROTECTED]
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 it
doesn'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 [EMAIL PROTECTED]
MX Telecom - Systems Analyst
http://www.mxtelecom.com
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users


[Asterisk-Users] Call script after hangup

2003-09-04 Thread Frank N.



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


AW: [Asterisk-Users] Call script after hangup

2003-09-04 Thread Thomas Haeger



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: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]Im Auftrag von Frank 
  N.Gesendet: Donnerstag, 4. September 2003 14:54An: 
  [EMAIL PROTECTED]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


RE: [Asterisk-Users] Call script after hangup

2003-09-04 Thread Frank N.






Thomas,
your 
suggestion does work better.
However, I doesn't solve my problem. Here is 
callscript.pl:

#!/usr/bin/perlprint "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:[EMAIL PROTECTED] Sent: 4 septembre, 2003 
  09:42To: [EMAIL PROTECTED]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: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]Im Auftrag von Frank 
N.Gesendet: Donnerstag, 4. September 2003 14:54An: 
    [EMAIL PROTECTED]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


RE: [Asterisk-Users] Call script after hangup

2003-09-04 Thread Dave Wilson



Hey 
guys,

I've 
been trying to do something similar. Basically I want to call a script with AGI 
every time a call is hungup, regardless of who hangs up. The purpose of which is 
to record call end time and duration in another app.

is 'h' 
a reserved extension number for capturing hangups?

TIA,
Dave

  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]On Behalf Of Thomas 
  HaegerSent: 04 September 2003 14:42To: 
  [EMAIL PROTECTED]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: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]Im Auftrag von Frank 
N.Gesendet: Donnerstag, 4. September 2003 14:54An: 
[EMAIL PROTECTED]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


Re: [Asterisk-Users] Call script after hangup

2003-09-04 Thread Alastair Maw
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 it doesn'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 [EMAIL PROTECTED]
MX Telecom - Systems Analyst
http://www.mxtelecom.com
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Call script after hangup

2003-09-04 Thread Brancaleoni Matteo
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:[EMAIL PROTECTED] 
 Sent: 4 septembre, 2003 09:42
 To: [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 Auftrag von Frank N.
 Gesendet: Donnerstag, 4. September 2003 14:54
 An: [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
Espia - Emmegi Srl

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Call script after hangup

2003-09-04 Thread Brancaleoni Matteo
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:[EMAIL PROTECTED] 
  Sent: 4 septembre, 2003 09:42
  To: [EMAIL PROTECTED]
  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: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED]
  Auftrag von Frank N.
  Gesendet: Donnerstag, 4. September 2003 14:54
  An: [EMAIL PROTECTED]
  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 [EMAIL PROTECTED]
Espia - Emmegi Srl

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users