[Asterisk-Users] Re: phone line "roaming"
Adam Goryachev
mailinglists at websitemanagers.com.au
Wed Sep 15 06:35:28 MST 2004
On Wed, 2004-09-15 at 22:37, Senad Jordanovic wrote:
> >>
> >> make a simple web interface.. where user logs in..
> >> interface tells a script on * server about users
> >> location/extension/device. then your script will re-create TFTP
> >> files, sends
> >> reboot to 7940/7792 and you are done...
> >
> > Seems like overkill when you can just use the agent support in
> > asterisk.
>
> yes, of course if these users are to "belong" to a queue...
> what if they are NOT...?
>
>
> another way to do it will be:
> configure an AA, ask users to enter their PIN, and then send system call
> to re-configure the phones.
There is a much simpler solution, which I hacked together briefly, and
then discarded because I didn't really need it (and there were some
discrepancies in the zap driver that I didn't have time to track down).
Anyway, for your purposes, this is really quite simple.
extensions.conf:
[macro-stdexten]
exten => s,1,DBget(dnd=DND/${ARG1})
exten => s,2,Goto(s|20)
exten => s,102,Goto(s|3)
exten => s,3,DBget(chan=extensions/${ARG1})
; extension could not be found, drop to voicemail
exten => s,104,Voicemail(u${ARG1})
exten => s,4,Dial,${chan}|20|rtT
exten => s,5,AbsoluteTimeout(90)
exten => s,6,Voicemail(u${ARG1})
exten => s,7,Hangup
exten => s,105,AbsoluteTimeout(90)
exten => s,106,Voicemail(b${ARG1})
exten => s,107,Hangup
; DND is on, so go to voicemail and hangup
exten => s,20,AbsoluteTimeout(90)
exten => s,21,Voicemail(u${ARG1})
exten => s,22,Hangup
So, take the extension they want to dial, look in the astdb for the
entry extensions/${EXT} and then dial using that value.
This way, I can (manually) update the database to decide where an
extension points to.
It is a simple matter to add some dialplan extension for login/logout,
basically I was using an AGI which did this:
Request extension number
Request password
Check extension/password in voicemail.conf, if no match, repeat
If match, delete (or add) the astdb value for the current channel and
the provided extension.
If this is a hot-desk type situation, then each time a user sits
down/leaves, they need to login/out. If it is just an occassional thing,
where sometimes a person moves office, then you could just do it
manually like I do...
For those that are interested, I was also trying to create DB flags
based on the channel name which would show that 'this' channel is
permitted to make outgoing calls. Then my outgoing calls macro would
check the variable before placing the call. This didn't work because
sometimes the CHANNEL variable would be Zap/126-1 and sometimes it would
be ZAP/126-1, and there didn't seem to be any pattern to this. Like I
said, I might be wrong, things might have changed since then, etc, I
never had a chance to really look into it, I just removed it.
I was intending on extending this to regularly call the extension and
request their password, if it wasn't supplied, then I would remove their
dialout privilege. (Check once per hour, if wrong password, or no
answer, or whatever, then retry each 5 minutes for 3 attempts).
Or something, I never got that far in the implementation, it might be
too much hassle/nuisance for people to keep calling them. Thinking now,
perhaps a timeout, no dialout for more than one hour => confirmation
call.
Regards,
Adam
More information about the asterisk-users
mailing list