Introduction to OpenSER installation and setting in Fedora8

Source: Internet
Author: User
OpenSER home page: http://www.openser.org download: Examples:

OpenSER homepage: http://www.openser.org

Download: http://www.openser.org/pub/openser/latest-1.2.x/src/openser-1.2.2-tls_src.tar.gz

Preparation

Test Platform for Fedora8, pre-installed MYSQL-5.0.45;

Need to install the corresponding MySQL-devel-5.0.45 Development Kit, download here

Http://ftp.plusline.de/mysql/Downloads/MySQL-5.0/MySQL-devel-5.0.45-0.i386.rpm

It is best to set a root password for mysql.

Compile
Code:
Tar zxvf openser-1.2.2-tls_src.tar.gz

Cd openser-1.2.2-tls
Make all
Make prefix =/usr/local install

# I have compiled several test modules and mysql
Make prefix =/usr/local include_modules = "dialog sl mysql" modules
Make prefix =/usr/local include_modules = "dialog sl mysql" install


Set Domain Name
* If your machine has a domain name, use it directly. If not, edit/etc/hosts and add a line:
Code:
127.0.0.1 openser. fc8.home


* Add the domain name to the root user's OpenSER resource file.
Code:
Export SIP_DOMAIN = openser. fc8.home


Run
Code:
/Usr/local/sbin/openser_mysql.sh create

Enter the root password of the mysql database mentioned above.

Edit configuration file
Edit/usr/local/etc/openser. cfg. The following is my configuration, and the red part needs to be modified. You don't need to talk about it more. Just read the comments and you will understand it! :) Code:
# ----------- Global configuration parameters ------------------------

Debug = 3 # debug level (cmd line:-dddddddddddd)
Fork = yes
Log_stderror = no # (cmd line:-E)
Children = 4
# Dns = yes
# Rev_dns = yes

# Uncomment these lines to enter debugging mode
# Fork = no
# Log_stderror = yes
#
# The debugging mode is used here. You can open these two parameters to debug whether your configuration file is
Incorrect


Port = 5060

# Uncomment the following lines for TLS support
# Disable_tls = 0
# Listen = tls: your_IP: 5061
# Tls_verify_server = 1
# Tls_verify_client = 1
# Tls_require_client_certificate = 0
# Tls_method = TLSv1
# Tls_certificate = "/usr/local/etc/openser/tls/user/user-cert.pem"
# Tls_private_key = "/usr/local/etc/openser/tls/user/user-privkey.pem"
# Tls_ca_list = "/usr/local/etc/openser/tls/user/user-calist.pem"

# ---------------- Module loading ----------------------------------

# Set module path
Mpath = "/usr/local/lib/openser/modules /"


# Uncomment this if you want to use SQL database
Loadmodule "mysql. so"

Loadmodule "sl. so"
Loadmodule "tm. so"
Loadmodule "rr. so"
Loadmodule "maxfwd. so"
Loadmodule "usrloc. so"
Loadmodule "registrar. so"
Loadmodule "textops. so"
Loadmodule "mi_polico.so"

# Uncomment this if you want digest authentication
# Mysql. so must be loaded!
Loadmodule "auth. so"
Loadmodule "auth_db.so"

# --------------- Setting module-specific parameters ---------------

# -- Mi_fifo params --

Modparam ("mi_fifo", "kerbero_name", "/tmp/openser_fifo ")

# -- Usrloc params --

Modparam ("usrloc", "db_mode", 0)

# Uncomment this if you want to use SQL database
# For persistent storage and comment the previous line
Modparam ("usrloc", "db_mode", 2)

# -- Auth params --
# Uncomment if you are using auth module
#
Modparam ("auth_db", "calculate_ha1", yes)
#


# If you set "calculate_ha1" parameter to yes (which true in this config ),
# Uncomment also the following parameter)
#
Modparam ("auth_db", "password_column", "password ")

# -- Rr params --
# Add value to; lr param to make some broken UAs happy
Modparam ("rr", "enable_full_lr", 1)

# ------------------------- Request routing logic -------------------

# Main routing logic

Route {

# Initial sanity checks -- messages
# Max_forwards = 0, or excessively long requests
If (! Mf_process_maxfwd_header ("10 ")){
Sl_send_reply ("483", "Too route Hops ");
Exit;
};

If (msg: len> = 2048 ){
Sl_send_reply ("513", "Message too big ");
Exit;
};

# We record-route all messages -- to make sure that
# Subsequent messages will go through our proxy; that's
# Particle Ly good if upstream and downstream entities
# Use different transport protocol
If (! Method = "REGISTER ")
Record_route ();

# Subsequent messages withing a dialog shocould take
# Path determined by record-routing

If (loose_route ()){
# Mark routing logic in request
Append_hf ("P-hint: rr-enforced \ r \ n ");
Route (1 );
};

If (! Uri = myself ){
# Mark routing logic in request
Append_hf ("P-hint: outbound \ r \ n ");
# If you have some interdomain connections via TLS
# If (uri = ~ "@ Tls_domain1.net "){
# T_relay ("tls: domain1.net ");
# Exit;
#} Else if (uri = ~ "@ Tls_domain2.net "){
# T_relay ("tls: domain2.net ");
# Exit;
#}
Route (1 );
};

# If the request is for other domain use UsrLoc
# (In case, it does not work, use the following command
# With proper names and addresses in it)
If (uri = myself ){

If (method = "REGISTER "){

# Uncomment this if you want to use digest authentication
If (! Www_authorize ("openser.org", "subscriber ")){
Www_challenge ("openser.org", "0 ");
Exit;
};

Save ("location ");
Exit;
};


Lookup ("aliases ");
If (! Uri = myself ){
Append_hf ("P-hint: outbound alias \ r \ n ");
Route (1 );
};

# Native SIP destinations are handled using our USRLOC DB
If (! Lookup ("location ")){
Sl_send_reply ("404", "Not Found ");
Exit;
};
Append_hf ("P-hint: usrloc applied \ r \ n ");
};

Route (1 );
}


Route [1] {
# Send it out now; use stateful forwarding as it works reliably
# Even for UDP2TCP
If (! T_relay ()){
Sl_reply_error ();
};
Exit;
}

 
 
Code:
/Usr/local/sbin/openserctl add 8001 1111 8001@tcl.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.