Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Symposium Scripting

Status
Not open for further replies.

coolicepbx

Programmer
Nov 10, 2004
111
CA
Is there any way in a loop to decrease the priority incrementally? The variable priority cannot be incremented and decremented? I have tried different variable types but it will not accept anything else than PRIORITY.

Here is what i had in mind....


SECTION PRIORITY_DECREASE
IF PRI_GV > 1 THEN
QUEUE TO SKILLSET electronics WITH PRIORITY PRI_GV
ASSIGN PRI_GV - 1 TO PRI_GV
END IF


PRI_GV is a global variable. In thoery this should work but I was not able to assign a value to PRI_GV and use it in the QUEUE TO command because it is not of variable type PRIORITY. Ideas?

thanks
Martin
 
hi coolicepbx
I think you need to use a call-variable in this situation; then you will be able to assign a value to it.
 
carolien is correct. With a call variable, you can control the value for that specific call, but it does not change the value of the variable for other calls entering the script. If you have SCCS 5.0, you can use "wild" variables to affect the value for the system overall.
 
Like sandyml and carolien say, make sure you create a call variable and have the data type = priority and not integer.
 
But you cannot decrease the Variable type Priority I tried.

Martin
 
Correct, the data type are different, Priority vs Integer.

To get what you want, you'll have to convert Priority into Integer with ASSIGNMENT statements then do your math, get the result and pass the data (the actual Integer note variable integer) to the Priority Call Variable.

It requires more work (lots more work), but do-able.

 
Maybe you can use this:
Code:
QUEUE TO SKILLSET electronics WITH PRIORITY PRI_CV
wait 2
EXECUTE prio_loop

section prio_loop
	wait 60
	WHERE PRI_CV EQUALS
		VALUE 2 : ASSIGN 1 TO PRI_CV
		VALUE 3 : ASSIGN 2 TO PRI_CV	
		VALUE 4 : ASSIGN 3 TO PRI_CV
		VALUE 5 : ASSIGN 4 TO PRI_CV
		VALUE 6 : ASSIGN 5 TO PRI_CV
        DEFAULT : ASSIGN 1 TO PRI_CV
	END WHERE
	CHANGE PRIORITY IN SKILLSET electronics TO PRIORITY PRI_CV
	EXECUTE prio_loop
 
That is a nice bit of coding there carolien! Very Creative.

The only thing I would do different would be once the call was assigned to a value of 1 would be to take it out of that loop with a "Value 1: EXECUTE main_loop".

Also since its stuck in that looping example you should probably check for skillset out of service.



 
OK. I'm tired and my logic is probably failing me, but-
If a call arrives and no CV is entered:
1) Default assigns a value of 1. Skillset priority is changed.
2) Loops to top and checks, finds value of 1.
3) Value 1 not tested for so reassigns 1 by default.
I'm probably missing something but it seems to me like you'd need to assign 6 for the default.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top