How to configure Yate as IAX server

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Created page with " Yate can be used as IAX server and YateClient as IAX client. Yate/YateClient installed on Mandriva 2010 spring OS. === Why this document=== * to know what modifications m...")
 
(Common issues)
 
(62 intermediate revisions by one user not shown)
Line 1: Line 1:
  
Yate can be used as IAX server and YateClient as IAX client. Yate/YateClient installed on Mandriva 2010 spring OS.
+
Yate can be used as IAX Server and YateClient as IAX Client. This configuration will be done on platforms that have Mandriva 2010 spring OS.
  
 
+
The purpose of this document is:
 
+
=== Why this document===
+
  
 
* to know what modifications must be made for Yate to function as an IAX server.
 
* to know what modifications must be made for Yate to function as an IAX server.
Line 12: Line 10:
 
===Main concepts===
 
===Main concepts===
  
IAX is a VoIP open protocol that uses a single UDP port (usually 4569) for the channel signaling and voice streams. This means 2 major accomplishments:
+
IAX is a VoIP open protocol that uses a single UDP port (usually 4569) for the channel signaling and voice streams. <br>
 +
This means 2 major accomplishments:
  
* [[http://en.wikipedia.org/wiki/Inter-Asterisk_eXchange|minimizes the bandwidth used in media transmissions.]]
+
* [http://en.wikipedia.org/wiki/Inter-Asterisk_eXchange minimizes the bandwidth used in media transmissions]
* [[http://ofps.oreilly.com/titles/9780596517342/asterisk-UnderstandingVoIP.html|provides transparency for easier management when using firewalls and Network Address Translators.]]
+
* [http://ofps.oreilly.com/titles/9780596517342/asterisk-UnderstandingVoIP.html provides transparency for easier management when using firewalls and Network Address Translators]
  
 
[[File:how_IAX_works.png]]
 
[[File:how_IAX_works.png]]
  
You can find out more about IAX using the links in the [[#References|References]] [1 – 2 ] section.
+
You can find out more about IAX using this links: [http://www.rfc-editor.org/rfc/rfc5456.txt IAX2 protocol] and in the [http://www.voip-info.org/wiki/view/IAX IAX page for VoIP info].
 
+
'''Yate''' is the telephony engine, currently focused on VoIP and PSTN.[[#Ref3|'''YateClient [3]''']] is an Instant Messenger and a softphone. It is based on Yate, just like [[#Ref4|'''Freesentral [4]''']].  
+
  
 +
'''[[What is Yate|Yate]]''' is the telephony engine, currently focused on VoIP and PSTN.<br>'''[http://yateclient.yate.ro YateClient]''' is an Instant Messenger and a softphone. It is based on Yate, just like [http://www.freesentral.com Freesentral].
  
 
=== Test situation – scheme and presentation===
 
=== Test situation – scheme and presentation===
  
So this is about me, Ana, and my brother, Alex. We don't want to bother going to each other's room, or screaming at each other around the house. So we thought we'd call each other by means of VoIP. 
 
 
We figured we needed the basics:
 
 
* a functioning telephony service ---> Yate server will provide that in our case, with the proper configuration.
 
* a functioning telephony service ---> Yate server will provide that in our case, with the proper configuration.
 
* two phones ---> we used YateClient for these.
 
* two phones ---> we used YateClient for these.
  
I have a desktop computer in my room, so I used it as the telephony server. Alex has a notebook, he'll connect to the server through YateClient from his notebook.\\
+
[[File:test_scheme.png]]
 
+
%center%Attach:001test_scheme.png%%
+
  
We have the following elements:
+
Elements in Figure2:
[[#Yatetelephonyserver1]]
+
-->(1) – Yate, the telephony server, installed on the desktop computer .
+
[[#Eticheta2]]
+
-->(2) – YateClient1, used by Ana, also installed on the desktop.
+
[[#Eticheta3]]
+
-->(3) – YateClient2, used by Alex, installed on his notebook.
+
  
IAX uses the same UDP port for both signaling and voice. When using the default configuration, both Yate and YateClient use the 4569 port. So, running on the same computer, both will try to secure and use the same port for IAX. To put it simply, two programs need the same resource, and only one will be fully functional.
+
(1) - Yate, the telephony server, installed on a desktop computer.<br>
Thus, we need to modify the configuration of either Yate or YateClient in order for both of them to work at the same time.
+
(2) - YateClient1, installed on the same desktop computer.<br>
 +
(3) - YateClient2, installed on another computer.
  
I decided to let Yate use the default port, and change it for YateClient. Why? Simply because it's easier to use the default ports when configuring your telephony engine. Some protocols generally use certain ports (SIP for example, with 5060/5061).If you change them for your own system, many calls that should work just fine using Yate's default configuration simply won't.
+
'''Note''' IAX uses the same UDP port for both signaling and voice. Running on the same computer, both Yate and YateClient will try to secure and use the same UDP port (4569) for IAX,
 +
when default configuration is used. Two programs need the same resource, and only one will be fully functional.<br>
 +
The configuration must be modified so that Yate and YateClient will work at the same time using different UDP ports.
  
So first of all I needed to set up the server, then the clients. '''When you want to put in place a telephony solution, always start with the server – this ensures you have the core of your communication system.'''
+
Yate will use the default port, so will change the port for YateClient.  
  
[[#SettingYateIAXserver]]
+
So first set up the server, then the clients. '''When you want to put in place a telephony solution, always start with the server – this ensures you have the core of your communication system.'''
  
!!4.Setting Yate as IAX server
+
===Setting Yate as IAX server===
 
 
On my desktop computer, logged as [[#Ref5|'''root [5].''']], I am doing the following steps:
+
On the desktop computer, logged as '''root''', do the following steps:
  
Download Yate from here - http://www.yate.ro/pmwiki/index.php?n=Main.Download
+
Follow the instructions to install Yate on the desktop from [[Installation]] page.
  
(:table border=1 bordercolor=red align=center width=75%:)
+
{|class="wikitable" width="80%"
(:cellnr:)
+
|<br><div style="color:red;text-align:center;"><b>IMPORTANT TIP #1!</b></div><br><font style="text-align:left;">When you install yate on your system, you'll have the necessary files for it to work properly written in several locations:<br><br>Path to shared files directory (/usr/local/share/yate)<br>Path to conf files directory (/usr/local/etc/yate)<br>Path to user files directory (/root/.yate)<br> Path to modules directory (/usr/local/lib/yate)<br><br> (Type “yate -h” in your bash to see more details).<br><br> You can make your own modifications on the default files and run yate with the new configuration.<br><br> It is strongly recommended that you write them on a different location on your computer, for example /usr/local/etc/iaxsrv.<br> Copy the installed version of configuration files, then modify them as you wish. </font>
 +
|}
  
%center% %red%'''IMPORTANT TIP #1!'''%%
+
Make a new directory called '' iaxsrv'' located in '''/usr/local/etc''' to hold your configuration files for the IAX server.
  
When you install yate on your system, you'll have the necessary files for it to work properly written in several locations:
+
Copy the files from '''/usr/local/etc/yate''' to '''/usr/local/etc/iaxsrv'''. <br>
 +
'''Make sure that you rename the configuration file(s) you modify, removing the word "sample". The software functions uses other files (the ones in /usr/local/etc/yate), below you will find the command to give when starting Yate so that the files you configured will be used. So end your new configuration files with ".conf".'''
  
shared files directory (/usr/local/share/yate)
+
Open the '''regfile.conf''' from /usr/local/etc/iaxsrv with any text editor. Find the 2 commented lines looking like this:
conf files directory (/usr/local/etc/yate)
+
user files directory (/home/user/.yate)
+
;[username]
modules directory (/usr/local/lib/yate)
+
;password=something
  
(Type “yate -h” in your bash to see more details).
+
This indicates the way you should add any new users that will connect to your server. The semicolon in front of the row marks a comment - this means that the line will be ignored when the file will be compiled and executed. This is the way to insert new comments in Yate configuration files, with a semicolon in front. See more [http://en.wikipedia.org/wiki/INI_file on configuration files and similar way of placing comments ].
  
You can make your own modifications on the default files and run yate with the new configuration.
+
Add 2 users in the '''regfile.conf''', like this:
 
+
   
It is strongly recommended that you write them on a different location on your computer, say /usr/local/etc/iaxsrv. Copy the installed version of configuration files, then modify them as you wish.
+
  [007]
 
+
  password=pass1
 
+
(:tableend:)
+
[008]
[[<<]]
+
password=pass2
 
+
Install Yate.
+
 
+
Make a directory called [[#Note|%purple% iaxsrv*%%]] located in '''usr/local/etc''' to hold your configuration files for the IAX server.
+
 
+
Copy the files from '''/usr/local/etc/yate''' to '''/usr/local/etc/iaxsrv'''. \\
+
%red%'''Make sure that you rename the configuration file(s) you modify, removing the word "sample". The software functions even if you don't but it uses other files (the ones in &#47;usr&#47;local&#47;etc&#47;yate). So end your new configuration file with ".conf".'''%%
+
 
+
Open the '''regfile.conf''' from /usr/local/etc/iaxsrv with any text editor. Find the 2 commented lines looking like this:
+
  [=
+
;[username]
+
;password=something
+
  =]
+
This indicates the way you should add any new users that will connect to your server. The semicolon in front of the row marks a comment - this means that the line will be ignored when the file will be compiled and executed. This is the way to insert new comments in Yate configuration files, with a semicolon in front. See more [[#Ref6|'''on configuration files and similar way of placing comments [6]''']].
+
 
+
%center%Attach:regfile2users.png%%
+
 
+
Add the 2 users in the regfile.conf, like this (see above):
+
 
+
  [=
+
[007]
+
;this would be Ana's username
+
 
+
password=pass1
+
;this would be Ana's password
+
 
+
[008]
+
;this would be Alex's username
+
 
+
password=pass2
+
;this would be Alex's password
+
=]
+
 
+
As mentioned above, the semicolon in front of a line inside the code means all that is on the line is a comment.
+
  
 
Save the file --> Exit.
 
Save the file --> Exit.
  
  
(:table border=1 bordercolor=red align=center width=75%:)
+
{|class="wikitable" width="80%"
(:cellnr:)
+
|<br><div style="color:red;text-align:center;"><b>IMPORTANT TIP #2!</b></div><br><font style="text-align:left;">To run Yate using the configuration files that you modified, and placed in <br>
 
+
usr/local/etc/iaxsrv, type:<br>$yate -c /usr/local/etc/iaxsrv -v -d -l log_filename <br>Now you'll have yate running as a server with the new configuration files, the rest of the neccessary modules being loaded from their standard location.<br>Strongly recommended:<br>
%center% %red%'''IMPORTANT TIP #2!'''%%
+
When you start Yate, please make a habit of it and use the following options:
 
+
To run Yate using the configuration files that you modified, and placed in usr/local/etc/iaxsrv, type:
+
 
+
$yate -c /usr/local/etc/iaxsrv -v -d -l log_filename  
+
 
+
Now you'll have yate running as a server with the new configuration files, the rest of the neccessary modules being loaded from their standard location.
+
 
+
Strongly recommended:
+
When you start Yate, please make a habit of it and use the following options:
+
 
  -v Verbose debugging (you can use more than once)
 
  -v Verbose debugging (you can use more than once)
 
  -d Daemonify, suppress output unless logged
 
  -d Daemonify, suppress output unless logged
 
  -l filename Log to file
 
  -l filename Log to file
 +
-D[options]            Special debugging options
 +
    t                  Timestamp debugging messages relative to program start
 +
    e                  Timestamp debugging messages based on EPOCH (1-1-1970 GMT)
 +
    f                  Timestamp debugging in GMT format YYYYMMDDhhmmss.uuuuuu
 +
    z                  Timestamp debugging in local timezone YYYYMMDDhhmmss.uuuuuu
  
 +
</font>
 +
|}
  
 +
Using a [http://en.wikipedia.org/wiki/Shell_%28computing%29 command line shell],  run Yate, by typing:
 +
 +
#yate -c /usr/local/etc/iaxsrv -vvvvv -d -l log_filename  -Dt
  
 
+
If you see inside the file ''log_filename'' the following lines:  
(:tableend:)
+
   
[[<<]]
+
Yate (16012) is starting Wed Mar  6 13:18:09 2013
 
+
Loaded module Javascript
 
+
Loaded module ToneDetector
 
+
Loaded module WaveFile
Using a [[#Ref7|'''command line shell [7].''']],  run Yate, by typing:
+
Loaded module YIAX
[=
+
Loaded module CdrFile
$yate -c /usr/local/etc/iaxsrv -v -d -l log_filename
+
Loaded module RManager
=]
+
.....................
 
+
.....................
If you see something similar to the following lines:  
+
Initializing module Late Router
  [=
+
Initializing module Register for database
Yate (13127) is starting Tue Jun 28 17:27:58 2011
+
Initialization complete
Loaded module File Transfer
+
Yate engine is initialized and starting up on localhost.localdomain
Loaded module DumbChannel
+
 
Loaded module MsgSniffer
+
......
+
......
+
Initializing module MGCP Gateway
+
Initializing module SNMP Agent
+
Initializing module Late Router
+
Initialization complete
+
Yate engine is initialized and starting up on localhost.localdomain
+
=]
+
 
+
 
then you have the Yate server running.
 
then you have the Yate server running.
  
Right now, we have [[#Yatetelephonyserver1|(1)]].
+
===Setting the 2 YateClients as IAX client===
  
 +
1. Will we start with the one that is on the same machine as Yate Server:
  
[[#SettingYateClientasIAXclient]]
+
Yate and YateClient have to use different ports at the same time if they are on the same machine. Since Yate uses the default (4569), in YateClient modify configuration file to put a diferent port.
  
!!5.Setting YateClient as IAX client
+
{|class="wikitable" width="80%"
 +
|
 +
<br><div style="color:red;text-align:center;"><b>IMPORTANT TIP #3</b></div>When you choose a certain port to allocate it for IAX communication with YateClient, make sure that the port isn't used by another process.<br><br>You can do that by typing in a shell:<br> # netstat -nan | grep xxxx <br>where xxxx is the number of the port.  If you don't get a return, the port is available.<br><br>It is better to use a number between 1023 and 65535, as the [http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers first 1024 (0 ... 1023) are used by system processes ]
 +
|}
  
Now we begin to set up the YateClient on the same computer that has Yate running. \\
+
This is a very specific situation, when Yate server and YateClient work on the same computer.  
\\
+
The reason for which it isn't needed to install YateClient separately: running YateClient means you run Yate with a graphical interface, and more functionalities (like instant messenger). So just customize the configuration file that regulates what port YateClient should use for IAX protocol.  
As I mentioned in [[#Testsituation|chapter 3]], we need to make sure that Yate and YateClient use different ports at the same time. Since Yate uses the default (4569), I specifically edited the configuration file for YateClient to choose another one.
+
  
[[#Importanttip3]]
+
Make a directory called '''yateclient1''' located in '''usr/local/etc''' to hold your configuration files for the IAX client.
(:table border=1 bordercolor=red align=center width=75%:)
+
(:cellnr:)
+
  
%center% %red% '''IMPORTANT TIP #3'''%%
+
Copy the files from '''/usr/local/etc/yate''' to '''/usr/local/etc/yateclient1'''<br>
 
+
When you choose a certain port to allocate it for IAX communication with YateClient, make sure that the port isn't used by another process.
+
 
+
You can do that by typing in a shell:
+
[=
+
# netstat -nan | grep xxxx
+
=]
+
where xxxx is the number of the port.  If you don't get a return, the port is available.
+
 
+
It is better to use a number between 1023 and 65535, as the [[http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers|first 1024 (0 ... 1023) are used by system processes [Ref.8].]]
+
 
+
(:tableend:)
+
[[<<]]
+
 
+
Considering I already installed Yate on my desktop, I can use the files that are already there. This is a very specific situation, when Yate server and YateClient work on the same computer.
+
The reason for which I don't need to install YateClient separately is the following: running YateClient means you run Yate with a graphical interface, and more functionalities (like instant messenger). So I just need to customize the configuration file that regulates what port YateClient should use for IAX protocol.
+
 
+
Make a directory called %purple%'''yateclient1*'''%% located in '''usr/local/etc''' to hold your configuration files for the IAX client.
+
 
+
Copy the files from '''/usr/local/etc/yate''' to '''/usr/local/etc/%purple%yateclient1'''%%. \\
+
%red%'''Make sure that you rename the configuration file(s) you modify, removing the word "sample". The software functions even if you don't but it uses other files (the ones in &#47;usr&#47;local&#47;etc&#47;yate). So end your new configuration file with ".conf".'''%%
+
  
 
Open the yiaxchan.conf from '''/usr/local/etc/yateclient1''' with any text editor.  
 
Open the yiaxchan.conf from '''/usr/local/etc/yateclient1''' with any text editor.  
  
 
Find these lines in the file:  
 
Find these lines in the file:  
  [=
+
;port: int: UDP port for incoming connections
+
  [general]
;port=4569
+
;port: int: UDP port for incoming connections
  =]
+
;port=4569
 
+
   
Remove the semicolon from the line “port=4569” and replace the number with the UDP port that you checked beforehand if it's available (see [[#Importanttip3|important tip #3]] from above), like this:
+
Remove the semicolon from the line “port=4569” and replace the number with the UDP port that you checked beforehand if it's available (see <font color="red">IMPORTANT TIP #3</font> from above), like this:
  [=
+
   
port=4672
+
port=4693
;for example
+
=]
+
 
+
%center%Attach:yiaxchan.png%%
+
  
 
Save the file --> Exit.
 
Save the file --> Exit.
  
(:table border=1 bordercolor=red align=center width=75%:)
+
{|class="wikitable" width="80%"
(:cellnr:)
+
|<br><div style="color:red;text-align:center;">'''IMPORTANT TIP #4'''</div><br>To run YateClient using the configuration files that you modified, and placed in usr/local/etc/yateclient1, type: <br>#yate-qt4 -c usr/local/etc/yateclient1<br><br>
 
+
|}
%center% %red% '''IMPORTANT TIP #4'''
+
 
+
To run YateClient using the configuration files that you modified, and placed in usr/local/etc/yateclient1, type:  
+
[=
+
$yate-qt4 -c usr/local/etc/yateclient1
+
=]
+
  
 
Now you'll have YateClient running using the new configuration files, the rest of the neccessary modules being loaded from their standard location.
 
Now you'll have YateClient running using the new configuration files, the rest of the neccessary modules being loaded from their standard location.
 
Next, the graphical interface will appear and you'll be able to log in.  
 
Next, the graphical interface will appear and you'll be able to log in.  
  
(:tableend:)
+
Run YateClient from a shell
[[<<]]
+
  
Run YateClient from a shell , by typing the command suggested above (%red%'''important tip #4'''%%):
+
#yate-qt4 -c usr/local/etc/yateclient1
[=
+
   
$yate-qt4 -c usr/local/etc/yateclient1
+
  =]
+
 
You'll see similar messages for the Yate server, just that the final one should be:
 
You'll see similar messages for the Yate server, just that the final one should be:
  [=
+
 
Yate client engine is initialized and starting up on localhost.localdomain  
+
  Yate client engine is initialized and starting up on localhost.localdomain  
=]
+
  
 
and then the graphical interface will appear.
 
and then the graphical interface will appear.
 
Setting up the second YateClient on a different computer is easier because you just download and install it. There is no conflict with Yate telephony server on the same computer resources, so you don't change its configuration.
 
 
So right now we also have (2) and (3):
 
 
->%center%Attach:01IAX_configuration.png%%
 
 
[[#TestingYateClientwithYate]]
 
 
!!6.Testing YateClient with Yate
 
 
So right now we have all the elements from our scheme. Just to make sure that everything works so far, we should test if YateClient works with Yate.
 
 
Start Yate on the desktop with the following command:
 
[=
 
$yate -c /usr/local/etc/iaxsrv -v -d -l log_filename
 
 
=]
 
 
Start YateClient:
 
[=
 
$yate-qt4 -c usr/local/etc/yateclient1
 
=]
 
  
 
Click Yate Main Menu --> Add account and log in with your account, let's say 007:
 
Click Yate Main Menu --> Add account and log in with your account, let's say 007:
(:table border=0 align=left :)
 
(:cellnr :)
 
-->Attach:AddAccountWindow.png
 
(:cell valign=middle:)
 
  
Username: 007 \\
+
[[File:YC_account_IAX.png]]
Password: 008 \\
+
Server: _''your_local_IP''_
+
(:tableend:)
+
[[<<]]
+
  
You can see in more detail how to use multiple accounts with Yateclient on its homepage:\\
+
With this parameters:<br>
http://yateclient.yate.ro/index.php/UserGuide/GettingStarted
+
Username: 007 <br>
 +
Password: pass1 <br>
 +
Server: _''IP''_: is the IP of the machine where Yate Server was installed
  
 
Check if your account is “online” – go to YateClient Main Window --> Settings --> Accounts. The 007 account should be listed like this:
 
Check if your account is “online” – go to YateClient Main Window --> Settings --> Accounts. The 007 account should be listed like this:
  
%center%Attach:online_acc.jpeg%%
+
[[File:account_online.jpeg]]
  
 
From the telephony tab, dial one of the following (what you should hear in your headphones is listed next to the number): 99991001 (dial tone), 99991002 (busy tone), 99991003 (ring tone).
 
From the telephony tab, dial one of the following (what you should hear in your headphones is listed next to the number): 99991001 (dial tone), 99991002 (busy tone), 99991003 (ring tone).
Line 296: Line 182:
 
What happens right now between YateClient and Yate is this:  
 
What happens right now between YateClient and Yate is this:  
  
when the online user %color=#00FF00%'''007'''%% tries to call 99991001, for example, YateClient sends a signal to Yate (%color=#00FF00%'''Signalling'''%%).  
+
when the online user '''007''' tries to call 99991001, for example, YateClient sends a signal to Yate '''Signalling'''.  
Yate receives the signal on 4569 port, finds the destination and replies to the port from where it got the signal with the corresponding tone (%color=#008000%'''Audio/Voice'''%%).  
+
Yate receives the signal on 4569 port, finds the destination and replies to the port from where it got the signal with the corresponding tone '''Audio/Voice'''.
  
[[#MakingtheIAXcall]]
+
2. Setting up the second YateClient on a different computer is easier because you just download and install it. There is no conflict with Yate telephony server on the same computer resources, so you don't change its configuration. So after you installed YateClient, run it with a similar command as the one above and add account 008, in the same way as for the other account set above.
  
!!7.Making the IAX call
+
So right now we also have (2) and (3) the 2 YateClients set with their accounts registered:
  
Considering that you completed all the stages listed above without errors, right now 007 can call 008. \\
+
[[File:IAX_configuration.png]]
 +
 
 +
===Making the IAX call===
 +
 
 +
Considering that you completed all the stages listed above without errors, right now 007 can call 008. <br>
 
'''No routing is required''' - as the whole process of call negotiation and establishing the connection is solved by the server, Yate, internally.
 
'''No routing is required''' - as the whole process of call negotiation and establishing the connection is solved by the server, Yate, internally.
  
 
Let's go over again through the steps:
 
Let's go over again through the steps:
-->1 – Yate server must be ran first (as root).
+
# – Yate server must ran first (as root).
-->2 – YateClient1 and 2 can be ran in any order, once the server is on.
+
# – YateClient1 and 2 can ran in any order, once the server is on.
-->3 – Logg on the users.  
+
# – Logg on the users.  
-->4 – Call.
+
# – Call.
  
->%center%Attach:02IAX_finalcall.png%%
+
[[File:IAX_finalcall.png]]
  
Things happen in this order, once everything is running: \\
+
Things happen in this order, once everything is running: <br>
'''007 loggs to Yate''' --> '''Yate associates 007 with UDP 4672'''\\
+
'''007 loggs to Yate''' --> '''Yate associates 007 with UDP 4693'''<br>
'''008 loggs to Yate''' --> '''Yate associates 008 with UDP 4569 from its machine''' \\
+
'''008 loggs to Yate''' --> '''Yate associates 008 with UDP 4569 from its machine'''<br>
  
'''007 calls 008''' is made up by: \\
+
'''007 calls 008''' is made up by: <br>
007 --> Yate \\
+
007 --> Yate <br>
Yate --> 008 \\
+
Yate --> 008 <br>
so we have '''007 <------> 008'''
+
so we have '''007 <------> 008'''
  
[[#Commonissues]]
+
===Common issues===
  
!!8.Common issues
+
Obviously, lots of things can go wrong. I can only tell you of the ones I encountered.  
  
Obviously, lots of things can go wrong. I can only tell you of the ones I encountered. \\
+
:a) User is not authenticated.
  
-->a) User is not authenticated.
+
:b) You cannot hear the dialtone when testing
  
-->b) You cannot hear the dialtone when testing ([[#TestingYateClientwithYate|chapter 6]]).
+
:c) Users are logged, but the call doesn't go through.
 
+
-->c) Users are logged, but the call doesn't go through.\\
+
  
 
These problems can have various solutions. For detailed troubleshooting, please make sure you use the “-v” option when you run Yate and YateClient. It shows the messages passed on between the internal modules.  
 
These problems can have various solutions. For detailed troubleshooting, please make sure you use the “-v” option when you run Yate and YateClient. It shows the messages passed on between the internal modules.  
This shows you the settings you need to change in the configuration files in order to make it work.
+
This shows you the settings you need to change in the configuration files in order to make it work.
 
+
 
+
 
+
[[#Note]]
+
 
+
%purple%'''Note*:'''%%\\
+
The name in itself is not ''that'' important.
+
What '''IS''': the configuration files you modify should be in a different location than the default ones.
+
  
  
[[#References]]
+
'''See also'''
  
'''References'''
+
* [[IAX| IAX Module]]
 +
* [[How To's]]
  
'''[1].''' IAX2 protocol published by RFC Editor: http://www.rfc-editor.org/rfc/rfc5456.txt\\
+
[[Category:IAX]] [[Category:Server]] [[Category:Client]]
'''[2].''' The IAX page on voip-info: http://www.voip-info.org/wiki/view/IAX\\
+
[[#Ref3]]'''[3].'''YateClient main page: http://yateclient.yate.ro/ \\
+
[[#Ref4]]'''[4].'''Freesentral main page: http://www.freesentral.com/ \\
+
[[#Ref5]]'''[5].'''Superuser account for system administration: http://en.wikipedia.org/wiki/Superuser \\
+
[[#Ref6]]'''[6].'''On configuration files and comments similar to the ones found in Yate: http://en.wikipedia.org/wiki/INI_file\\
+
[[#Ref7]]'''[7].'''Command line shell: http://en.wikipedia.org/wiki/Shell_%28computing%29 \\
+
'''[8].'''List of port numbers in use: http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
+

Latest revision as of 17:13, 31 October 2013

Yate can be used as IAX Server and YateClient as IAX Client. This configuration will be done on platforms that have Mandriva 2010 spring OS.

The purpose of this document is:

  • to know what modifications must be made for Yate to function as an IAX server.
  • to be able to configure YateClient as an IAX client.
  • to use Yate as a telephony engine, as it knows several widely spread protocols (IAX, SIP and H.323, just to mention 3).

Contents

[edit] Main concepts

IAX is a VoIP open protocol that uses a single UDP port (usually 4569) for the channel signaling and voice streams.
This means 2 major accomplishments:

How IAX works.png

You can find out more about IAX using this links: IAX2 protocol and in the IAX page for VoIP info.

Yate is the telephony engine, currently focused on VoIP and PSTN.
YateClient is an Instant Messenger and a softphone. It is based on Yate, just like Freesentral.

[edit] Test situation – scheme and presentation

  • a functioning telephony service ---> Yate server will provide that in our case, with the proper configuration.
  • two phones ---> we used YateClient for these.

Test scheme.png

Elements in Figure2:

(1) - Yate, the telephony server, installed on a desktop computer.
(2) - YateClient1, installed on the same desktop computer.
(3) - YateClient2, installed on another computer.

Note IAX uses the same UDP port for both signaling and voice. Running on the same computer, both Yate and YateClient will try to secure and use the same UDP port (4569) for IAX,
when default configuration is used. Two programs need the same resource, and only one will be fully functional.
The configuration must be modified so that Yate and YateClient will work at the same time using different UDP ports.

Yate will use the default port, so will change the port for YateClient.

So first set up the server, then the clients. When you want to put in place a telephony solution, always start with the server – this ensures you have the core of your communication system.

[edit] Setting Yate as IAX server

On the desktop computer, logged as root, do the following steps:

Follow the instructions to install Yate on the desktop from Installation page.


IMPORTANT TIP #1!

When you install yate on your system, you'll have the necessary files for it to work properly written in several locations:

Path to shared files directory (/usr/local/share/yate)
Path to conf files directory (/usr/local/etc/yate)
Path to user files directory (/root/.yate)
Path to modules directory (/usr/local/lib/yate)

(Type “yate -h” in your bash to see more details).

You can make your own modifications on the default files and run yate with the new configuration.

It is strongly recommended that you write them on a different location on your computer, for example /usr/local/etc/iaxsrv.
Copy the installed version of configuration files, then modify them as you wish.

Make a new directory called iaxsrv located in /usr/local/etc to hold your configuration files for the IAX server.

Copy the files from /usr/local/etc/yate to /usr/local/etc/iaxsrv.
Make sure that you rename the configuration file(s) you modify, removing the word "sample". The software functions uses other files (the ones in /usr/local/etc/yate), below you will find the command to give when starting Yate so that the files you configured will be used. So end your new configuration files with ".conf".

Open the regfile.conf from /usr/local/etc/iaxsrv with any text editor. Find the 2 commented lines looking like this:

;[username]
;password=something

This indicates the way you should add any new users that will connect to your server. The semicolon in front of the row marks a comment - this means that the line will be ignored when the file will be compiled and executed. This is the way to insert new comments in Yate configuration files, with a semicolon in front. See more on configuration files and similar way of placing comments .

Add 2 users in the regfile.conf, like this:

[007]
password=pass1

[008]
password=pass2

Save the file --> Exit.



IMPORTANT TIP #2!

To run Yate using the configuration files that you modified, and placed in

usr/local/etc/iaxsrv, type:
$yate -c /usr/local/etc/iaxsrv -v -d -l log_filename
Now you'll have yate running as a server with the new configuration files, the rest of the neccessary modules being loaded from their standard location.
Strongly recommended:

When you start Yate, please make a habit of it and use the following options:
-v 			 Verbose debugging (you can use more than once)
-d 			 Daemonify, suppress output unless logged
-l filename 	 	 Log to file
-D[options]             Special debugging options
    t                   Timestamp debugging messages relative to program start
    e                   Timestamp debugging messages based on EPOCH (1-1-1970 GMT)
    f                   Timestamp debugging in GMT format YYYYMMDDhhmmss.uuuuuu
    z                   Timestamp debugging in local timezone YYYYMMDDhhmmss.uuuuuu

Using a command line shell, run Yate, by typing:

#yate -c /usr/local/etc/iaxsrv -vvvvv -d -l log_filename  -Dt

If you see inside the file log_filename the following lines:

Yate (16012) is starting Wed Mar  6 13:18:09 2013
Loaded module Javascript
Loaded module ToneDetector
Loaded module WaveFile
Loaded module YIAX
Loaded module CdrFile
Loaded module RManager
.....................
.....................
Initializing module Late Router
Initializing module Register for database
Initialization complete
Yate engine is initialized and starting up on localhost.localdomain
 

then you have the Yate server running.

[edit] Setting the 2 YateClients as IAX client

1. Will we start with the one that is on the same machine as Yate Server:

Yate and YateClient have to use different ports at the same time if they are on the same machine. Since Yate uses the default (4569), in YateClient modify configuration file to put a diferent port.


IMPORTANT TIP #3
When you choose a certain port to allocate it for IAX communication with YateClient, make sure that the port isn't used by another process.

You can do that by typing in a shell:
# netstat -nan | grep xxxx
where xxxx is the number of the port. If you don't get a return, the port is available.

It is better to use a number between 1023 and 65535, as the first 1024 (0 ... 1023) are used by system processes

This is a very specific situation, when Yate server and YateClient work on the same computer. The reason for which it isn't needed to install YateClient separately: running YateClient means you run Yate with a graphical interface, and more functionalities (like instant messenger). So just customize the configuration file that regulates what port YateClient should use for IAX protocol.

Make a directory called yateclient1 located in usr/local/etc to hold your configuration files for the IAX client.

Copy the files from /usr/local/etc/yate to /usr/local/etc/yateclient1

Open the yiaxchan.conf from /usr/local/etc/yateclient1 with any text editor.

Find these lines in the file:

[general]
;port: int: UDP port for incoming connections
;port=4569

Remove the semicolon from the line “port=4569” and replace the number with the UDP port that you checked beforehand if it's available (see IMPORTANT TIP #3 from above), like this:

port=4693

Save the file --> Exit.


IMPORTANT TIP #4

To run YateClient using the configuration files that you modified, and placed in usr/local/etc/yateclient1, type:
#yate-qt4 -c usr/local/etc/yateclient1

Now you'll have YateClient running using the new configuration files, the rest of the neccessary modules being loaded from their standard location. Next, the graphical interface will appear and you'll be able to log in.

Run YateClient from a shell

#yate-qt4 -c usr/local/etc/yateclient1

You'll see similar messages for the Yate server, just that the final one should be:

Yate client engine is initialized and starting up on localhost.localdomain 

and then the graphical interface will appear.

Click Yate Main Menu --> Add account and log in with your account, let's say 007:

YC account IAX.png

With this parameters:
Username: 007
Password: pass1
Server: _IP_: is the IP of the machine where Yate Server was installed

Check if your account is “online” – go to YateClient Main Window --> Settings --> Accounts. The 007 account should be listed like this:

Account online.jpeg

From the telephony tab, dial one of the following (what you should hear in your headphones is listed next to the number): 99991001 (dial tone), 99991002 (busy tone), 99991003 (ring tone).

These are numbers defined for testing purposes and you can find all of them in the regexroute.conf" file. When you call one of these, you'll get a standard telephony tone.

What happens right now between YateClient and Yate is this:

when the online user 007 tries to call 99991001, for example, YateClient sends a signal to Yate Signalling. Yate receives the signal on 4569 port, finds the destination and replies to the port from where it got the signal with the corresponding tone Audio/Voice.

2. Setting up the second YateClient on a different computer is easier because you just download and install it. There is no conflict with Yate telephony server on the same computer resources, so you don't change its configuration. So after you installed YateClient, run it with a similar command as the one above and add account 008, in the same way as for the other account set above.

So right now we also have (2) and (3) the 2 YateClients set with their accounts registered:

IAX configuration.png

[edit] Making the IAX call

Considering that you completed all the stages listed above without errors, right now 007 can call 008.
No routing is required - as the whole process of call negotiation and establishing the connection is solved by the server, Yate, internally.

Let's go over again through the steps:

  1. – Yate server must ran first (as root).
  2. – YateClient1 and 2 can ran in any order, once the server is on.
  3. – Logg on the users.
  4. – Call.

IAX finalcall.png

Things happen in this order, once everything is running:
007 loggs to Yate --> Yate associates 007 with UDP 4693
008 loggs to Yate --> Yate associates 008 with UDP 4569 from its machine

007 calls 008 is made up by:
007 --> Yate
Yate --> 008
so we have 007 <------> 008

[edit] Common issues

Obviously, lots of things can go wrong. I can only tell you of the ones I encountered.

a) User is not authenticated.
b) You cannot hear the dialtone when testing
c) Users are logged, but the call doesn't go through.

These problems can have various solutions. For detailed troubleshooting, please make sure you use the “-v” option when you run Yate and YateClient. It shows the messages passed on between the internal modules. This shows you the settings you need to change in the configuration files in order to make it work.


See also

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers