50 • Scripting
[
S N O M
4 S P
R O X Y
/ R
E G I S T R A R
M
A N U A L
]
snom technology AG • 51
[
S N O M
4 S P
R O X Y
/ R
E G I S T R A R
M
A N U A L
]
reject_request(“404 Not Found”); # default
exec_dialplan(parse_url($from), parse_url($to),
$request_uri, $allow_pattern);
}
}
}
}
on_response
Condition for Calling
When a response is received by the proxy, it matches this
response to an open request.
The proxy automatically determines the best response to a
request. The function on_response does not need take care about this.
The response is sent only of all call legs returned an error code or one of
the call legs returned a success code.
The return code indicates weather the proxy should consider the
response as an answer to the original request.
Default Implementation
The default implementation takes care about the redirection codes
300-399. The proxy initiates the sending of a 181 provisional response
and then forks a new request for each of the contacts given in the redirect
response. In this case, the response is not taken as a response code to
the request.
on_response() {
# handle redirect codes
if ($code >= 300 && $code < 400) {
send_ringing(“181 Call Being Forwarded”);
foreach($dest, get_contacts()) {
proxy_dest($dest);
}
return false;
}
else {
return true; # this is a valid response
}
}
6.
Summary of Contents for 4S Media Server
Page 1: ...Administrator s Manual snom 4S SIP Proxy Registrar Version 2 30 ...
Page 14: ...14 VoIP Protocol S N O M 4 S P R O X Y R E G I S T R A R M A N U A L 1 ...
Page 84: ...84 Routing S N O M 4 S P R O X Y R E G I S T R A R M A N U A L 10 ...
Page 98: ...98 Maintenance S N O M 4 S P R O X Y R E G I S T R A R M A N U A L 13 ...