Cannot get SLA working

I’m having a problem getting shared lines working in a new install on Asterisk 1.4.2. Yes, I have read and re-read all of the documentation. I must be doing something wrong that I simply don’t understand. I think it may be related to the subscriptions, but I don’t know how to fix it.

Line 101 is currently registered on a Cisco 7970 running SIP - (waiting for my FXO/FXS device to arrive). Station1 is an Xlite softphone. Station2 is also being registered to a second line on the same Cisco 7970.

Can someone please tell me what I’m doing wrong?

computerCLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
station2/3302 192.168.254.100 D 5060 Unmonitored
station1/station1 192.168.254.10 D 63214 OK (107 ms)
101/101 192.168.254.100 D 5060 Unmonitored
3 sip peers [Monitored: 1 online, 0 offline Unmonitored: 2 online, 0 offline]
computer
CLI> sip show subscriptions
Peer User Call ID Extension Last state Type Mailbox
0 active SIP subscriptions
computer*CLI>


sla.conf
[line1]
type=trunk
device=SIP/101

station
type=station
trunk=line1

station1
station=SIP/station1

station2
station=SIP/station2

extensions.conf

[general]

[globals]

[macro-slaline]
exten => s,1,SLATrunk(${ARG1})
exten => s,n,Goto(s-${SLATRUNK_STATUS}|1)
exten => s-FAILURE,1,Voicemail(1000|u)
exten => s-UNANSWERED,1,Voicemail(1000|u)

[line1]
exten => s,1,Macro(slaline|line1)

[line1_outbound]
exten => disa,1,Disa(no-password|line1_outbound)
exten => *1000,1,VoicemailMain(1000)

[sla_stations]
exten => station1,1,SLAStation(station1)
exten => station1_line1,hint,SLA:station1_line1
exten => station1_line1,1,SLAStation(station1_line1)

exten => station2,1,SLAStation(station2)
exten => station2_line1,hint,SLA:station2_line1
exten => station2_line1,1,SLAStation(station2_line1)
exten => *1001,1,VoicemailMain(1000)

sip.conf

[general]

; Trunk
[101]
type=friend
host=dynamic
secret=xxxxx
context=line1
nat=no
callgroup=1
pickupgroup=1
mailbox=*1000

; User1
[station1]
type=friend
host=dynamic
secret=xxxxxxx
context=sla_stations
subscribecontext=sla_stations
nat=no
callgroup=1
pickupgroup=1
mailbox=*1000
qualify=yes

; User2
[station2]
type=friend
host=dynamic
secret=xxxxx
context=sla_stations
nat=no
callgroup=1
pickupgroup=1
mailbox=*1000

You have a few problems here.

  1. Your configuration for the trunk in sla.conf is not correct. Check the documentation for how to use an IP trunk. You should not list the SIP channel directly. You must use a local channel, instead.

Try setting it to Local/disa@line1_outbound

  1. Your stations will not be able to dial any numbers until you add some extensions to the line1_outbound context.

Try adding something like …

exten => 1234,1,Dial(SIP/101)

That way, when one of the stations dials 1234, the actual SIP trunk will get dialed.

  1. The fact that “sip show subscriptions” shows nothing is a problem on the configuration of your SIP phones. You must configure subscriptions on the stations to subscribe to “station1_line1” for station1 and “station2_line1” for station2. This configuration for this is specific to which phone you are using.

Thanks for the prompt reply Russell. I made your recommended changes but am really getting hung up on item 3. Do you have a sample config from any device that you could show me? Any time I try to change “station2” in the device config to “station2_line1”, I get:

[Mar 25 23:53:08] NOTICE[12044]: chan_sip.c:14530 handle_request_register: Registration from ‘sip:station2_line1@192.168.254.15’ failed for ‘192.168.254.100’ - No matching peer found

So, I’m not exactly sure what needs to be changed on the device side. The softphone/Cisco 7970 are registering just fine when I use “station1” and “station2” respectively.

Also, I noticed that I do not have a “show sla stations” command from the Asterisk console. I checked the modules and didn’t see one SLA related. Do I need to do anything special to enable it?

So close…

In your sip.conf the phones that you are using Hints on have to be type=peer and have call-limit set to something for it to work.

I think the problem right now is that I’m using Cisco phones with the SIP image. I can authenticate, but I don’t know how to subscribe to the proper line. i.e. they will log in with line “station2” just fine. But, it needs to be authenticaitng and then subscribing to line “station2_line1”. I don’t think Xlite will allow me to do this either.

[quote=“bean3178”]Thanks for the prompt reply Russell. I made your recommended changes but am really getting hung up on item 3. Do you have a sample config from any device that you could show me? Any time I try to change “station2” in the device config to “station2_line1”, I get:

[Mar 25 23:53:08] NOTICE[12044]: chan_sip.c:14530 handle_request_register: Registration from ‘sip:station2_line1@192.168.254.15’ failed for ‘192.168.254.100’ - No matching peer found

So, I’m not exactly sure what needs to be changed on the device side. The softphone/Cisco 7970 are registering just fine when I use “station1” and “station2” respectively.

Also, I noticed that I do not have a “show sla stations” command from the Asterisk console. I checked the modules and didn’t see one SLA related. Do I need to do anything special to enable it?

So close…[/quote]

The correct CLI command is “sla show stations”, and the SLA code is located in app_meetme. Given that it is dependent on meetme, you must have zaptel installed for it to be compiled and installed.

I think you are misunderstanding the phone configuration just a little bit. There are two different types of things that must be configured on the phone.

  1. The registration itself. There must be a registration coming from the phone for “station2”. Ideally, this would not be mapped to any buttons on the phone, but I haven’t found a phone that will let you set up a registration without using a line button for it.

  2. The subscriptions. You have to configure the “line buttons” as subscriptions to extensions on Asterisk. For one button to show the state of “line1”, you configure it to subscribe to the state of “station2_line1”. For another button to show the state of “line2”, you configure it to subscribe to “station2_line2”.

These subscriptions are done using the same “station2” account.

I have only done this setup in phone web interfaces, so i don’t have any configuration files to share with you.

Great, I think this gets me where I need to be.

I need to get ztdummy installed and recompile Asterisk. I don’t think the SLA functionality is enabled since the Asterisk console commands don’t work.

Second, I need to work with devices that support subscribe/notify. I’m trying to get this working with the Cisco phones, but the SEP*.conf.xml isn’t well documented, so I don’t know if SUBSCRIBE/NOTIFY is possible with the line buttons. We may just have to wait for future SIP releases from Cisco if that’s the case.

I’ll keep this thread updated as (if) I make progress.

Unless something has changed real recently, the Cisco SIP phones do not support BLF. So, essentially, you may still be able to use it with SLA, but you won’t know if anyone is on the line.

With most phones, to get BLF to work you would create a speeddial type entry. Some, like the GXP2000, have a drop down list to select Asterisk BLF when doing this. The Cisco stores it’s speeddials on the phone themselves. But again, you won’t get the status of the lines.

Hi russell

Here is what I have done so far trying to get SLA to work and this is what I get. But first let me tell you what I have.

I have asterisk-1.4.1 and zaptel-1.4.0 installed on fedora core 6 with digium TDM04B x 2 working perfectly. I have 6 PSTN Lines. I can make calls and receive calls as needed. I also have freepbx 2.2.1 installed which I use for my configurations.

What I want to achieve is this.

I want to be able to assign the trunk lines from zap channels to the BLF buttons on the GXP2000 for every station so that;

  1. Green Light on all subscribed button(s) to indicate not in use. (or free and ready to use)

  2. When call comes in on any line, I can get notified. (blinking red lights on the button(s))

  3. When I push this button(s), I get a dial tone (a pstn dial tone) and make outbound calls as specified by my dial plan.

Here are my configs.

zapata.conf
context=from-pstn
channel => 1 (note that all my trunks also have their context as from-pstn. is this OK?)
e.t.c (same for other channels)

sla.conf
[line1]
type=trunk
device=Zap/1 (is it compulsory to seperate (as in every channel with seperate context as in device=Zap/1 & context=line1, device=Zap/2 & context=line2 e.t.c) all the lines or the lines can be grouped?)
context=from-pstn
ringtimeout=40
e.t.c (same for other trunks)

station
type=station
trunk=line1
context=from-internal

[1000] (station)
device=SIP/1000
e.t.c (same for other stations)

sip.conf
[1000]
usename=1000
type=friend
secret=1000
qualify=no
port=5060
dtmfmode=rfc2833
context=from-internal
subscribecontext=from-internal
e.t.c

now in extension.conf, I have as follows
[from-pstn]
include => from-zaptel
e.t.c

[from-zaptel]
exten => s,1,SLAtrunk(line1) (is this OK?)
e.t.c (other codes for incoming lines)

and

[from-internal]
include => from-internal-custom
e.t.c (other stuffs)

[from-internal-custom]
exten => 1000,2,SLAStation(1000) (I use 2 bcos 1 was used in extension_additional for the station)
exten => 1000_line1,hint,SLA:1000_line1
exten => 1000_line1,1,SLAStation(1000_line1)

after all of the above. I now subscribe to the state of extensions 1000_line1 (e.t.c) on the BLF buttons of the GXP2000.

What I get is this.

  1. Green light on for every button that i subscribe to. (Correct)

  2. When calls come in on this lines, I don’t get notified by blinking red lights. (as expected) (Wrong)

  3. When I push the buttons, I see 1000_line1, silence for a while, then I get 603 with an error tone. (Wrong)

This is what I have so far. I believe am close to getting it working.

[quote=“kayodea”][from-internal-custom]
exten => 1000,2,SLAStation(1000) (I use 2 bcos 1 was used in extension_additional for the station)
[/quote]

Huh? Does that actually work? I didn’t think you could do that, but I could be wrong.

Anyway, I haven’t had time to get back to SLA in a while (really need to, though). In the testing I did, the only way I could get a dial tone was using DISA. I had to set my Zap channels up the way Russell shows the SIP channels. That gave me dial tone and I was able to dial out.

Without doing that, I got an error tone using a Polycom 601. I haven’t tried with my GXPs yet.

FWIW, back during testing (on the 1.2 series), I thought I was able to assign a speeddial to the zap channel where once pressed it would give me dialtone at which point you would be dialing directly on the phone circuit (just like an ordinary phone plugged into a POTS outlet). That doesn’t seem to work on my 1.4.2 test system. It gives me the same thing that I get when I try SLA without using DISA. I haven’t dug into this completely, though. It just seems like I’m missing something.