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.

Otherwise check the URL above for more info.

HTH

-- 
Sune Kloppenborg Jeppesen (Jaervosz)

Attachment: pgp2IM2Gthr4j.pgp
Description: PGP signature

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