• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1168
  • Last Modified:

Monitoring asterisk analog trunks with Linksys SPA942

Hello experts,
I have Asterisk 1.4 with Digium TDM800 and 4FXO ports.
SIP extensions are using Linksys SPA942 which has 4 lines.

I need a way to link each one of the four line keys in SPA942 to one analog FXO port. That means when one trunk is busy it's led should become red until it's hung up.

Possible ??
0
Muhajreen
Asked:
Muhajreen
  • 4
  • 3
  • 3
  • +1
1 Solution
 
grbladesCommented:
Yes it can be done. In asterisk you can define hints like :-
exten => l1,hint,ZAP/1
exten => l2,hint,ZAP/2
exten => l3,hint,ZAP/3
exten => l4,hint,ZAP/4

Then on the phone you define the button as being a busy lamp with extensions l1 through l4.
0
 
MuhajreenAuthor Commented:
Thanks for your comment.

In asterisk, shall I insert the above hint settings in the same user context?

And how to define the buttons in phone?

0
 
grbladesCommented:
You can define the hints in the same context as your extensions.

Sorry I havent used the linksys phones but normally you just go to the IP address of the phone in the browser and you can define the buttons. Normally you can then define the type of action for the button which is normally called something like busy lamp or BLF.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Ron MalmsteadInformation Services ManagerCommented:
Start with Sip.conf...

Add a sip entry in sip.conf, for each phone number of each analog port.
Example.
[5551111234]
type=friend
host=dynamic
secret=mysecret
context=default
nat=never
callerid=5551111234
dtmfmode=auto

After you have the four entries...reload sip.

Now logon to the web interface of the 942 phone.  On each extension, add the settings you just put in sip.conf.  This will make each line key mapped to a specific analog port, for outgoing calls.

To make incoming calls ring on the appropriate line, then you might have to adjust your extensions.conf, on your inbound context.

;Example....
[incoming]
exten => _5551111234,1,Answer(.5)
exten => _5551111234,n,Dial(SIP/${EXTEN},20)
exten => _5551111234,n,Voicemail(${EXTEN}@default)
exten => _5551111234,n,Hangup()
0
 
Ron MalmsteadInformation Services ManagerCommented:
Sorry.... slight misnomer in my words.
To make the phone use a specific port outbound, you can do something like the following....

[outbound]
exten => _NXXNXXXXXX,1,Set(myexten=${CDR(src)}) ;set myexten so we know which line you used to dial.
exten => _NXXNXXXXXX,n,Set(dialednumber=${EXTEN}) ; set dialednumber so we know the number to dial.

exten => _NXXNXXXXXX,n,GotoIf($["${myexten}"="5551111234"]?1) ; goto 1 if myexten is....""..
exten => _NXXNXXXXXX,n,GotoIf($["${myexten}"="5551111233"]?2)
exten => _NXXNXXXXXX,n,GotoIf($["${myexten}"="5551111232"]?3)
exten => _NXXNXXXXXX,n,GotoIf($["${myexten}"="5551111231"]?4)
exten => _NXXNXXXXXX,n,Hangup()       ;If it makes it here, then that means the call didn't originate from your
;     phone, so we hangup I guess.

exten => 1,1,Dial(Zap/1-${EXTEN}/${dialednumber}) ; Dial zap on span 1 - channel 1 / the number
exten => 1,n,Hangup()

exten => 2,1,Dial(Zap/1-${EXTEN}/${dialednumber})
exten => 2,n,Hangup()

exten => 3,1,Dial(Zap/1-${EXTEN}/${dialednumber})
exten => 3,n,Hangup()

exten => 4,1,Dial(Zap/1-${EXTEN}/${dialednumber})
exten => 4,n,Hangup()
0
 
feptiasCommented:
xuserx2000, I am curious to know - have you tried any of the above or is this a theoretical solution? It's an interesting idea for a solution, but I am not convinced the inbound call handling you propose would work.

To route inbound calls to specific line keys on the SPA942 can I would do it like this:
[incoming]
exten => s,1,Dial(SIP/555111123${CHANNEL:-1},25)
exten => s,n,Voicemail(555111123${CHANNEL:-1}@default)
exten => s,n,Hangup()

That would map Zap channel 1 to SIP extension 5551111231, and Zap channel 2 to SIP extension 5551111232 etc. The other big weakness of this solution is that is only works for a single IP phone - you might be able to use Shared Line Appearances for multiple IP phones, but the SPA942 would be quite difficult (or impossible) to set up with SLA.
0
 
Ron MalmsteadInformation Services ManagerCommented:
Yea, I can't think of any way to change the LED's status, when the trunk is in use on the 942.

I wouldn't say this is a theoretical solution, because it's based on the fact that you can assign each line appearance a different extension.  If you have 4 analog ports.... create extensions that match the phone number they belong to...and simply dial those extensions and the appropriate line key will blink when the phone rings.

I'm not really sure why you think it wouldn't work....because the sip extension assigned to each line key, matches the inbound number already.
[incoming]
exten => _5551111234,1,Answer(.5)
exten => _5551111234,n,Dial(SIP/${EXTEN},20)
exten => _5551111234,n,Voicemail(${EXTEN}@default)
exten => _5551111234,n,Hangup()
......The above was an example of a single entry for one incoming number..., and I yield to the fact that yours would encompass all the numbers by triming the chan variable to get the last digit.  ${CHANNEL:-1} and appending it.  Your modification assumes however, that the incoming DID's are in the same range..... 555111123 and 1, or 2, or 3, or 4

As far as SLA, I put a lot of effort in, once upon a time, into making it work for 942, and was unable to do so.
0
 
feptiasCommented:
The item I was doubtful about was the inbound dialled number being known to Asterisk on an FXO port. Where does it get that information? In my experience, inbound calls to FXO ports have to use extension type "s" in the dial plan context where they are handled. ...or does it use the callerid field from zapata.conf? That field is supposed to indicate the caller ID on outbound calls, but I vaguely remember now that Asterisk may also set the dialled number to the same value on inbound calls on analogue ports. It would make sense. (I loaned my FXO card to someone so can't check it at the moment).

By the way, I also tried for ages to make SLA work on a 942 with no success. Are some of the keys re-programmable as BLF keys? The only keys with lamps on are the line keys.
0
 
Ron MalmsteadInformation Services ManagerCommented:
"The item I was doubtful about was the inbound dialled number being known to Asterisk on an FXO port. Where does it get that information? In my experience, inbound calls to FXO ports have to use extension type "s" in the dial plan context where they are handled. ...or does it use the callerid field from zapata.conf?"
- I was confused to what you meant, but you are 100 percent correct in that.... it is an error on my part.

Should be extension S..... or "."
The context can be defined within each of the fxs port definitions...

What do you think of this ?

[5551111234]
exten => s,1,Answer(.5)
exten => s,n,Dial(SIP/${CONTEXT},20)
exten => s,n,Voicemail(${CONTEXT}@default)
exten => s,n,Hangup()

and in zapata...

signalling=fxo_ks
group=4
language=en
context=5551111234
usecallerid=yes
cidsignalling=bell
cidstart=ring
channel => 4
0
 
MuhajreenAuthor Commented:
Thank you all for your care.

I am really confused about the feature. I was unable to reply to the comments or accept any solution.

In conclusion, is it possible to work with SPA942 or not? what about Snom phones? Do they support it?  What is the simplest way?
0
 
grbladesCommented:
I havent used linksys or snom phones. The Aastra and Grandstream (except the budgettone models I believe) do definetly support it though.
0
 
feptiasCommented:
If you have just one extension phone, then the SPA942 could be used as discussed above. However, I think it unlikely that you would want to have an Asterisk PBX with 4 FXO lines and just one extension phone. Therefore, you should consider using Aastra, Snom or Grandstream phones instead (they would be much more suitable), but the answer is still not very straightforward because Asterisk itself could be the limiting factor here.

The feature you described is called Shared Line Appearances. It is where the extension phone has a button for each trunk line - when the trunk line is in use, the lamp next to (or under) the button comes on. When an inbound call rings on one of the trunk lines, the lamp flashes.

Asterisk can do shared line appearances, but the last time I investigated it there were quite a lot of limitations and also it was not easy to set up. Possibly things have got better in the last 14 months (that is how long ago I looked into it). Try googling on "Asterisk SLA" or "Asterisk shared line appearances" and see what is being said about it now. Possibly you would be better using a different product - there was something called Talkswitch which the distributor told me could do it. Also I think Broadsoft, PBXnSIP and Sylantro products may be able to support it (quite possibly with the SPA phones).

I wrote a white paper explaining everything I could find out about Asterisk 1.4 and SLA (as I said it is now slightly old information and may be out of date). It is very technical, but the sections about the pro's and con's might be helpful and the general explanation of what SLA is:
http://www.smartvox.co.uk/astfaq_asterisk_sla.htm#GoodBad
http://www.smartvox.co.uk/astfaq_asterisk_sla.htm#Terms
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now