Raj; I have success with settings below. Some of the examples based on caller ID and number dialed, will re-dial out a given SPx and dial other numbers. I have a couple UK DID's and USA DID's to mess with. As you can see from my example; a family member in UK calls a DID there, that redials a local cell number here is USA. Of course the DID is free - so it's a way for UK family to call my daughters cell here in USA.
I'm using many combinations, some require the DID number dialed and caller ID combination.
Remove any of the hi-lighted text as these were just for comments:
X_InboundCallRoute:
{(16046985518):aa},
-- any call from 16046985518 should get AA{(13604703652)>(19142961123):sp2(011441903208888)},
-- if 19142961123 was called from 13604703652, then dial out SP2: 011441903208888 - using my voip.ms international plan{(13604708123)>(19142961111):sp1(13604703562)},
-- if 19142961111 was called from 13604708123, then dial out SP1: 13604703562{>44113604708123:sp1(13605158499)},
-- if any number calls this UK DID, then dial local cell number: 13605158499 from SP1{(x|xx|xxx|xxxx|xxxx|xxxxxx|un@@.):},
-- a great SIP scanner avoidance string{ph}