Omid-Mohajerani / Learn-Kamailio

Learn Kamailio
22 stars 5 forks source link

Enable User Authentication And User Location Persistence #2

Open Omid-Mohajerani opened 2 years ago

Omid-Mohajerani commented 2 years ago

Edit kamailio.cfg and add after first line:

!define WITH_MYSQL

!define WITH_AUTH

!define WITH_USRLOCDB

!define WITH_NAT

To use domains for SIP addresses set alias global parameter: alias="sip.domain.com"

For reference, an alternative is to start kamailio with --alias parameter:

kamailio --alias=sip.domain.com ...

kamctl add 101 mysecurepass!!! kamctl add 102 mysecurepass!!! kamctl add 103 mysecurepass!!! kamctl add 104 mysecurepass!!! kamctl add 105 mysecurepass!!! kamctl add 106 mysecurepass!!! kamctl add 107 mysecurepass!!! kamctl add 108 mysecurepass!!! kamctl add 109 mysecurepass!!!

The prototype of the command above is: kamctl add userid password

Testing: If not already running, start RTPProxy (note that you have to replace _your_publicip with corresponding server IP):

rtpproxy -F -s udp:localhost:7722 -l _your_publicip

To check if RTPProxy is running: ps auxw | grep -i rtpproxy

When needed, the command to stop RTPProxy: killall rtpproxy

Start Kamailio with the default config from command line (terminal): killall kamailio kamailio