On Tuesday 12 February 2008 15:51:34 Ali Jawad wrote:
Hi All
I am trying to achieve the following
- User Calls a number
- If the number is 00+all numbers go to PSTN -> Else check if the
user is existent in our SIP Proxy user pool and act accordingly
What I achieved so far is the following
- User Calls a number
- Route checks if the number is online if yes the call is routed
to him (route[1]) if not it send the call to PSTN if it is 00+[0-9] route [2]. This works fine for 00+[0-9] number however if 123456 is called and the user 123456 is not online, the call goes down through the conditional statements because it does not meet 00+[0-9] and I get an error "To Many Hops"
Use:
if (does_uri_exist()) { # The called number is a local user if (lookup("location")) # If user is online call him: route(CALL_USER); else route(VOICEMAIL); # Or send 404 }
In this way you will avoid sending out a call for an online user that is not registered.