That's a matter of creating a reasonable numbering plan. You need to distinguish
between PSTN destinations and IP destnations in URIs for your domain. For example,
you may wish to reserve usernames beginning with "9" for PSTN and everything
else
for user location.
if (uri=~"sip:9[0-9]*foo.bar"){ # destinations beginning with 9 go to a gateway
strip(1);
seturihost("gateway.foo.bar");
} else { # everything else is searched in user location table
# if not found, return 404 and stop
if (!lookup("location")) { sl_send_reply("404", "user
offline"); break; }
# the contact from user location database will be used otherwise
};
# whether we put gateway or something from user location database in current
# uri, forward to it now
t_relay();
-jiri
At 09:57 PM 1/30/2003, Phillip Haynes wrote:
Hi,
I have set up the SER and its working. The only problem is I cant get the routing logic to
simultaneously route to either the User Loc or the PSTN. Its only doing one of the
other.
I am new to SIP, can u show me a sample script that will do both at the same time?
Best regards,
Phillip
--
Jiri Kuthan
http://iptel.org/~jiri/