Set the dnd status from perl script

Hello folks

We have Linksys SPA962 phones. They work fine except that when a user presses the DND button on the phone, the Asterisk server does not get any message that the extension has been set to DND.

To fix this we are looking for a “work around” solution. We are planning on using a perl script that can lookup the DND settings on the phones and then execute a macro on the asterisk server that can set the status on the extension to DND and in FOP2 as well.

The first part is easy to do. It is the second bit that we are wondering about.

Will it be easier to just have the perl script run "asterisk -r " or have the perl script update the varios databases and conf files?

In any case our questions is kinda “what commands and variables to put where”? How do we run macros in Asterisk from a perl script?


Yes, we are newbies on the Asterisk server :wink:

had to telnet to the manager and run following command:

Action: UserEvent
UserEvent: FOP2ASTDB
Family: fop2state
Channel: SIP/nnn
Value: Do not Disturb

Case closed

It was so easy. all we had to do was to put these two commands behind asterisk to set DND:
database put fop2state SIP/nnn "Do not Disturb"
database put DND nnn YES

To remove the DND status we had to put these:
database del fop2state SIP/nnn
database Del DND nnn

Now we only have to trigger the user event so that it reflects on the fop2 web page. Anyone?

1 Like