Asterisk: How to keep a FXO port off-hook, so Telco will route incoming calls to other trunks in the hunt group

For a remote asterisk system, I have a situation where I need to take a FXO port off-hook, so that the telco will route incoming calls to other lines in the hunt group.  I do not have the option to quickly remove the cable, so am looking for a method to keep it off-hook, then manually place it on hook at a later time.

In my case I have 4 FXO ports: DAHDI 32-34, and (as an example for DAHDI/32) I have used the command:

          asterisk -rx "channel originate DAHDI/32 extension 6001@from-internal"

Where in <extensions.conf> 6001 is set as a queue to park the call

     [from-internal]
     include => Queues

     [Queues]
     exten => 6001,1,Queue(holdqueue)
     exten => 6001,2,Hangup()


From /etc/asterisk/queues.conf I added the holdqueue

     [holdqueue]
     member => SIP/0001

What I am seeing is that the does park in the holdqueue and the FXO line is confirmed off-hook, but then after 20 sec I see  ABANDON in queue_log and it returns on-hook.  From the /var/log/asterisk/full output I see this:

     VERBOSE[22340] pbx.c:     -- Executing [6001@from-internal:1] Queue("DAHDI/32-1", "holdqueue") in new stack
     VERBOSE[22340] res_musiconhold.c:     -- Started music on hold, class 'default', on DAHDI/32-1
     VERBOSE[22340] res_musiconhold.c:     -- Stopped music on hold on DAHDI/32-1
     VERBOSE[22340] pbx.c:   == Spawn extension (from-internal, 6001, 1) exited non-zero on 'DAHDI/32-1'
     VERBOSE[22340] sig_analog.c:     -- Hanging up on 'DAHDI/32-1'
     VERBOSE[22340] chan_dahdi.c:     -- Hungup 'DAHDI/32-1'

Is the "Spawn extension...." indicating a normal hangup event?  If so what could be initiating the hang-up?

As described above, the goal is to make sure the telco cannot send calls to a specific trunk, which will force it to other members in the hunt.  Any ideas on how to keep the FXO port off-hook?  or are there other methods to accomplish the same result, such a attempting to dialout, but then pausing forever.... or any other suggestions or ideas would be appreciated.

Thanks for your review of problem
RobWire45Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

José MéndezCommented:
I think you can deconfigure such FXO port in /etc/dahdi/system.conf, and then restart dahdi.
RobWire45Author Commented:
Hello Willy,

Thanks for your idea.  If I unconfigure the FXO port it will keep asterisk from answering calls on the port -> but the Telco will still be presenting calls on the port, which will result in ring-no-answer's, instead of calls re-routed to others in the hunt.  

I think I need to somehow keep the port busy/off-hook so that telco sends all calls to other ports... just struggling on how to do that.   Thanks again
José MéndezCommented:
well, what would be the difference if you had access to the fxo port to unplug it?

The only other ways I can think of are
- connecting a call to another number (incurs in high costs for calling out)
- automating calls to 800 numbers from a call file in such a way that they don't remain connected but for a second or two and then drop, and then immediately having asterisk call the next number in the list. This should keep the port busy pretty tight.

http://www.voip-info.org/wiki/view/Asterisk+Call+Files

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

RobWire45Author Commented:
Hello Willy,

Good point on the unplugging the line -> This would also be a ring-no-answer condition and not helpful to force calls to the other members in the hunt.  Your post on automating calls was a good suggestion that I changed a bit to get a solution.  What I did was to dialout back into the huntgroup (local call) and I detect when the two local FXO ports that I want busied are connected to each other, then leave the call up.  If the outgoing call (on a port I want busied) does not connect to another port I want busied in the hunt, then I drop the call and try again until I have two connected.  Then continue in 2's until the ports I need busied are.  Thanks again for your insights, it was very helpful.
RobWire45Author Commented:
I spent quite a bit of time looking for a possible solution for this.  With the comments from expert pointing me in the right direction,
and some scripting I was able to get this working.  Thanks
José MéndezCommented:
Glad to have helped a bit.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IP Telephony

From novice to tech pro — start learning today.