Routing of Calls thru CLI values

I have an asterisk box here in our office. We have a VoIP partner1 and 2. My partner1 routes the call when it sense that I have dialled 001 and routes the call from US. My partner2 has also have to dialled the same as partner1. Is there a way that I could route a thru CLI?Meaning when if I use a CLI of 44xx.xx it has to route the call from partner1. But when I use CLI 55xx.xx it will toute the call from partner2. Is there any possible way to route calls only by identifying the CLI. Need your help. THank you very much


I think what you are wanting is pattern matching see here … n+Patterns

Use a gotoif based on callerid.

exten => s,1,Gotoif($[${CALLERIDNUM:0:2} = 55]?s,10:)
exten => s,2,Gotoif($[${CALLERIDNUM:0:2} = 44]?s,100:)
exten => s,10,NoOp(My CLI Started with 55)
exten => s,100,NoOp(My CLI started with 44)

Something like that