You have a typical deployment now and you are good to go, however you may need to do extra configuration depending on the devices you are using and functionality you want to achieve.
By default, the load-balancer listens on the UDP and TCP ports 5060 (kamailio→lb→port) and TLS port 5061 (kamailio→lb→tls→port). If you need to setup one or more extra SIP listening ports or IP addresses in addition to those standard ports, please edit the kamailio→lb→extra_sockets option in your /etc/ngcp-config/config.yml file.
The correct format consists of a label and value like this:
extra_sockets: port_5064: udp:10.15.20.108:5064 test: udp:10.15.20.108:6060
The label is shown in the outbound_socket
peer preference (if you want to route calls to the specific peer out via specific socket); the value must contain a transport specification as in example above (udp, tcp or tls). After adding execute ngcpcfg apply
:
ngcpcfg apply 'added extra socket' && ngcpcfg push all
The direction of communication through this SIP extra socket is incoming+outgoing. The sip:carrier will answer the incoming client registrations and other methods sent to the extra socket. For such incoming communication no configuration is needed. For the outgoing communication the new socket must be selected in the outbound_socket
peer preference. For more details read the next section Section 15.2, “Extra SIP and RTP Sockets” that covers peer configuration for SIP and RTP in greater detail.
In this section you have just added an extra SIP socket. RTP traffic will still use your rtp_ext IP address. |
If you want to use an additional interface (with a different IP address) for SIP signalling and RTP traffic you need to add your new interface in the /etc/network/interfaces file. Also the interface must be declared in /etc/ngcp-config/network.yml.
Suppose we need to add a new SIP socket and a new RTP socket on VLAN 100. You can use the ngcp-network tool for adding interfaces without having to manually edit this file:
ngcp-network --set-interface=eth0.100 --host=slb01a --ip=auto --netmask=auto --type=sip_ext_incoming ngcp-network --set-interface=eth0.100 --host=slb01b --ip=auto --netmask=auto --type=sip_ext_incoming ngcp-network --set-interface=eth0.100 --host=prx01a --ip=auto --netmask=auto --type=rtp_int_100 ngcp-network --set-interface=eth0.100 --host=prx01b --ip=auto --netmask=auto --type=rtp_int_100
The generated file should look like the following:
slb01a: .. .. eth0.100: hwaddr: ff:ff:ff:ff:ff:ff ip: 192.168.1.2 netmask: 255.255.255.0 shared_ip: - 192.168.1.3 shared_v6ip: ~ type: - sip_ext_incoming .. .. interfaces: - lo - eth0 - eth0.100 - eth1 .. .. prx01a: .. .. eth0.100: hwaddr: ff:ff:ff:ff:ff:ff ip: 192.168.1.20 netmask: 255.255.255.0 shared_ip: - 192.168.1.30 shared_v6ip: ~ type: - rtp_int_100 .. .. interfaces: - lo - eth0 - eth0.100 - eth1 .. .. slb01b: .. .. eth0.100: hwaddr: ff:ff:ff:ff:ff:ff ip: 192.168.1.4 netmask: 255.255.255.0 shared_ip: - 192.168.1.3 shared_v6ip: ~ type: - sip_ext_incoming .. .. interfaces: - lo - eth0 - eth0.100 - eth1 .. .. prx01b: .. .. eth0.100: hwaddr: ff:ff:ff:ff:ff:ff ip: 192.168.1.40 netmask: 255.255.255.0 shared_ip: - 192.168.1.30 shared_v6ip: ~ type: - rtp_int_100 .. .. interfaces: - lo - eth0 - eth0.100 - eth1
As you can see from the above example, extra SIP interfaces must have type sip_ext_incoming. While sip_ext should be listed only once per host, there can be multiple sip_ext_incoming interfaces. The direction of communication through this SIP interface is incoming only. The sip:carrier will answer the incoming client registrations and other methods sent to this address and remember the interfaces used for clients' registrations to be able to send incoming calls to him from the same interface.
In order to use the interface for the outbound SIP communication it is necessary to add it to extra_sockets section in /etc/ngcp-config/config.yml and select in the outbound_socket
peer preference.
So if using the above example we want to use the vlan100 IP as source interface towards a peer, the corresponding section may look like the following:
extra_sockets: port_5064: udp:10.15.20.108:5064 test: udp:10.15.20.108:6060 int_100: udp:192.168.1.3:5060
The changes have to be applied:
ngcpcfg apply 'added extra SIP and RTP socket' && ngcpcfg push all
After applying the changes, a new SIP socket will listen on IP 192.168.1.3
on slb01 node and this socket can now be used as source socket to send SIP messages to your peer for example. In above example we used label int_100. So the new label "int_100" is now shown in the outbound_socket
peer preference.
Also, RTP socket is now listening on 192.168.1.30
on prx01 node and you can choose the new RTP socket to use by setting parameter rtp_interface
to the Label "int_100" in your Domain/Subscriber/Peer preferences.