SIP/IAX Devices.
Posted: by Unknown in
0
A2Billing SIP/IAX Configuration Files VS
Asterisk Realtime:
-For a SIP or IAX2 account that has been created on A2Billing to be able to connect to Asterisk it needs to
be made aware of the SIP/IAX2 account details (username, password, etc).
The original way for A2Billing to tell Asterisk about any customers
with SIP/IAX2 access details was to create 2 files –
additional_a2billing_sip.conf and additional_a2billing_iax.conf. These
would then be ‘included’ as part of the Asterisk configuration files so
when Asterisk was reloaded the account details were read.
-This is pretty straight forward but does have a couple of downsides.
Firstly, it’s not dynamic. Asterisk needs to reread the configuration
files when any new accounts are added. Secondly, if you have multiple
Asterisk/A2Billing servers there is no central repository for these
account details.
-A more flexible, but slightly more difficult to setup, option is
Asterisk Realtime. Asterisk Realtime stores configuration information in
a database (such as MySQL). It can store various configuration
information in the database but for A2Billing’s purposes we will be
storing SIP and IAX2 account details.
A2Billing SIP/IAX Configuration Files (Only required if NOT using Asterisk Realtime):
-Create the A2Billing SIP/IAX files and set permissions.
# chmod 777 /etc/asterisk
# touch /etc/asterisk/additional_a2billing_iax.conf
# touch /etc/asterisk/additional_a2billing_sip.conf
# echo '#include additional_a2billing_sip.conf' >> /etc/asterisk/sip.conf
# echo '#include additional_a2billing_iax.conf' >> /etc/asterisk/iax.conf
# chown -Rf apache:apache /etc/asterisk/additional_a2billing_iax.conf
# chown -Rf apache:apache /etc/asterisk/additional_a2billing_sip.conf
# chmod 777 /etc/asterisk/additional_a2billing_iax.conf
# chmod 777 /etc/asterisk/additional_a2billing_iax.conf
# touch /etc/asterisk/additional_a2billing_iax.conf
# touch /etc/asterisk/additional_a2billing_sip.conf
# echo '#include additional_a2billing_sip.conf' >> /etc/asterisk/sip.conf
# echo '#include additional_a2billing_iax.conf' >> /etc/asterisk/iax.conf
# chown -Rf apache:apache /etc/asterisk/additional_a2billing_iax.conf
# chown -Rf apache:apache /etc/asterisk/additional_a2billing_sip.conf
# chmod 777 /etc/asterisk/additional_a2billing_iax.conf
# chmod 777 /etc/asterisk/additional_a2billing_iax.conf
-Verification.
-Click "System Settings"> Config Editor> be sure you can see "additional_a2billing_iax.conf" and "additional_a2billing_sip.conf" in the "/etc/asterisk" directory.
-Disable "Asterisk Realtime".
-Click"System Settings">Group List>Global Click "Details" and set the "Use Realtime" value to "NO".
-Configure A2Billing to be aware of Asterisk.
-Click "System settings">Group List>SIP-IAX-INFO Click "Details" and set the "HOST" value to the Asterisk IP address.
-Create a SIP/IAX customer account.
-Click "Customers">Add :: Search>Add Customer and Enter "100" in the "Balance" field and Click "Confirm data".
-Click "Customers">VOIP Settings>Generate SIP:additional_a2billing_sip.conf and Click "Reload your asterisk server".
-Verification.
[root@a2billing mahmouda]# cat /etc/asterisk/additional_a2billing_sip.conf | grep username
username=1561031726
[root@a2billing mahmouda]# cat /etc/asterisk/additional_a2billing_sip.conf | grep secret
secret=4792715831
-Install Ekiga - SIP Phone.
# yum install -y ekiga
Notice:Since we have installed Ekiga and Asterisk on the same VM,we will change the default port of the Ekiga SIP phone to 5061. If you install
Ekiga on another computer, skip this point but don't forget to open port
5060 in your firewall.
# yum install -y gconf-editor
-Change Ekiga default SIP port from 5060 to 5061.
# gconf-editor &
-Click "Apps">Ekiga>Protocols>SIP and Change the value of the "listen_port" from "5060" to "5061".
-Start Ekiga.
# ekiga &
-Configure Ekiga to register with Asterisk using the A2Billing Username and Secret.
-Edit>Accounts>Accounts>Add a SIP account as follows:
-Name:1561031726
-Registrar:Asterisk IP Address
-User:1561031726
-Authentication User:1561031726
-Password:4792715831 Next check the box to activate your account and Click "Close".
Notice:If you tried to register a SIP/IAX phone installed on another OS you should disable the CentOS firewall to accept the incoming SIP/IAX connections.
-Enter the following three commands to disable firewall.
# service iptables save
# service iptables stop
# chkconfig iptables off
# service iptables stop
# chkconfig iptables off