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
On Wed, Apr 30, 2008 at 09:07:48PM +0200, Vinz486 wrote:> 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
2008/4/30 Tzafrir Cohen <tzafrir.cohen at xorcom.com>:> 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
in the CLI you can issue the command>zap show statuse.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:> 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 >
2008/4/30 Tzafrir Cohen <tzafrir.cohen at xorcom.com>:> On Wed, Apr 30, 2008 at 09:07:48PM +0200, Vinz486 wrote:> 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) --------------------------------------------------------------------------------------------------------
2008/5/12 Olivier <oza-4h07 at myamail.com>:> 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
So no way to discover the status of FXO if a cable pluged or not? Regards Bilal --------------------- 2008/5/2 Tzafrir Cohen <tzafrir.cohen at xorcom.com>:> On Fri, May 02, 2008 at 09:06:01AM +0200, Vinz486wrote:> > 2008/4/30 Tzafrir Cohen<tzafrir.cohen at xorcom.com>:> > > On Wed, Apr 30, 2008 at 09:07:48PM +0200,Vinz486 wrote:> > > >---------------------------------------------------------------------------------------------------------> > [May 2 08:51:00] WARNING[5119]: chan_zap.c:6685handle_init_event:> > Detected alarm on channel 3: No Alarm > > [May 2 08:51:03] NOTICE[5119]: chan_zap.c:6678handle_init_event:> > Alarm cleared on channel 4 > >---------------------------------------------------------------------------------------------------------> > This means that you should be able to see it in theInAlarm: 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
On Sat, May 17, 2008 at 05:00:43AM -0700, bilal ghayyad wrote:> So no way to discover the status of FXO if a cable > pluged or not?What specific card do you use? What version of Zaptel? Did you actually read my message you were responding to? -- 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
Hi Cohen; I am using TDM22 (2 fxo and 2 fxs) digium card. I am using zaptel 1.4.10.1 I readed, but not sure if readed all, as alot of messages were going and coming. Can u help? Regadrs Bilal ------------------ On Sat, May 17, 2008 at 05:00:43AM -0700, bilal ghayyad wrote:> So no way to discover the status of FXO if a cable > pluged or not?What specific card do you use? What version of Zaptel? Did you actually read my message you were responding to? -- 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
On Sat, May 17, 2008 at 11:56:47AM -0700, bilal ghayyad wrote:> Hi Cohen; > > I am using TDM22 (2 fxo and 2 fxs) digium card. > I am using zaptel 1.4.10.1 > > I readed, but not sure if readed all, as alot of > messages were going and coming. > > Can u help?You should see "(RED)" in /proc/zaptel/1 for the channel if it is disconnected. Not to mention that the channel will be in alarm (InAlarm in zap show channel NNN). -- 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
2008/5/17 bilal ghayyad <bilmar_gh at yahoo.com>:> So no way to discover the status of FXO if a cable > pluged or not? >Did you read my previou msg???? Hookstate (FXS only): Offhook <------Cable plugged Hookstate (FXS only): Onhook <------Cable unplugged -- PicoStreamer - the real WEB live streaming software vinz486.com