Snom 4S Administrator's Manual page 50

Sip proxy/registrar version 2.30
Table of Contents

Advertisement

[
S N O M
including display-name and tags, $to is set to the value of the To header,
similar to the $from variable.
After the variables have been copied, the proxy calls the on_
request function without any arguments.
Default Implementation
The
default
implements the behaviour describes in the web based configuration.
First of all, the script checks if a ENUM number is being called. If
this is the case, the proxy just forwards the call. The transport mechanism
will take care about the tel-url to ENUM conversion and the resolution of
the SIP URL for the telephone number.
If the scheme is not a tel URL, the proxy checks if the request is
a messag to a user which is offline. In this case, it stores the message in
the user account for later delivery. Otherwise it determines the user which
is being called by looking at the request_uri. If that user is registered with
the proxy, it forks the request to that user using the sequential forking
delay. Otherwise, it calls the exec_dialplan function that takes care about
the dial plan. In case the dial plan does not generate an error message,
the proxy takes the 404 Not Found stored as default answer.
on_request($user) {
if (parse_scheme($request_uri) == "tel") {
# convert the telephone number into an enum suffix
proxy_dest($request_uri);
}
else {
$user = parse_user($request_uri);
if (known($user)) {
if (registered($user)) {
proxy_user($user);
}
else {
reject_request("404 Not Registered");
}
}
else {
if ($method == "MESSAGE" && known($user)) {
# store & forward:
store_message($user);
}
else {
50 • Scripting
4 S P
/ R
R O X Y
E G I S T R A R
implementation
M
]
A N U A L
of
the
on_request
function

Advertisement

Table of Contents
loading

Table of Contents