Hello,
I installed SER a few days ago and I am following the document "SER - Getting Started" to familiarize with SER and understand how it works.
I've managed to run the first "hello world" application as well as including authentication through mysql. However, understanding ser.cfg has become more difficult than I thought.
To help understand the main route script, I have inserted into the ser.cfg script several calls to xlog function to display information. Although the information displayed is very useful, I don't understand the result of the following sentence: if (uri!=myself) { ..... }
I mean, uri is the request uri, for intance, sip:1001@192.168.1.10, and 'myself' is, according to the document, the sip proxy itself, so it can't be the same as uri. However, when the main route processes an INVITE message, the 'if' statement seems to return false because it doesn't execute the instrucion inside the 'if' block. And that would mean that uri is equal to 'myself'.
I am sure that I don't undertand what the value of 'myself' is......
Thanks in advance
The syntax there is a trifle misleading, yes, and does break the rules somewhat.
However, in this sense, you are correct, 'myself' is indeed the proxy server itself (and all the domains it handles). What you're saying when you say: if(uri==myself) is you're doing a test to see if the uri is one for which the proxy is, for lack of a better word, authoritative.
If your proxy handles (via aliases) the uris user@proxy.com, user@proxyalias1.com, and user@proxyalias2.com, then this line will check to see if the URI is XXX@proxy.com, XXX@proxyalias1.com, or XXX@proxyalias2.com and act accordingly.
The reverse test -- if(uri!=myself) -- does just what you'd expect. Any uri which the proxy server does not itself handle would pass that test.
N.
J. Alberto wrote:
Hello,
I installed SER a few days ago and I am following the document "SER - Getting Started" to familiarize with SER and understand how it works.
I've managed to run the first "hello world" application as well as including authentication through mysql. However, understanding ser.cfg has become more difficult than I thought.
To help understand the main route script, I have inserted into the ser.cfg script several calls to xlog function to display information. Although the information displayed is very useful, I don't understand the result of the following sentence: if (uri!=myself) { ..... }
I mean, uri is the request uri, for intance, sip:1001@192.168.1.10, and 'myself' is, according to the document, the sip proxy itself, so it can't be the same as uri. However, when the main route processes an INVITE message, the 'if' statement seems to return false because it doesn't execute the instrucion inside the 'if' block. And that would mean that uri is equal to 'myself'.
I am sure that I don't undertand what the value of 'myself' is......
Thanks in advance
Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers