<div>You should probably add that you are doing this with FreePBX, not plain Asterisk. That being said, you might want to ask on those lists, since I still haven't understood what you are asking. </div>
<div> </div>
<div>The way I see it, a call comes in from your IAX provider, and you want that call sent to a certain extension. You would need to set the context of that provider to from-iax-provider. Then, in extensions.conf add the following:
</div>
<div> </div>
<div>[from-iax-provider]</div>
<div>exten => s,1,Goto(2100|local-ext|1)</div>
<div> </div>
<div>where 2100 is the extension number and local-ext is the context this extension is in, or even simpler:</div>
<div> </div>
<div>[from-iax-provider]</div>
<div>exten => s,1,Dial(SIP/2100)</div>
<div> </div>
<div>if you are dialing a sip device with an extension of 2100.</div>
<div> </div>
<div>Now, the problem is going to be that you can't modify your extension.conf file because you're using FreePBX/Asterisk @ Home/Trixbox/whatever. If that's the case, then you really should be asking this question elsewhere, or install plain Asterisk (which I would recommend doing).
</div>
<div> </div>
<div>Now, looking at what you posted, instead of messing with the caller id, I would instead use:</div>
<div> </div>
<div>exten => s,1,Set(FROM_DID=2125316214)</div>
<div> </div>
<div>and continue on. At that point, you can always reference ${FROM_DID} to find out what DID the incoming call came from. That's what I use. You're free to use whatever variable you wish. I'm not sure if including this in the custom context will do what you are wanting to do. Again, you'll have to ask people who are familiar with FreePBX.
<br><br> </div>