Line stays off-hook

We have a problem with the dadhi lines staying off hook. What happens, I think, is that the cell phone extensions may go out of range during a call, and so the call does not get hung up. All that I know to do is to reboot the server. That works when I am here, but if I am not here the line stays off hook - customers cannot call in on that line, and the line is basically unusable.
Is there a way Asterisk could detect this situation and hang up the external dadhi line, or at least a command I could run to hang up the line.

James

Asterisk can’t directly detect the state of a dahdi device, but the dahdi channel driver itself can, there are many posts here and elsewhere for setting dahdi’s “far end disconnect” capability and responsiveness depending on how your dahdi FXO lines are provisioned by your provider.

the asterisk cli command

hangup request (tab)

will probably suffice in the interim.

hangup request (tab) - tab means what? I’m sorry I don’t know more. Is it the channel? Then how do I know what channel is off hook? Is there a query that will tell me?

I will see if I can find more on “far end disconnect”.

James

type hangup request then the tab key it will list your open channels if they are dahdi channels they will be off-hook.

http://doxygen.asterisk.org/trunk/chan_dahdi.conf.html

edit:-

If you can’t figure out your DAHDI hangup conditions as per your provider, then:-

rasterisk -x ‘core show channels verbose’

will expose the DAHDI channels and the lack of a “paired” channel or perhaps an unacceptably large “Duration” (field 9) could be used to script a “request hangup” of your “Channel” (field 1) from a cron job.

Thanks. This works:
rasterisk -x 'core show channels verbose’
shows the channel and inside the CLI:
channel request hangup DAHDI/2-1
hangs up the line.

Now, when I am here I can do this, but I want this to be either automatic, or else a script that can be run by anyone without granting admin privileges to the user. Any help in scripting this? Even setting it up as a “misc application” in the Freepbx GUI.

James

You really need to get the trunk configured correctly, however, as I wrote

. . . If you can’t figure out your DAHDI hangup conditions as per your provider, then:-

rasterisk -x ‘core show channels verbose’

will expose the DAHDI channels and the lack of a “paired” channel or perhaps an unacceptably large “Duration” (field 9) could be used to script a “request hangup” of your “Channel” (field 1) from a cron job.
. . .

Sorry to revive this but it genuinely seems like a good place to ask this question.

I’m struggling with channels stuck open with a particular page group when it’s started from the CLI.

I was hoping to be able to use a wildcard * in combination with

request hangup, but that doesn’t seem to work.

Is there an asterisk CLI specific wildcard that might?

many thanks

channel request hangup all

thanks - but I don’t necessarily want to disconnect happy phone calls - only the stuck ones - so I was going to do

freepbx*CLI> channel request hangup Local/PAGE2*

But that just returns “is not a known channel”

there is ‘tab completion’ . . .

channel request hangup <tab> . . . (which will clue you how to call the hangup request)

so from a shell , identify the channels open (core show channels ), then selectively, and individually , request the ‘hangup’ on the identified channels.

yep - thanks - but I was hoping to do all this automatically and ONLY for the page group - what I think I’ll have to do in the absence of a wildcard is use grep and a bash script.
Thanks though!