View previous topic :: View next topic |
Author |
Message |
vinz486 at gmail.com Guest
|
Posted: Wed Apr 30, 2008 2:07 pm Post subject: [asterisk-users] Discover connected Zap lines |
|
|
Hi,
i have 2 FXO ports on my host (Asterisk 1.4 on Debian)..
In the production env i will not know if will be analog cable plugged
in port 1, 2 or both.
How can i discover this programmatically?
I see NOTICE messages on CLI upon plug and unplug lines: ho get these info?
Thanks.
--
PicoStreamer - the real WEB live streaming software
vinz486.com |
|
Back to top |
|
|
tzafrir.cohen at xorco... Guest
|
Posted: Wed Apr 30, 2008 3:29 pm Post subject: [asterisk-users] Discover connected Zap lines |
|
|
On Wed, Apr 30, 2008 at 09:07:48PM +0200, Vinz486 wrote:
Quote: | Hi,
i have 2 FXO ports on my host (Asterisk 1.4 on Debian)..
In the production env i will not know if will be analog cable plugged
in port 1, 2 or both.
How can i discover this programmatically?
I see NOTICE messages on CLI upon plug and unplug lines: ho get these info?
|
What device do you use? wcfxo has always reported this as RED alarm on
the span. The drivers of the Astribank also did so for quite some time.
In recent versions of Zaptel all the Digium analog cards' drivers do so
as well.
So a quick look at /proc/zaptel/1 will show you that the channel is RED
(yes, there are also channel alarms for that in latest Zaptel versions).
And then in Asterisk 'zap show channel 1' will show you that the channel
is "InAlarm". Hence it won't accept calls. Thus you can safely include
it in a group of channels. Maybe this is what you were after in the
first place.
--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir |
|
Back to top |
|
|
vinz486 at gmail.com Guest
|
Posted: Wed Apr 30, 2008 4:10 pm Post subject: [asterisk-users] Discover connected Zap lines |
|
|
2008/4/30 Tzafrir Cohen <tzafrir.cohen at xorcom.com>:
Quote: | So a quick look at /proc/zaptel/1 will show you that the channel is RED
(yes, there are also channel alarms for that in latest Zaptel versions).
|
Thanks!!! Never got in mind to look in /proc.
I use a TDM400P.
I will test tomorrow.
Next, I need same info for an Hamlet ISDN BRI line...
--
PicoStreamer - the real WEB live streaming software
vinz486.com |
|
Back to top |
|
|
joakimsen at gmail.com Guest
|
Posted: Wed Apr 30, 2008 6:34 pm Post subject: [asterisk-users] Discover connected Zap lines |
|
|
in the CLI you can issue the command
e.g.:
pbxserver-doral*CLI> zap show status
Description Alarms IRQ bpviol CRC4
Wildcard X101P Board 1 RED 0 0 0
In this case the phone line is unplugged and the hardware is just a
cheap winmodem with the resistor removed. If the phone line were
plugged in there would not be a red alarm. Certainly any digital line
will provide the same sort of status notifications.
On Wed, Apr 30, 2008 at 3:07 PM, Vinz486 <vinz486 at gmail.com> wrote:
Quote: | Hi,
i have 2 FXO ports on my host (Asterisk 1.4 on Debian)..
In the production env i will not know if will be analog cable plugged
in port 1, 2 or both.
How can i discover this programmatically?
I see NOTICE messages on CLI upon plug and unplug lines: ho get these info?
Thanks.
--
PicoStreamer - the real WEB live streaming software
vinz486.com
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
|
|
|
Back to top |
|
|
tzafrir.cohen at xorco... Guest
|
Posted: Wed Apr 30, 2008 6:42 pm Post subject: [asterisk-users] Discover connected Zap lines |
|
|
On Wed, Apr 30, 2008 at 07:34:08PM -0400, Andreas van dem Helge wrote:
Quote: | in the CLI you can issue the command
e.g.:
pbxserver-doral*CLI> zap show status
Description Alarms IRQ bpviol CRC4
Wildcard X101P Board 1 RED 0 0 0
In this case the phone line is unplugged and the hardware is just a
cheap winmodem with the resistor removed. If the phone line were
plugged in there would not be a red alarm. Certainly any digital line
will provide the same sort of status notifications.
|
In that display: actually not. Here you have one line per span. PRI cards
have exactly one span per port. The X100P cards also happen to have
this.
All the better analog cards have (at least potentially) more than one
port per span. Hence you cannot use the span's alarm to signal the
status of the port.
(But see my other message in this thread)
--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir |
|
Back to top |
|
|
vinz486 at gmail.com Guest
|
Posted: Fri May 02, 2008 2:06 am Post subject: [asterisk-users] Discover connected Zap lines |
|
|
2008/4/30 Tzafrir Cohen <tzafrir.cohen at xorcom.com>:
Quote: | On Wed, Apr 30, 2008 at 09:07:48PM +0200, Vinz486 wrote:
|
Quote: | So a quick look at /proc/zaptel/1 will show you that the channel is RED
(yes, there are also channel alarms for that in latest Zaptel versions).
|
Bad news:
I have 1 line plugged on port 3 (ports are 3 and 4) and no trick tell me that:
-------------------------------------------------------------------------------------------------------
dev:/tvp/var# cat /proc/zaptel/1
Span 1: WCTDM/0 "Wildcard TDM400P REV I Board 1" (MASTER)
1 WCTDM/0/0
2 WCTDM/0/1
3 WCTDM/0/2 FXSKS (In use)
4 WCTDM/0/3 FXSKS (In use)
-------------------------------------------------------------------------------------------------------- |
|
Back to top |
|
|
tzafrir.cohen at xorco... Guest
|
Posted: Fri May 02, 2008 3:16 am Post subject: [asterisk-users] Discover connected Zap lines |
|
|
On Fri, May 02, 2008 at 09:06:01AM +0200, Vinz486 wrote:
Quote: | 2008/4/30 Tzafrir Cohen <tzafrir.cohen at xorcom.com>:
Quote: | On Wed, Apr 30, 2008 at 09:07:48PM +0200, Vinz486 wrote:
|
Quote: | So a quick look at /proc/zaptel/1 will show you that the channel is RED
(yes, there are also channel alarms for that in latest Zaptel versions).
|
Bad news:
I have 1 line plugged on port 3 (ports are 3 and 4) and no trick tell me that:
-------------------------------------------------------------------------------------------------------
dev:/tvp/var# cat /proc/zaptel/1
Span 1: WCTDM/0 "Wildcard TDM400P REV I Board 1" (MASTER)
1 WCTDM/0/0
2 WCTDM/0/1
3 WCTDM/0/2 FXSKS (In use)
4 WCTDM/0/3 FXSKS (In use)
|
This is with the lines plugged?
What do you see here with the lines unplugged?
Quote: | --------------------------------------------------------------------------------------------------------
Quote: | From Asterisk command line:
|
--------------------------------------------------------------------------------------------------------
dev*CLI> zap show status
Description Alarms IRQ bpviol
CRC4
Wildcard TDM400P REV I Board 1 OK 0 0
0
dev*CLI> zap show channels
Chan Extension Context Language MOH Interpret
pseudo analog it default
3 analog it default
4 analog it default
dev*CLI>
---------------------------------------------------------------------------------------------------------
But when I unplug from 3 and plug on 4 the CLI alert me:
---------------------------------------------------------------------------------------------------------
[May 2 08:51:00] WARNING[5119]: chan_zap.c:6685 handle_init_event:
Detected alarm on channel 3: No Alarm
[May 2 08:51:03] NOTICE[5119]: chan_zap.c:6678 handle_init_event:
Alarm cleared on channel 4
---------------------------------------------------------------------------------------------------------
|
This means that you should be able to see it in the InAlarm: field in
'zap show channel 3'
Quote: |
It's "crazy" for me that there is no way to get programmatically (i
mean via CLI or a PHP script) those WARNING and NOTICE messages...
|
--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir |
|
Back to top |
|
|
vinz486 at gmail.com Guest
|
Posted: Mon May 12, 2008 5:55 am Post subject: [asterisk-users] Discover connected Zap lines |
|
|
2008/5/2 Tzafrir Cohen <tzafrir.cohen at xorcom.com>:
Quote: | On Fri, May 02, 2008 at 09:06:01AM +0200, Vinz486 wrote:
Quote: | 2008/4/30 Tzafrir Cohen <tzafrir.cohen at xorcom.com>:
Quote: | On Wed, Apr 30, 2008 at 09:07:48PM +0200, Vinz486 wrote:
|
---------------------------------------------------------------------------------------------------------
[May 2 08:51:00] WARNING[5119]: chan_zap.c:6685 handle_init_event:
Detected alarm on channel 3: No Alarm
[May 2 08:51:03] NOTICE[5119]: chan_zap.c:6678 handle_init_event:
Alarm cleared on channel 4
---------------------------------------------------------------------------------------------------------
|
This means that you should be able to see it in the InAlarm: field in
'zap show channel 3'
|
Ok. Made some experiments.
InAlarm field show 1 if cable unplugged *BUT* only if in previouos
time cable was plugged.
In few words, at boot, InAlarm is 0, Cable plugged: 0, Cable unplugged: 1
If i use this field, after a boot without cable, my software will
think that the cable is plugged.
I found another useful field: Hookstate (FXS only).
It tell me if the cable is plugged ever after a boot without cable.
Hookstate (FXS only): Offhook <------Cable plugged
Hookstate (FXS only): Onhook <------Cable unplugged
I hope this can help other people (and make to think at Zaptel
developing to insert a field exactly for this purpose, eg: Cable:
plugged or Cable: unplugged).
Bye.
--
PicoStreamer - the real WEB live streaming software
vinz486.com |
|
Back to top |
|
|
vinz486 at gmail.com Guest
|
Posted: Mon May 12, 2008 11:48 am Post subject: [asterisk-users] Discover connected Zap lines |
|
|
2008/5/12 Olivier <oza-4h07 at myamail.com>:
Quote: | So, do you mean that if :
1. Asterisk server boots,
2. A cable from telco analog line is plugged in and out in every FXO port
3. Analog lines (from Telco) are plugged into definitive FXO ports
4. Then, any query to InAlarm field would tell if a cable is plugged or not
?
|
Yes.
In a simple manner: InAlarm is right only when a cable is plugged at
least once. Otherwise will tell you that cable is plugged (0 alarm).
--
PicoStreamer - the real WEB live streaming software
vinz486.com |
|
Back to top |
|
|
|