[Asterisk-Users] Conditional Contexts
Brancaleoni Matteo
mbrancaleoni at espia.it
Tue Jul 15 09:37:39 MST 2003
yes, see the db app.
you can have a main context from which you go to
context A or B depending on a var stored in the db.
here's a snippet of my extension.conf
(I use that to switch into/from 'night' state)
Inbound calls falls into:
[inbound]
exten => s,1,Wait(1)
exten => s,2,agi,cid_lookup.agi
exten => s,3,DBget(notte=ServizioNotte/status)
exten => s,4,GotoIf(${notte}?5:6)
exten => s,5,Goto(espia_chiuso_full,s,1)
exten => s,6,Goto(telecom,s,1)
and in my local context, I can set the status via:
;
; night service
; 7000 enable ; 7001 disable
; 7002 get status
;
exten => 7000,1,Authenticate(1234)
exten => 7000,2,DBput(ServizioNotte/status=1)
exten => 7000,3,Hangup
exten => 7001,1,Authenticate(1234)
exten => 7001,2,DBput(ServizioNotte/status=0)
exten => 7001,3,Hangup
exten => 7002,1,DBget(notte=ServizioNotte/status)
exten => 7002,2,Answer
exten => 7002,3,SayDigits(${notte})
exten => 7002,4,Hangup
That's all ;)
Matteo.
Il mar, 2003-07-15 alle 18:10, Derek Beaumont ha scritto:
> I was wondering if the following was possible:
>
> 2 separate incoming contexts. The first will be used when
> there is a secretary present. The second will be used when there is
> no secretary.
> I know that this can be done using includes and specifying the time
> in which each separate context would be included. However, I would
> like to be able to switch them from the reception telephone.
>
> For example:
> Receptionist starts work => Picks up phone and dials 123 (switched to
> first incoming context.
>
> Receptionist goes out for lunch => picks up phone and dials 321
> (switches to second incoming context)
>
>
> Can this be done? If so, how might I go about doing it.
>
> Thanks a lot for your time
>
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
--
Matteo Brancaleoni
Espia System Administrator - IT services
Website : http://www.espia.it
Email : mbrancaleoni at espia.it
More information about the asterisk-users
mailing list