[asterisk-r2] Res: Zap alarm Problem

Moises Silva moises.silva at gmail.com
Mon Jul 20 11:14:39 CDT 2009


On Mon, Jul 20, 2009 at 12:06 PM, Arturo Ochoa <arturo.era at gmail.com> wrote:

> AFAIK, unicall or openr2, are library's that let asterisk understand
> mfc-r2 signaling....


That is partially correct. Unicall is a general purpose telephony
abstraction, not just for R2 signaling (even when in the real world it seems
just R2 is being used), so in order to compare openr2, we shall compare it
with libmfcr2, not unicall.


> The kernel driver (zaptel or dahdi) is the one in
> charge of all the communication between the card and the operating
> system. So, every time the  card detects loose signal... the driver is
> the one that notifies the kernel about it.....This is my
> understanding, please correct me, if I'm wrong...
>

The kernel driver (zaptel or dahdi or wanpipe) handle low level
communications and indeed they are the ones responsible for notifying
userland applications (like Asterisk using libmfcr2 or openr2) when
something goes wrong at the layer 1. However what to do under such
conditions is responsibility of the application (Asterisk), both, libmfcr2
and openr2 just notify the user application of the condition.

So, first thing first, neither openr2 or Unicall/libmfcr2 do nothing else
during an alarm condition than reporting to Asterisk that the alarm just
occurred.

Having said that, the difference is between chan_zap and chan_unicall.

chan_unicall ignores alarms, you can find Steve comments in chan_unicall.c,
search for UC_EVENT_ALARM, and you will find something like this:

/* TODO: No alarm handling is bad! */

On the other hand, chan_zap/chan_dahdi both check the alarm status each time
zt_read()/dahdi_read() is called and return NULL if the line is in alarm,
and the Asterisk core most likely drops the call when sees NULL as return
value from those routines.

In order to be certified most likely any PBX should drop the call on alarms.
In your case, if you don't care about that you can easily comment the
following lines in chan_zap.c:

Search for zt_read in line 4990 in chan_zap.c and read some lines below, you
will see a line saying:

if (p->radio && p->inalarm) return NULL;

Just comment out that line, or remove the p->inalarm condition.

-- 
Moises Silva
Software Developer
Sangoma Technologies Inc. | 50 McIntosh Drive, Suite 120, Markham ON L3R 9T3
Canada
t. 1 905 474 1990 x 128 | e. moy at sangoma.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-r2/attachments/20090720/84d9e7eb/attachment.htm 


More information about the asterisk-r2 mailing list