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

2010-04-22 Thread mancyb...@gmail.com
Hi All,

I would like to know if you can confirm that, if using origination via AMI, as 
documented here:
http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+Originate
it is not possible to set the max duration of a call.

I mean: what you would do with the L (limit) parameter of the command Dial,
is not possible when originating.

As well as using the absolute timeout, as documented here:
http://www.asteriskguru.com/tutorials/timeoutabsolute_function.html
can't be done when originating.

Is this true ?

I'm using version 1.4.


Thanks for supporting,
have a nice day.
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


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

2010-04-22 Thread Ryan Bullock
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.
-- 
_
-- 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

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

2010-04-22 Thread mancyb...@gmail.com
On Thu, 22 Apr 2010 15:58:34 -0400
Ryan Bullock rrb3...@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


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

2010-04-22 Thread Jim Dickenson
One way to do what you want is to create an extension and then in your 
originate action use a local change with that extension.

Action: Originate
Channel: Local/allow_caller_id:415111:541222:3...@context
Exten: do_echo
Context: cfmc_cdi_private
Priority: 1
Variable: CfMC_ActionID=AllowCallerID
ActionID: AllowCallerID
Async: true


exten = _allow_caller_id.,1,Verbose(1,allow_caller_id gets ${EXTEN})
exten = _allow_caller_id.,n,Set(MyCallerID=${CUT(EXTEN,:,2)})
exten = _allow_caller_id.,n,GotoIf($[${LEN(${MyCallerID})}10]?NoCID)
exten = _allow_caller_id.,n,Set(CALLERID(num)=${MyCallerID})
exten = _allow_caller_id.,n(NoCID),Set(MyNumber=${CUT(EXTEN,:,3)})
exten = _allow_caller_id.,n,Set(MyTime=${CUT(EXTEN,:,4)})
exten = _allow_caller_id.,n,Verbose(1,${OutBoundDev} calling ${MyNumber} for 
${MyTime} seconds)
exten = _allow_caller_id.,n,Set(CALLERPRES()=allowed_not_screened)
exten = _allow_caller_id.,n,Dial${OutBoundDev}/${MyNumber},${MyTime},g)
exten = _allow_caller_id.,n,Verbose(1,${OutBoundDev} call just got status 
${DIALSTATUS})
exten = _allow_caller_id.,n,Hangup()

-- 
Jim Dickenson
mailto:dicken...@cfmc.com

CfMC
http://www.cfmc.com/



On Apr 22, 2010, at 1:31 PM, mancyb...@gmail.com wrote:

 On Thu, 22 Apr 2010 15:58:34 -0400
 Ryan Bullock rrb3...@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


-- 
_
-- 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


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

2010-04-22 Thread Danny Nicholas
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-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of
mancyb...@gmail.com
Sent: Thursday, April 22, 2010 3:32 PM
To: asterisk-users@lists.digium.com
Subject: Re: [asterisk-users] Hangup after n seconds using originate ?

On Thu, 22 Apr 2010 15:58:34 -0400
Ryan Bullock rrb3...@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


-- 
_
-- 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


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

2010-04-22 Thread mancyb...@gmail.com
Thanks for the comments, this did the trick :)


On Thu, 22 Apr 2010 13:51:35 -0700
Jim Dickenson dicken...@cfmc.com wrote:

 One way to do what you want is to create an extension and then in your 
 originate action use a local change with that extension.
 
 Action: Originate
 Channel: Local/allow_caller_id:415111:541222:3...@context
 Exten: do_echo
 Context: cfmc_cdi_private
 Priority: 1
 Variable: CfMC_ActionID=AllowCallerID
 ActionID: AllowCallerID
 Async: true
 
 
 exten = _allow_caller_id.,1,Verbose(1,allow_caller_id gets ${EXTEN})
 exten = _allow_caller_id.,n,Set(MyCallerID=${CUT(EXTEN,:,2)})
 exten = _allow_caller_id.,n,GotoIf($[${LEN(${MyCallerID})}10]?NoCID)
 exten = _allow_caller_id.,n,Set(CALLERID(num)=${MyCallerID})
 exten = _allow_caller_id.,n(NoCID),Set(MyNumber=${CUT(EXTEN,:,3)})
 exten = _allow_caller_id.,n,Set(MyTime=${CUT(EXTEN,:,4)})
 exten = _allow_caller_id.,n,Verbose(1,${OutBoundDev} calling ${MyNumber} for 
 ${MyTime} seconds)
 exten = _allow_caller_id.,n,Set(CALLERPRES()=allowed_not_screened)
 exten = _allow_caller_id.,n,Dial${OutBoundDev}/${MyNumber},${MyTime},g)
 exten = _allow_caller_id.,n,Verbose(1,${OutBoundDev} call just got status 
 ${DIALSTATUS})
 exten = _allow_caller_id.,n,Hangup()
 
 -- 
 Jim Dickenson
 mailto:dicken...@cfmc.com
 
 CfMC
 http://www.cfmc.com/
 
 
 
 On Apr 22, 2010, at 1:31 PM, mancyb...@gmail.com wrote:
 
  On Thu, 22 Apr 2010 15:58:34 -0400
  Ryan Bullock rrb3...@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
 
 
 -- 
 _
 -- 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

-- 
_
-- 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