On Fri, 2007-02-23 at 00:25 +0100, Sune Kloppenborg Jeppesen wrote:
> On Thursday 22 February 2007 23:01, Norbert Zawodsky wrote:
> > This sounds interesting. If it's not too complicated for you ....
> This should get you going:
> 
> in extensions.conf:
> [macro-F_Toggle_status] ; $ARG1 db family $ARG2 db key $ARG3 Device to change 
> status
>       
> ;http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+BristuffDevstate
> 
>         exten => s,1,Answer()
>       exten => s,n,Set(status=${DB(${ARG1}/${ARG2})})
>       exten => s,n,GotoIf($["${status}" = "closed"]?opening|1:closing|1)
>       exten => opening,1,Set(status=open)
>       exten => opening,n,Set(DB(${ARG1}/${ARG2})=${status})
>       exten => opening,n,DevState(${ARG3},2)
>       exten => opening,n,Hangup()
>       exten => closing,1,Set(status=closed)
>       exten => closing,n,Set(DB(${ARG1}/${ARG2})=${status})
>       exten => closing,n,DevState(${ARG3},0)
>       exten => closing,n,Hangup()
> 
> Then using the value ARG3 from above:
> 
> [hint]
>       exten => _${ARG3},hint,DS/${ARG3}
> 
> Remember to substitute the actual variables as you can't use variables with 
> hints.

I would also insert here, that using variables in an extension name
declaration, is highly unwise!


> 
> Otherwise check the URL above for more info.
> 
> HTH
> 
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users

_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

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

Reply via email to