Extension rollover if busy

Fellow Asterisk folk,

Forgive me if this comes under ‘Bleeding Obvious.’ I’ve been unable to find any clear reference anywhere else I’ve looked.

Given: Three analog FXS ports on my channel bank, all driven by Asterisk 11. These three ports are in a group (g3, to be exact).

What I want to do: If one of those three ports is in use, I want Asterisk to automatically roll the call to the next idle port within this group IN SEQUENCE (I don’t want it jumping around like it does when using dial(dahdi/r3)). If all three of these ports are busy, I want to toss the call to voicemail.

So far, the closest I’ve come is seeing a description of sequential ‘Dial’ commands, each one addressed to a specific DAHDI port. However, it is also my understanding this can lead to phantom rings when the calling and/or called parties hang up.

Any help?

Thanks much!

I’m a bit put out that no one, out of at least 60 who looked at this question, felt like stepping up to the plate and helping out.

With that said – With some help from the folks on another mailing list I’m a member of, plus some more online research into various Asterisk books, I’m pleased to report I have solved my extension rollover issue. Here, for the benefit of others who may want to try the same thing, is the code snippet.

[int-hunt] ; Our internal hunt group. Sequences incoming calls between the first 3 lines on the KTS.
exten => s,1,Dial(DAHDI/25,23,TtKkw)
exten => s,n,Set(DialStatus=${DIALSTATUS})
exten => s,n,GotoIf($[$["${DIALSTATUS}" = “BUSY”] | $["${DIALSTATUS}" = “CONGESTION”]]?IL2)
exten => s,n,Voicemail(9555@house,u)
exten => s,n,Hangup()
exten => s,n(IL2),Dial(dahdi/26,23,TtKkw)
exten => s,n,Set(DialStatus=${DIALSTATUS})
exten => s,n,GotoIf($[$["${DIALSTATUS}" = “BUSY”] | $["${DIALSTATUS}" = “CONGESTION”]]?IL3)
exten => s,n,Voicemail(9555@house,u)
exten => s,n,Hangup()
exten => s,n(IL3),Dial(dahdi/27,23,TtKkw)
exten => s,n,Set(DialStatus=${DIALSTATUS})
exten => s,n,GotoIf($[$["${DIALSTATUS}" = “BUSY”] | $["${DIALSTATUS}" = “CONGESTION”]]?IVM)
exten => s,n,Voicemail(9555@house,u)
exten => s,n,Hangup()
exten => s,n(IVM),Voicemail(9555@house,u)

I also found it necessary to set callwaiting=no in chan_dahdi.conf. In my specific case, I also chose to make a global variable called IHUNT and set it to the value of the int-hunt context.

This makes the code snippet to direct all incoming calls to that context very simple.

exten => s,n,GoTo(${IHUNT},s,1)

Sure beats trying to put the logic in for each instance of an incoming line!

Happy tweaking.

Most people don’t have dahdi trunks. Of those, most professional users have ISDN, not multiple analogue lines. Some of the accesses will have been by search engines. That leaves very few people who might be able to answer.

I don’t use dahdi trunks. Moreover, my initial reaction was that I would expect that dahdi would hunt in the order in which the channels were defined, not a random order.

David55 wrote:

“Most people don’t have dahdi trunks. Of those, most professional users have ISDN, not multiple analogue lines…”

(!!)

So, let me see if I’ve got this straight: You are saying, in an oblique way, that only those who are “professional users,” with a specific type of digital phone line (which may not even be available in many areas), should be seeking help in these forums?

Are you -really- sure that’s what you wanted to say? And do I really need to explain how the tone of that response comes across?

I’m a member of Telephone Collectors International. I’m also a participant in their C*Net private VoIP network (ckts.info if anyone’s curious). Just about every member of that network, myself included, has an abundance of dahdi trunks and analog ports on their Asterisk systems.

In short, I don’t think such setups are as uncommon as you seem to believe.

Still, if it is true that only “professional users” with ISDN lines are welcome in these forums, I would ask one of the moderators to please advise me of such conditions. I will be only too happy to depart (and, perhaps, warn others about coming here for any type of assistance).

Thank you.

[quote=“kyrrin”]
myself included, has an abundance of dahdi trunks and analog ports on their Asterisk systems.

In short, I don’t think such setups are as uncommon as you seem to believe.
.[/quote]

You are completely right kyrrin. There is a big abundance of dahdi trunks ,around the world. And if this was not the case, you are still welcome to ask for help in this forum. Dahdi is the open source device interface technology used to control Digium and other legacy telephony interface cards. I think that part of the big success of Asterisk in due to the dahdi trunks.

The real facts of the matter is that your chances of getting help beyond the very basic, on a forum like this, especially after you have already had no responses, is very small. I’m not saying anything about whether people should be requesting help. I’m saying something about the likelihood that there will be anyone who can help them. My initial response was to ignore the question, just in case you were lucky and there was someone who could answer, but when you started complaining about the lack of answers, I tried to explain the reason.

Most of the dahdi trunks are ISDN, or are being used by people who don’t stick around in the forum. Digium sell ISDN as well as analogue dahdi hardware.

As to the tone of my response. The tone of your question was that a lot of people who know the answer are not bothering to answer. I was pointing out that most of those who read the article have no experience of multi-line analogue hardware. The support you get on a peer support forum depends on the skill set of those who actively contribute to the forum, which does not always match that of the people who ask questions. Actually, there are only about six people who actively contribute to the forum!

Most users on this forum are VoIP users. Of those who use analogue hardware, I would suggest that most are using VoIP gateway devices on one or two lines. I know that Ian uses dahdi, but he seems to be involved with UK professional systems, so is mainly, or only, interested in ISDN, for the circuit switched side.

Analogue line users also tend not to stick around, to answer other people’s questions, because maintaining telephone systems / developing telephony software, is not a major part of their work or interests.

The Digium people on this forum (although not acting in an official capacity) will normally redirect all dahdi related questions to the vendor. (Digium provide support for their hardware, but not on the peer support forums. In particular they want to encourage Sangoma to support Sangoma hardware, and not to rely on a forum that is funded by Digium.)

Incidentally, I think in most parts of the world where ISDN is not available, the preferred networks are mobile networks, not analogue fixed networks. (Mobile networks are built using ISDN, so even those countries have some ISDN infrastructure.)

I originally assumed that you were using analogue FXO ports. The general advice given to people wanting to use analogue FXS ports is that going VoIP is likely to be the cheaper option. There are generally no national infrastructure issues. Your non-financial constraint on the use of analogue FXS lines puts you into a niche market. The most likely place where you will find the expertise you need is within Telephone Collectors International, itself.

I note that, although ambiorixg12 is a regular contributor, he didn’t feel able to respond to your original question.

I assume that you are going to stay on the forum and answer other people’s analogue line questions. Historically, amateur users and analogue line users in general, don’t tend to stick around after they have asked their questions, even though they are in the best position to answer that type of question.

With only three lines, there are only two choices of next line to use, so I don’t understand how you determine you are getting a random choice. If you always want the lowest free line, you should use g, rather than r. g is what most users would use.