I tried this but I think I am writing nonsense …
[outbound-r2]
; this context generates a random number and chooses from a list of fixed outbound caller IDs
; based on the random result
exten => s,1,NoOp(Chiama rendom)
exten => s,n,Set(foo=${RAND(1,10)}) ;choose a random number between 1 and 10
exten => s,n,NoOp(choosing random CID #${foo})
exten => s,n,goto(${foo},1)
exten => 1,1,set(fromuser=01821985050)
exten => 2,1,set(fromuser=01821985051)
exten => 3,1,set(fromuser=01821985052)
exten => 4,1,set(fromuser=01821985053)
exten => 5,1,set(fromuser=01821985054)
exten => 6,1,set(fromuser=01821985055)
exten => 7,1,set(fromuser=01821985056)
exten => 8,1,set(fromuser=01821985057)
exten => 9,1,set(fromuser=01821985058)
exten => 10,1,set(fromuser=01821985059)
exten => _.,1,Goto(from-internal,${EXTEN},1) ; assuming they press 0 for the front desk
; add additional lines as necessary
; this final line is required in order to send the call flow back to the calling gosub line
exten => _X!,n,Return
; end contxt [outbound-r2]