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

Jim Dickenson dickenson at cfmc.com
Thu Apr 22 15:51:35 CDT 2010


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:4151111111:5412222222:30 at 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:dickenson at cfmc.com

CfMC
http://www.cfmc.com/



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

> 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