DID routing/manipulation using smartroutes module

Hi ALL. Running freepbx and need advice , help if had someone same issue about smartroutes 1.3. My intension is to make routing inside PBX based on DID, but when incoming call arrive on PBX I need to add prefix to it. Consider to use smartroutes because DB routing and because many of those DID have different prefix. For example I have DID 4328435698 on incoming trunk and need to attach prefix to look like 1405#4328435698. No problem if I have few but have allmost 300 combination of prefixes which I need to assign to various DID, then send to TDM gateway cisco AS. I created database,table and columns for smartroutes. In one columns I put regular DID’s and in other DID’s with prefix make setup, but discover that I need manually put match value and context for each possible combination DID+PREFIX to work. My question is there another way to solve this issue?