• Stefan Knoblich's avatar
    ftmod_libpri: Major rework of runtime thread, lpwrap event loop, restart… · f012b7ab
    Stefan Knoblich 提交于
    ftmod_libpri: Major rework of runtime thread, lpwrap event loop, restart b-channel handling and some new features.
    
    Add per b-channel private data (ftdm_libpri_b_data_t), move the q.931 libpri
    call pointer into it and use channel->call_data to make it accessible.
    
    Use ftdm_channel_wait() instead of select() to wait for I/O events on
    the D-Channel and rewrite the timeout handling, adding support for custom
    timers that can be added to the b-channel private data and started/stopped
    with lpwrap_timer_start()/_stop().
    
    The (sorted) list of active lpwrap timers is protected by the timer_mutex,
    which is initialized in the now unified lpwrap_init_pri() (see below) and
    destroyed in the new lpwrap_destroy_pri() function.
    
    Unify lpwrap_init_pri() and lpwrap_init_bri(). Use the span type to select
    BRI/PRI and Point-to-Point vs. Multipoint settings.
    
    Use the new custom lpwrap timer API to implement T302 (aka overlap receiving
    digit timeout). The default T302 timeout is 3000 miliseconds and can be set
    via the "digit_timeout" or "t302" span configuration parameter
    (0 = disable timer, valid range = 3000 ... 30000 miliseconds).
    
    The lpwrap_pri_init() changes made it neccessarry to rewrite the span runtime
    thread event loop. The d-channel initialization and libpri event handler
    registration have been moved out of the event loop. The b-channel restart
    handling in the event loop has been left as-is, pending a further clean up in
    the future.
    
    Rename on_info() to on_information() and add a new on_keypad_digit() event
    handler to convert incoming KEYPAD DIGIT messages to channel DTMF events
    (only useful on BRI PTMP NT-mode).
    
    The channel restart handling has been improved to distinguish between locally
    triggered and restarts caused by the remote end (= incoming RESTART messages).
    Restarts on the D-Channel now use pri_restart(), causing a Q.921 reset on
    the span.
    
    Large patch, i'd have loved to split this into smaller pieces and actually
    test some of the bits more toroughly (restart handling), but some people
    are f*cking annoying, so here it is.
    Signed-off-by: 's avatarStefan Knoblich <stkn@openisdn.net>
    f012b7ab
lpwrap_pri.h 5.1 KB