|
Home Resources Products
Developers |
Main • WildfiresNotes
Getting started with YateWhen I first attempted to setup and configure YATE, I ran into a lot of problems. I was fortunate enough that the great people on #yate channel from irc.freenode.net server, were willing to assist me. Rather than let their helpfulness go to waste, I've compiled my questions and their answers into a set of crib notes that I hope can assist you as well. Initial setup of YATEThere are many different yate to setup YATE. Compiling it yourself, using a distribution provided set of packages, etc. These notes are not dependant on how you have installed things. Some initial assumptionsIf you installed YATE from a package, familiarise yourself with the mechanism to restart it. After each configuration change you should restart the YATE server to be sure they have taken effect. If you have compiled YATE yourself, the ./run script in the compilation directory can be Ctrl-C'd to stop YATE. Initial testing (of audio)My usage sceanario is SIP devices calling into YATE and it determing where to send the call. So when I say "dial in", I've configured a SIP phone (in my case an actual SIP phone, but I assume you could also use a SIP softphone as well) to call my server. Initially I wanted to be sure that I had the hardphone and YATE working properly. For me that means, I wanted to know that audio was properly functioning. The simplest way to do that was to play a tone whenever a call came in. The following line: .*=tone/busy located at the end of [default] section of the regexroute.conf file says: whatever is coming in, send it to a busy signal. When I attempted to "dial in" to the YATE server, I could see the SIP messages but I could not hear anything. After some SIP call log analysis, it appeared that RTP was not being handled properly. Try modifying regexroute.conf to be:
${rtp_forward}possible=;rtp_forward=yes
.*=tone/busy
This worked for me and I was able to hear audio. Modifying call informationMy next task was to use YATE to route the SIP phone to another SIP device. In to properly do this, I had to modify the sending information. Initially the SIP message looked like (anonymised): INVITE sip:voicemail@example.com SIP/2.0 From: "stuff" <sip:random@10.0.0.1>;tag=108375482 To: <sip:voicemail@example.com> What I wanted to do, was change it into: INVITE sip:voicemail@example.com SIP/2.0 From: <sip:originator@10.0.0.1>;tag=1402492972 To: <sip:voicemail@example.com> To change "stuff" into something else, or remove it entirely, you can use the callername property. To change 'random' into 'originator' you set the caller property. Combining these together gives you: ^voicemail$=sip/sip:voicemail@example.com;caller=originator; \ callername= which you can place in regexroute.conf Slow devicesI discovered that a few times I'd call my voicemail machine and YATE would go ahead and cancel the session just prior to establishing it. It turned out that that the voicemail machine was somewhat loaded and things were not responding in time. For each call that YATE initiates, it starts two timers: maxcall and timeout. Timeout runs for the overall length of the call. Whereas is maxcall is how long YATE will wait until the other side responds. Both parameters are in units of milliseconds. So, to wait up to 10 seconds before cancelling the call to the voicemail system, we can change our line in regexroute.conf to be: ^voicemail$=sip/sip:voicemail@example.com;caller=originator; \ callername=;maxcall=10000 Not letting things go on foreverSometime the devices will be slow and sometimes the people using those devices will be slow (at talking). If you wish you can constrain the duration of a call as well. This is known as the timeout. So, to not let people leave voicemails longer than 180 seconds (3 minutes) you would have: ^voicemail$=sip/sip:voicemail@example.com;caller=originator; \ callername=;maxcall=10000,timeout=180000 A higher level viewIf you been following along with the changes being made here, all to regexroute.conf by the way, you may have realised that the generic pattern in the file is: pattern=target;param=value;param=value The pattern is evaluated by the regex code and each paramter is then set and a routing call is made to the target. The first part of the target tells the regexmodule which router to contact. TerminationSo far, we've been playing tones and modifying calls coming through the system so that ended up in a voicemail server. That is interesting and useful but a telephony server, like YATE, can allow us to so much more. Like, connecting client to other parties. For this you need to be able to take a call and 'terminate' it closer to the person you want to call. Termination might be to a VoIP provider, or it might be back out to the PSTN or, even, to a mobile phone. Often being able to terminate will require some exchange of many. If you'd like to test this out, but don't have money, I suggest you open a FWD account -- most of the below applies just as readily to a VoIP termination provider (like FWD) as it does to a PSTN termination provider. Wherefor art thou, mine configuration?When you installed YATE, there were a lot of configuration files installed (and possible samples) along with it. If your terminator requires you to authenticate to it, you will need to go to your configuration location (typically /etc/yate or /usr/local/etc/yate) and open up the file accfile.conf and enter in some details. So you might have: [fwd] enabled=yes protocol=sip username=FWD_number password=FWD_password registrar=fwd.pulver.com Obviously both FWD_number and FWD_password will be replaced will your own appropriate values. This configures a line you can use to route a call with. If we jump back to the regexroute.conf file we can change it so that every call made to YATE goes to the FWD Talking clock. Like so: .*=sip/sip:612;line=fwd This says: for any incoming call, send it to 612 via the configuration we have for fwd. Anyone calling will now get the FWD Talking clock. |
3 May 2010: 8 March 2010: 6-7 February 2010: 2 Nov 2009: 6 Aug 2008: 4 Aug 2008: 10 Jul 2008: Feb 2008: 21 Jan 2008: 3 September: 14 August: 16 April: 25 September: 25 September: 11 July 2006: 10 July 2006: June 1st 2006: |