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
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@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@espia.it
Follow up question: Could you explain the following line: exten => s,4,GotoIf(${notte}?5:6) I really don't know what ?5:6 means. 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.
I should have known that ... duh. Thanks for the help Hi. Il mar, 2003-07-15 alle 18:52, Derek Beaumont ha scritto:> Follow up question: > Could you explain the following line: > exten => s,4,GotoIf(${notte}?5:6) > I really don't know what ?5:6 means.*CLI> show application GotoIf -= Info about application 'GotoIf' =- [Synopsis]: Conditional goto [Description]: GotoIf(Condition?label1:label2): Go to label 1 if condition is true, to label2 if condition is false. Either label1 or label2 may be omitted (in that case, we just don't take the particular branch) but not both. Look for the condition syntax in examples or documentation. *CLI>