[asterisk-users] Hangup after n seconds using originate ?

Danny Nicholas danny at debsinc.com
Thu Apr 22 15:56:43 CDT 2010


Here is how I do it, Mike
-- Perl Code --
  my $phone_number=4918802;
            my $testfile = "/tmp/testin_$$.wav";
            unlink $testfile;
            my %resp = $astman->sendcommand(  Action => 'Originate',
                                              Channel =>
"DAHDI/$key/w$phone_number",
                                              Variable => "ARG1=$testfile",
                                              Exten => 'SIP/170',
                                              Context => 'testit',
                                              ApplicationID => 1,
                                              priority => 1,
                                              Number => $phone_number
                                          );

Context 
[testit]
exten => s,1,Answer(1)
exten => s,n,Progress()
exten => s,n,SetMusicOnHold(default)
exten => s,n,Waitexten(5,m)
exten => s,n,Verbose(record ${ARG1})
exten => s,n,record(${ARG1}|0|10|s)
exten => s,n,Waitexten(5,m)
exten => s,n,Goto(end-call|s|1)

Context 2
[end-call]
exten => s,1,Verbose(details - time ${DIALEDTIME} time2 ${ANSWEREDTIME}
status ${DIALSTATUS})
exten => s,n,AGI(clearorder.agi|${ABA}|${CHANNEL(language)})
exten => s,n,GotoIf($["${HANGUPCAUSE}" = "0"]?end-call|h|1)
exten => s,n,playback(vm-goodbye|noanswer)
exten => h,1,Hangup(${HANGUP_CAUSE})

This snippet calls 205-491-8802 (Telco Test line) and records 10 seconds of
tone into a file, then hangs up.

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of
mancyborg at gmail.com
Sent: Thursday, April 22, 2010 3:32 PM
To: asterisk-users at lists.digium.com
Subject: Re: [asterisk-users] Hangup after n seconds using originate ?

On Thu, 22 Apr 2010 15:58:34 -0400
Ryan Bullock <rrb3942 at gmail.com> wrote:

> Have you tried setting 'Variable: TIMEOUT(absolute)*=*60' or something
like
> that when creating the originate command?
> 
> I don't know if it works, but it is worth a shot.

Hi Ryan, thanks for your comment.

Unfortunately the 'Variable' parameter is used to push data between the
originating script and the dialplan, not commands.
Example:
Variable: var1=23|var2=24|var3=25

Additionally, this data can be used in the dialplan only when the call gets
answered or when it fails.
I can't find a way to inject the parameter DURING (or before) the call.


Thank you very much for supporting,
Mike

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list