[asterisk-dev] LibPRI

Matt Fredrickson creslin at digium.com
Wed May 31 15:15:55 CDT 2017


On Tue, May 23, 2017 at 12:43 PM, Konrad Endruszkiewicz
<konradend at gmail.com> wrote:
> Hi,
>
> thanks for info. I will have a look on this sig_pri.c from Asterisk code.
> Right now I'm struggling with the issue of handling situation, when
> the app is getting RING event, the call is answered, but when by the
> network issues, the call is cut off, then I don't get the HANG UP
> event and the app is still considering that call is active.
> The card is using Unnumbered frame event, when this kind of event
> occurs, where subtype is set to SABME (set asynchronous balanced mode
> extended).
>
> But libpri seems not have the direct way to handle this event (or I
> cannot find how to capture this).
> Maybe you have any idea how to approach this?

Sorry about the delayed response, I was on vacation last week and
didn't check my email :-)

There is a timer, T309, that is used to allow calls to remain
connected for some period of time after layer 2 (Q.921) has a
disconnect event or drop out of some sort.  Typically, this is a layer
2 timeout condition, where a SABME or other layer 2 message doesn't
receive a response within T200 seconds (usually 1 second).  At this
point, T309 is started (usually 6 seconds) and gives layer 2 the
chance to recover.  If layer 2 does not recover within T309's timeout,
all calls that are active receive a disconnect notification and I
believe you should receive HANGUP events on them as well.

Hope that helps,
Matthew Fredrickson

>
> Best regards,
> ______________________________________________
>
> Konrad End
>
>
> 2017-05-23 19:27 GMT+04:00 Matt Fredrickson <creslin at digium.com>:
>> On Tue, May 23, 2017 at 5:06 AM, Konrad Endruszkiewicz
>> <konradend at gmail.com> wrote:
>>> Hi,
>>>
>>> I looking for documentation for LibPRI 1.6 or any samples where this
>>> library is used.
>>> I need to build a software on top of this library to support big callcenter.
>>
>> Hi Konrad,
>>
>> Libpri is a library that runs on top of a DAHDI channel that operates
>> in HDLC mode.  It assumes that the HDLC encoding/decoding as well as
>> CRC generation/checking occurs at lower layers - typically the dahdi
>> layer.  It implements an abstraction over the Q.921 and Q.931 layers
>> that is easier to use and understand that dealing with messages
>> directly.
>>
>> The best place to look for an example with high use is that used in
>> chan_dahdi.c (more specifically, sig_pri.c) in the Asterisk source
>> code.  There are one or two test applications in the libpri repo that
>> can be seen as simpler implementations, but I can't remember if they
>> still work or not (testprilib.c and pritest.c, IIRC).
>>
>> Hope that helps!
>>
>> --
>> Matthew Fredrickson
>> Digium, Inc. | Engineering Manager
>> 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
>>
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> asterisk-dev mailing list
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev



-- 
Matthew Fredrickson
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA



More information about the asterisk-dev mailing list