Beginners in Yate

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Test the setup)
 
(50 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[What is Yate|Yate]] (acronym for Yet Another Telephony Engine) is a next-generation telephony engine, is a free and open source communications software with support for video, voice and instant messaging.
 
  
Based on Voice over Internet Protocol (VoIP) and PSTN, it can easily be extended. It supports SIP, H.323, IAX, MGCP, Jingle, Jabber, E1, T1, analogic, ISDN PRI, BRI, and SS7.
+
[[What is Yate|Yate]] (acronym for Yet Another Telephony Engine) is a next-generation telephony engine, is a free and open source communications software with support for video, voice and instant messaging. <br>
 +
Based on Voice over Internet Protocol (VoIP) and PSTN, it can easily be extended. It supports SIP, H.323, IAX, MGCP, Jingle, Jabber, E1, T1, analogic, ISDN PRI, BRI, and SS7.<br>
 
<!--YateClient is an Instant Messenger and Voice application for Jabber/Jingle IM, SIP, H.323, and IAX VoIP protocols.-->
 
<!--YateClient is an Instant Messenger and Voice application for Jabber/Jingle IM, SIP, H.323, and IAX VoIP protocols.-->
It is written in C++, having in mind a modular [[Yate Design| design]], allowing the use of scripting languages like Perl, Python or PHP to create external functionalities.
+
It is written in C++, having in mind a modular [[Yate Design| design]], allowing the use of scripting languages like Perl, Python or PHP to create external functionalities.<br>
 +
 
 +
'''Note''' The instructions below are suitable for linux platforms.
 +
For other platforms go to [[Download]] page and follow the instructions from there.
 +
After you install Yate you can skip chapter [[#How to get Yate source from SVN|How to get Yate source from SVN]] and go to chapter [[#Configuration Files|Configuration Files]].
  
 
==How to get Yate source from SVN==
 
==How to get Yate source from SVN==
Line 16: Line 20:
  
 
As root go to /usr/src or where ever you'd like to store source code.
 
As root go to /usr/src or where ever you'd like to store source code.
Once you have the svn client installed getting the sources is a simple command:
+
Once you have the svn client installed, getting the sources is a simple command:
 
   
 
   
 
  svn checkout http://voip.null.ro/svn/yate/trunk yate-SVN
 
  svn checkout http://voip.null.ro/svn/yate/trunk yate-SVN
Line 40: Line 44:
 
*to run in debug mode:
 
*to run in debug mode:
  
./run -vvvvvv  
+
./run -vvvvvv  
  
 
*to run in the daemon mode:  
 
*to run in the daemon mode:  
  
./run -d  
+
./run -d
 +
 
 +
For more details about what parameters that can be set when Yate starts you can give command
 +
 
 +
./run --help
 +
 
 +
As an advice for debbuging purpose run Yate with this parameters:
 +
 
 +
  -v Verbose debugging (you can use more than once)
 +
  -d Daemonify, suppress output unless logged
 +
  -l filename Log to file
 +
  -Dt                    Timestamp debugging messages relative to program start
  
 
== Configuration Files==
 
== Configuration Files==
Line 50: Line 65:
 
The files that you can configure are in /usr/src/yate-SVN/conf.d.
 
The files that you can configure are in /usr/src/yate-SVN/conf.d.
  
Each file has a .sample termination. You have to create a a new file with the same name but with .conf.
+
'''Note''' Each file has a .sample termination. You have to create a new file with the same name but with .conf.
  
 
Each parameter in the files have a section that is in brackets. Comment in this files are done by using ''';'''.
 
Each parameter in the files have a section that is in brackets. Comment in this files are done by using ''';'''.
Line 56: Line 71:
 
===Adding Users===
 
===Adding Users===
  
You'll have to edit '''[[Register|regfile.conf]]''' to add users.
+
Go to /usr/src/yate-SVN/conf.d where Yate was installed and rename regfile.conf.sample into regfile.conf.<br>
If you want to add user 100 with password 001, you need to add this:
+
Then edit '''[[Regfile|regfile.conf]]''' to add users.<br>
 +
We are going to add 2 users:user 100 with password 001 and user 200 with password 002 like this:
  
 
  [100]
 
  [100]
Line 64: Line 80:
 
  [200]
 
  [200]
 
  password=002
 
  password=002
 +
 +
There is another way of adding users if you wish to use a database, the file to use is [[Register|register.conf]].
  
 
===SIP Configuration===
 
===SIP Configuration===
  
'[[SIP Configuration File|ysipchan.conf]]' has two sections. In [general] section you can define the listening port and IP address to bind to. Also you can enable/disable user registration.
+
The file used is [[SIP Configuration File|ysipchan.conf]]. No configuration is needed in this file because by default Yate will bind with all the network interfaces on your server on port 5060. If other programs use this port then you have to use another free port and put it in [general] section.
  
Section [codecs] is used to configure codecs:
+
===Routing===
  
[codecs]
+
There is no need to define any routing for registered SIP users on the machine. Yate will know to route calls between the users defined in regfile.conf.
+
; This section allows to individually enable or disable the codecs
+
+
default=off
+
mulaw=yes
+
alaw=yes
+
  
===Routing===
+
To add authentication requirement for all inbound calls add in the [[Regular expressions|regexroute.conf]] file:
  
To define routing to other registered users, PSTN, gateways we need to edit 'regexroute.conf'.
+
[default]
 +
${username}^$=-;error=noauth
  
There is no need to define any routing for registered SIP users on the same machine.
+
To define routing to other registered users, PSTN, gateways you need to edit [[Regular expressions|regexroute.conf]]. <br>
 +
To register users in a database you can use [[Register|register.conf]]. And then make your route rules in [[Regular expressions|regexroute.conf]].
  
 
==Configure phones ==
 
==Configure phones ==
Line 92: Line 106:
 
== Test the setup==
 
== Test the setup==
  
Make a call from one phone to the other.
+
If Yate is running when you change the configuration file, you need to [[Stopping and restarting Yate|reload Yate]] for the changes to become effective.
 +
 
 +
From the phone, dial one of the following:
 +
 
 +
99991001 - you should hear dial tone
 +
99991002 - you should hear busy tone
 +
99991003 - you should hear ring tone
 +
 
 +
These numbers are defined for testing purposes and you can find all of them in the "regexroute.conf" file. When you call one of these numbers, you get a standard telephony tone.
 +
 
 +
Then make a call from one phone to the other and check the audio: if you cannot hear the other end then you may have a NAT problem.
 +
 
 +
Also to see the flow of the messages, use a telnet client. Connect like this:
 +
 
 +
telnet localhost 5038
 +
 
 +
And write next commands to enable the debug and color the output:
 +
 
 +
debug on
 +
color on
 +
 
 +
Then make the call and watch SIP messages flow.
 +
 
 +
 
 +
'''See also'''
 +
 
 +
* [[Starting Yate]]
 +
* [[Stopping and restarting Yate]]
 +
 
 +
[[Category:Beginners]]

Latest revision as of 15:05, 10 March 2015

Yate (acronym for Yet Another Telephony Engine) is a next-generation telephony engine, is a free and open source communications software with support for video, voice and instant messaging.
Based on Voice over Internet Protocol (VoIP) and PSTN, it can easily be extended. It supports SIP, H.323, IAX, MGCP, Jingle, Jabber, E1, T1, analogic, ISDN PRI, BRI, and SS7.
It is written in C++, having in mind a modular design, allowing the use of scripting languages like Perl, Python or PHP to create external functionalities.

Note The instructions below are suitable for linux platforms.
For other platforms go to Download page and follow the instructions from there.
After you install Yate you can skip chapter How to get Yate source from SVN and go to chapter Configuration Files.

Contents

[edit] How to get Yate source from SVN

Since you are going the full process of fetching and building Yate you will need the following:

  • Basic software development tools:
    • The Gnu make program (it won't build with the BSD make)
    • The C++ compiler of the Gnu suite (gcc/g++) and its libraries
    • The autoconf configuration script builder
  • A subversion (svn) client

As root go to /usr/src or where ever you'd like to store source code. Once you have the svn client installed, getting the sources is a simple command:

svn checkout http://voip.null.ro/svn/yate/trunk yate-SVN
cd yate-SVN

First command will fetch a copy of the SVN TRUNK (where the code is committed) in a new directory called yate-SVN. The second command will change your current directory to the Yate sources directory.

For more information go to page Installation.

[edit] How to compile

To generate configure file run this, then configure the source code:

./autogen.sh
./configure

compile it:

make

[edit] How to run

  • to run in debug mode:
./run -vvvvvv 
  • to run in the daemon mode:
./run -d

For more details about what parameters that can be set when Yate starts you can give command

./run --help

As an advice for debbuging purpose run Yate with this parameters:

 -v 			Verbose debugging (you can use more than once)
 -d 			Daemonify, suppress output unless logged
 -l filename 	 	Log to file
 -Dt                    Timestamp debugging messages relative to program start

[edit] Configuration Files

The files that you can configure are in /usr/src/yate-SVN/conf.d.

Note Each file has a .sample termination. You have to create a new file with the same name but with .conf.

Each parameter in the files have a section that is in brackets. Comment in this files are done by using ;.

[edit] Adding Users

Go to /usr/src/yate-SVN/conf.d where Yate was installed and rename regfile.conf.sample into regfile.conf.
Then edit regfile.conf to add users.
We are going to add 2 users:user 100 with password 001 and user 200 with password 002 like this:

[100]
password=001

[200]
password=002

There is another way of adding users if you wish to use a database, the file to use is register.conf.

[edit] SIP Configuration

The file used is ysipchan.conf. No configuration is needed in this file because by default Yate will bind with all the network interfaces on your server on port 5060. If other programs use this port then you have to use another free port and put it in [general] section.

[edit] Routing

There is no need to define any routing for registered SIP users on the machine. Yate will know to route calls between the users defined in regfile.conf.

To add authentication requirement for all inbound calls add in the regexroute.conf file:

[default]
${username}^$=-;error=noauth

To define routing to other registered users, PSTN, gateways you need to edit regexroute.conf.
To register users in a database you can use register.conf. And then make your route rules in regexroute.conf.

[edit] Configure phones

You have to configure the users from regfile on two SIP phone (you could use a SIP softphone as well) to call Yate Server.

[edit] Test the setup

If Yate is running when you change the configuration file, you need to reload Yate for the changes to become effective.

From the phone, dial one of the following:

99991001 - you should hear dial tone
99991002 - you should hear busy tone
99991003 - you should hear ring tone

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

Then make a call from one phone to the other and check the audio: if you cannot hear the other end then you may have a NAT problem.

Also to see the flow of the messages, use a telnet client. Connect like this:

telnet localhost 5038

And write next commands to enable the debug and color the output:

debug on 
color on

Then make the call and watch SIP messages flow.


See also

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers