Yah, partially that what I need. I need the same program in the dialplan, but this time is more sophisticated than that. When an incoming call is ongoing I needed that this ANI will be changed to desired DID.let say 151061xxxxx will call a extension 3456. Before it passes the call to 3456 it will assgined a new ANI. let say the first ANI will be 012345. The catch is here, when a call coming from 151062xxxxx and called party would be 3457 it will assigned another ani (012346) and if another incoming let let say 151063xxxxx it will be assgined another ani. Can I make a random selection on numbers that I’m going to assgined when incoming calls is ongoing? I have some dialplan here but i’m not sure If I’m this is going to work. Below are the simple dialplan of mine.
Please help me with. Thank you very much in advance.
extensions.conf
[londis]
exten=>12345,1,Gotoif($[${CALLERIDNUM} = 17771 ]?10:20)
exten=>12345,10,Goto(longdist1,${EXTEN},1)
exten=>12345,20,Goto(longdist2,${EXTEN},1)
exten=>12346,1,Gotoif($[${CALLERIDNUM} = 17772 ]?10:20)
exten=>12346,10,Goto(longdist1,${EXTEN},1)
exten=>12346,20,Goto(longdist2,${EXTEN},1)
[longdist1]
exten=>12345,1,SetCallerID(012345)
exten=>12345,2,Dial(SIP/12345|60|ro)
exten=>12345,3,Hangup
include=>aspen-out
include=>aspen-host
[longdist2]
exten=>12345,1,SetCallerID(012346)
exten=>12345,2,Dial(SIP/12345|60|ro)
exten=>12345,2,Hangup