Issue 586

Hi Mike,

Please can you look over these changes I've made? They've come about as a result of #586. The changes I've made can be split into two categories. I've changed terminating I-CSCF processing and I've changed the logic which decides when we route to the BGCF when we have a telephone number.

I-CSCF changes (see 24.229, section 5.3.2.1):

When we receive a terminating request which contains a req uri that is a sip uri with user=phone we translate this into a tel uri.

When we then come to do an LIR, if this fails with the user not found, and we have a tel URI, we try doing an ENUM lookup. If this succeeds we loop back round and try another LIR.

S-CSCF changes (see story 382 spec, and 24.229 section 5.4.3.2):

If we fail to find a match when we do an ENUM lookup for a phone number, we go to the BGCF to try and find a route.

This doesn't include any unit tests, and hasn't been tested, so there may be bugs, but I wanted to send it to you now to root out any major problems as early as possible. I'm working on the unit tests now.

Thanks,
Graeme
I'm not sure why you've changed this - previously translate_request_uri would not return an error if it did an enum lookup but failed to find a match, so we would fall through and do BGCF routing in calculate_targets.  It seems like the only reason you have to swap in to BGCF context at this point is because you changed the API to translate_request_uri.  Why?  Pulling BGCF processing to here will probably cause bugs in Rf ACR processing, so we shouldn't do it without a very good reason.