Douglas Garstang wrote:
We have a configuration where OpenSER sit's
between Polycom phones
and Asterisk. Off-net/PSTN calls are also sent from Asterisk to
OpenSER to be routed to a Mediacodes Gateway.
I'm having a hell of a time with the routing in general! What is the
best way to route calls? Should I be looking at the URI? The From:?
The To:? The method?
Routing should be done on the request URI. In my setup, routing for all
mehtods is identical, except some special cases (e.g. voicemail failure
route only for INVITE, special handling for CANCEL and ACK, special
handling for OPTIONS and SIPURA's keep alive NOTIFY requests ...)
Also, the convention seems to be that the URI contains
where the
message is going TO rather than where it came FROM. However, routing
is much easier if the URI has where it came from.
I use is_from_gw() (lcr module) to detect calls from the gateways. All
other requests are handled to come from local users or are incoming SIP
calls.
For example, messages from the phones have a URI of:
uac.voip.com
and messages from Asterisk have the IP adress in the URI, as Asterisk
doesn't seem to let you set the URI. Calls from the Mediacodes have a
URI of:
pstn.voip.com
Is adding sub-domains like 'uac' and 'pstn' a good way to route?
I've
looked at all the examples I could find but unfortunately they're
ridiculously simple.
If I receive a request from the gateway, I do use opnly the user part of
the request URI (the called phone number) for routing.
In my setup Asterisk is only used for voicemail, echotest ... Thus
asterisk never initiates calls, thus I do not have to care about calls
from asterisk. If you use it also as gateway, do it like above - just
take a look at the userpart. Use a common format for all gateways.
Maybe you are mixing authentication and routing. Do not authenticate
gateways according their domain in the URIs. Check src_ip to
authetnicate trusted nodes (gateway, media server) and use the request
URI to route.
regards
klaus
Every time I look at openser.cfg I get VERY STRESSED
OUT!
Thanks.
------------------------------------------------------------------------
_______________________________________________ Users mailing list
Users(a)openser.org
http://openser.org/cgi-bin/mailman/listinfo/users