How am I supposed to route these?

Essentially, I get an INVITE from an end-user.  The uri is simply   sip:XXX.XXX.XXX.XXX

What is currently happening is that the IP address represented by Xs above is the IP of my proxy.  The proxy sees this URI and forwards the call back to itself.  This is obviously wrong, but I am not sure how to correct it.  The routing data I need is in the to_uri, but I am not sure how to place this into the uri field.  rewriteuri does not work on variables, only strings.  How can I accomplish this?  Currently on version 0.9.6.

Thanks in advance,
Steve


Climb to the top of the charts!  Play Star Shuffle:  the word scramble challenge with star power. Play Now!