01-biancu-configuration_basics.pdf

(305 KB) Pobierz
SIP Tutorial
OpenSER Admin Course
Configuration Basics
Voice System SRL
712496116.016.png 712496116.017.png 712496116.018.png 712496116.019.png 712496116.001.png
Configuration file
it is a text file (only file-system storage supported)
no native support for advanced text processing (like define,
include, etc), but very easy and simple to integrate with M4
the file is loaded and processed only at startup (not used at
runtime)
currently there is no support for re-loading the configuration file
at runtime – you need to restart the application; fortunately the
most changeable data is configured via DB, where reload is
possible.
Ex:
openser -f openser.cfg
© Voice System SRL - Advanced Admin Course 2
712496116.002.png 712496116.003.png 712496116.004.png 712496116.005.png
Config file structure
© Voice System SRL - Advanced Admin Course 3
712496116.006.png 712496116.007.png 712496116.008.png 712496116.009.png
configuration file format....
# global options
debug=9
fork=no
log_stderror=yes
listen=192.168.1.34:5060
.....
# module loading
mpath=”/usr/local/lib/openser/modules/”
loadmodule=”tm.so”
loadmodule=”registrar.so”
.....
# module parameters
modparam(“registrar”,”append_branches”,1)
modparam("tm", "fr_inv_timer", 30)
modparam("nathelper", "rtpproxy_sock", “/var/run/rtpproxy.sock”)
.....
© Voice System SRL - Advanced Admin Course 4
712496116.010.png 712496116.011.png 712496116.012.png
....configuration file format....
# initial request route
route{
.....
if (route(1)) {
}
.....
route(x);
}
# additional routes – can be invoked from any other route
route[1]{
if (uri=~”sip:[0-9]+@”) {
return(1); # return true on the above route
} else if (uri=~”sip:[a-zA-Z]+@”) {
return(-1); # return false
}
sl_send_reply(“400”,”Bad URI”);
exit;
}
......
© Voice System SRL - Advanced Admin Course 5
712496116.013.png 712496116.014.png 712496116.015.png
Zgłoś jeśli naruszono regulamin