Set presence on any extension
-
-
-
Hi Nicolás,
I have found a way through the dialplan but I have a number of servers and I have noticed that the db entries are in the server where the extensions resides. FOP2 is installed in server=0 but the extension is in server=2 so I need to run it on server=2 can you tell me if this is correct?
I am also working a web interface with PHP/AMI that does the same thing.
;example
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Read(WHATEXT,pcg/pcg_exten,3,,1,3)
exten => s,n,GotoIf($[${LEN(${WHATEXT})} = 3 ]?5:1);three digit extension
exten => s,5,Set(CHAN=SIP/${WHATEXT})
exten => s,n,Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=6)
exten => s,n,BackGround(pcg/pcg_avaliable)
exten => s,n,BackGround(pcg/pcg_inspection)
exten => s,n,BackGround(pcg/pcg_outoffice)
exten => s,n,BackGround(pcg/pcg_leave)
exten => s,n,BackGround(silence/5)
exten => s,n,Hangup()
;Available
exten => 0,1,Set(DB_VAL=${DB_DELETE(fop2state/${CHAN})})
exten => 0,n,UserEvent(FOP2ASTDB|Family: fop2state|Channel: ${CHAN}|Value: )
exten => 0,n,Playback(pcg/pcg_sset)
exten => 0,n,Hangup()
;Inspection
exten => 1,1,Set(DB(fop2state/${CHAN})=Inspection)
exten => 1,n,UserEvent(FOP2ASTDB|Family: fop2state|Channel: ${CHAN}|Value: Inspection)
exten => 1,n,Playback(pcg/pcg_sset)
exten => 1,n,Hangup()
;Out of office
exten => 2,1,Set(DB(fop2state/${CHAN})=Out of office)
exten => 2,n,UserEvent(FOP2ASTDB|Family: fop2state|Channel: ${CHAN}|Value: Out of office)
exten => 2,n,Playback(pcg/pcg_sset)
exten => 2,n,Hangup()
;Leave
exten => 3,1,Set(DB(fop2state/${CHAN})=Leave)
exten => 3,n,UserEvent(FOP2ASTDB|Family: fop2state|Channel: ${CHAN}|Value: Leave)
exten => 3,n,Playback(pcg/pcg_sset)
exten => 3,n,Hangup()exten => t,1,Hangup()
exten => i,1,Playback(pcg/pcg_invalid)
exten => i,2,Goto(fop-presence,s,1)
exten => i,3,Hangup()Also thanks for a superb product!
Brett
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login