Published on iptel.org (http://www.iptel.org)

options

By greger
Created 2006-11-26 09:42

Standard

This module provides a function to answer OPTIONS requests which are directed to the server itself. This means an OPTIONS request which has the address of the server in the request URIi [1], and no username in the URI. The request will be answered with a 200 OK which the capabilities of the server.

To answer OPTIONS request directed to your server is the easiest way for is-alive-tests on the SIP (application) layer from remote (similar to ICMPi [2] echo requests, also known as "ping", on the network layer).


Nils Ohlmeier


i [3], and no username in the URI. The request will be answered with a 200 OK which the capabilities of the server.

To answer OPTIONS request directed to your server is the easiest way for is-alive-tests on the SIP (application) layer from remote (similar to ICMPi [4] echo requests, also known as "ping", on the network layer).

i [5] does not support any encodings yet.

Default value is "".

i [6].

Default value is "".

i [7] with "200 OK" and the capabilities from the modules parameters.

It sends "500 Server Internal Error" for some errors and returns false if it is called for a wrong request.

The check for the request method and the missing username is optional because it is also done by the function itself. But you should not call this function outside the myself check because in this case the function could answer OPTIONS requests which are sent to you as outbound proxy but with an other destination then your proxy (this check is currently missing in the function).

Example 5. options_reply usage

...
if (uri==myself) {
  if ((method==OPTIONS) && (! uri=~"sip:.*[@]+.*")) {
    options_reply();
  }
}
...