Could someone please explain to me the actual difference between *Alias=*and *Listen=*. I have read the documentation ( [snip] listen=udp:sip1.foobar.com:5060 /* Domain 1 */
Ahh, this links back to your previous message and adds a little light.
IMO, it is not good practice to put domain names for listen. I would only list IP addresses, and that list should be relatively small because you don't need the IP address to distinguish between clients. For example, I just have one listen command in my config.
For a critical service like this, either hard-coding in the IP addresses to listen on, or be willing to listen on all attached interfaces, should be Standard Operating Procedure (I vote for the former).
alias="sip1.foobar.com:5060" /* Aliases for Domain 1 */
Don't put the port in there. Just list the domains that the server is responsible for.
Now if I understand correctly then *if (uri==myself) { }* should now be true for each of these domains.
I think this should be explained more fully by someone in the know...
For example, if you are using the "domain" module then would we expect to never have to use "uri==myself" and not have to list aliases? (using is_uri_host_local() instead)
An earlier hint from someone here to me said something like "openser doesn't know that the message is directed at itself" and I wonder how the use of the "domain" module affects things *inside* the openser core.
And then there is the environment variable SIP_DOMAIN... does that have any bearing on the function of openser or is it just used for the supporting scripts (openserctl). What is the role of this variable in a multi-domain setting?
-mark
Mark Kent writes:
alias="sip1.foobar.com:5060" /* Aliases for Domain 1 */
Don't put the port in there. Just list the domains that the server is responsible for.
if you have two openser instances in the same box listening at different ports, you want to make sure that the box is the correct one, for example, when an initial request comes with pre-loaded route header.
For example, if you are using the "domain" module then would we expect to never have to use "uri==myself" and not have to list aliases? (using is_uri_host_local() instead)
i need to use alias for checking pre-loaded route header containing the domain name of the proxy.
-- juha
alias="sip1.foobar.com:5060" /* Aliases for Domain 1 */
Don't put the port in there. Just list the domains that the server is responsible for.
if you have two openser instances in the same box listening at different ports, you want to make sure that the box is the correct one, for example, when an initial request comes with pre-loaded route header.
What? Are you saying the alias should list a port?
i need to use alias for checking pre-loaded route header containing the domain name of the proxy.
Are you saying that as a developer of the openser internals or as a someone who runs an openser box with your own openser.cfg?
You are actually the person we want to hear from :-) We, or at least I, just need more clarification of the questions I raised in that previous email.
Thanks, -mark
mark,
lets sat your proxy gets an initial request with pre-loaded route header
Route: sip:proxy.foo.bar
assuming that proxy.foo.bar is hostname of the proxy and not any of the domains that the proxy is responsible for, my understanding is that alias is the only way to make the proxy to realize that the route specifies this proxy if your listen lines contain ip addresses.
i'm further assuming (not knowing) that if you add a port to alias, then the proxy will not consider the route specifying itself if the request came to another port than the one added to alias.
someone who knows the internals of loose_route function, could tell if the above is true or not.
-- juha
Your message is very illuminating... in particular this:
someone who knows the internals of loose_route function, could tell if the above is true or not.
You don't know? I had you at the top level of my openser.gurus wall chart and I guess I'll have to move you down a level :-)
lets sat your proxy gets an initial request with pre-loaded route header Route: sip:proxy.foo.bar assuming that proxy.foo.bar is hostname of the proxy and not any of the domains that the proxy is responsible for
Under what conditions would that happen?
And, do you think this is a Best Common Practice (BCP)? Namely, a clear separation between the domains the proxy is responsible for and the hostname[s] of the server itself?
As I think about this, anyone who controls a domain can set up an A record that points to my openser box. So, as an openser.cfg "programmer", I don't want to process just any message that might end up on my box, I want to process only messages targeted at domains that I explicitly configure for, recognizing that I also have to handle numeric IP addresses.
i'm further assuming (not knowing) that if you add a port to alias, then the proxy will not consider the route specifying itself if the request came to another port than the one added to alias.
I guess I can see this... one server could handle example.com:5060 another example.com:5061 and so on... as a way to spread load.
So, this just makes me more confused about the interaction between:
a) the alias statement b) the domain module c) SIP_DOMAIN environment variable
As an aside... openser takes the "programming with side-effects" concept to the limit.
-mark
Mark Kent writes:
lets sat your proxy gets an initial request with pre-loaded route header Route: sip:proxy.foo.bar assuming that proxy.foo.bar is hostname of the proxy and not any of the domains that the proxy is responsible for
Under what conditions would that happen?
it is very common that hostname of proxy is different than users's domains.
And, do you think this is a Best Common Practice (BCP)? Namely, a clear separation between the domains the proxy is responsible for and the hostname[s] of the server itself?
yes, i think that this separation is very useful.
As I think about this, anyone who controls a domain can set up an A record that points to my openser box. So, as an openser.cfg "programmer", I don't want to process just any message that might end up on my box, I want to process only messages targeted at domains that I explicitly configure for, recognizing that I also have to handle numeric IP addresses.
sure.
-- juha
it is very common that hostname of proxy is different than users's domains.
Yes, but I meant under what conditions would that proxy receive a request with a pre-loaded route header (I may not know what that means) containing the name of the proxy itself and not the user's domain?
I'm guessing the answer is "almost always." as it's the proxy name/ip address that gets inserted in Route: and Record-Route: headers... is that correct?
BTW, in openser, what controls whether an IP address or a hostname gets put in those headers?
Thanks, -mark
Mark Kent writes:
Yes, but I meant under what conditions would that proxy receive a request with a pre-loaded route header (I may not know what that means) containing the name of the proxy itself and not the user's domain?
nokia e-series phones, for example, use Route header in initial requests and it can contain a host name of the proxy rather than an ip address.
BTW, in openser, what controls whether an IP address or a hostname gets put in those headers?
openser always inserts its ip address in record-route header.
-- juha