Author Topic: yate basic configuration  (Read 12101 times)

ky4k0b

  • Newbie
  • *
  • Posts: 11
    • View Profile
yate basic configuration
« on: May 15, 2014, 06:13:13 PM »
Hello yate gurus!

I just installed yate pbx on debian and need to implement simple scheme with routing based on prefixes.
         GW1 (1.1.1.1)
            ↓  (no registration, auth by ip-address only)
          yate
   ↓                 ↓ (yate registers on both GW2 and GW3)
GW2           GW3

What is done so far:
Code: (accfile.conf) [Select]
[test1]
enabled=yes
protocol=sip
username=user1
password=pw1
registrar=2.2.2.2

[test2]
enabled=yes
protocol=sip
username=user2
password=pw2
registrar=3.3.3.3

I see in /var/log/yate
Code: [Select]
20140515233120.052067 <sip:CALL> SIP line 'test1' logon success to 2.2.2.2:5060hence I suppose that I've been registered successfully.

Next in
Code: (regexroute.conf) [Select]
[default]
^99991001$=tone/dial
^99991002$=tone/busy
^99991003$=tone/ring
^99991004$=tone/specdial
^99991005$=tone/congestion
^99991006$=tone/outoforder
^99991007$=tone/milliwatt
^99991008$=tone/info

^001\(.*\)$=sip/sip:\1;line=test1
^002\(.*\)$=sip/sip:\1;line=test2
[check_addr_auth]
${address}^1\.1\.1\.1:=return
.*=-;error=forbidden;reason=fuckyou
But somehow yate keeps returning 404 for all calls.
Here're my questions:
1) Correct me pls if I made mistakes above.
2) How do I check sip call flow? Basically how can I see it online or enable traces in conf files?
3) How do you apply new configuration? For example after I edit .conf files do I need to restart yate or put any commands? Or is everything applies on fly?
4) How do I enable full non-proxy media for all calls? I need RTP packets go directly from GW1 to GW2

That's all yet. Looking forward to your answers!
« Last Edit: May 15, 2014, 06:17:02 PM by ky4k0b »

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: yate basic configuration
« Reply #1 on: May 16, 2014, 01:22:52 AM »

What do you mean by see online on conf file?
If you want to route calls only if the account is online you should use javascript.
When you login an account the module will send an user.notify message with its status.
In javascript you can store account status and route if online.

Some configuration options are applied on reload (no restart needed).
Just ask what you need to know.
For example regexroute rules are always replaced on reload.

To enable rtp forward see http://docs.yate.ro/wiki/RTP_Forwarding

If you see the account logon success message and calls are failing post a yate log to see what happens.

ky4k0b

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: yate basic configuration
« Reply #2 on: May 16, 2014, 02:59:41 AM »
Still don't see answers on my questions:
1) Is this configuration correct for my scheme?
2) Where can I find sip logs for incoming and outgoing calls
3) >For example regexroute rules are always replaced on reload.
how do you reload?
4) What yate logs available? Other than /var/log/yate
5) What happens with the calls when GW2/3 rejects registration?
« Last Edit: May 16, 2014, 03:09:46 AM by ky4k0b »

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: yate basic configuration
« Reply #3 on: May 16, 2014, 03:16:33 AM »
Config seems ok.
Sip logs are in yate logs (they are displayed at debug level 9).
Reload can be done in telnet console, reload command (see http://docs.yate.ro/wiki/Rmanager).
Yate logs are in var/log/yate (or in other location if you start yate with -l).

ky4k0b

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: yate basic configuration
« Reply #4 on: May 16, 2014, 05:27:23 PM »
problems faced and successfully resolved:
1) cfg was not applying
Wrong directory. Can be checked with:
Code: [Select]
telnet localhost 5038
status engine
If you install from source - default dir is /usr/local/etc/yate/
from repos - /etc/yate

2) ^001\(.*\)$=sip/sip:\1;line=test1 --- outdated
correct one was:
Code: [Select]
[default]
${username}^$=call check_addr_auth
^99991001$=tone/dial
^99991002$=tone/busy
^99991003$=tone/ring
^99991004$=tone/specdial
^99991005$=tone/congestion
^99991006$=tone/outoforder
^99991007$=tone/milliwatt
^99991008$=tone/info

^001\(.*\)$=line/\1;line=test1
^002\(.*\)$=line/\1;line=test2

[check_addr_auth]
${address}^1\.1\.1\.1:=return
.*=-;error=forbidden;reason=fuckyou
3) sip traces can be enabled by:
Code: [Select]
telnet localhost 5038
debug on
sniffer on
debug sip level 9
4) most times simple reload in rmanager doesn't work. Yate restart required.

That's all that I've learned from today.
Thanks monica and marian