]> git.pld-linux.org Git - packages/asterisk.git/blob - asterisk-zhone.patch
- zhone hacks
[packages/asterisk.git] / asterisk-zhone.patch
1 diff -urN asterisk-1.4.11.org/channels/chan_zap.c asterisk-1.4.11/channels/chan_zap.c
2 --- asterisk-1.4.11.org/channels/chan_zap.c     2007-08-17 23:01:43.000000000 +0200
3 +++ asterisk-1.4.11/channels/chan_zap.c 2007-10-06 06:09:46.353781463 +0200
4 @@ -137,7 +137,7 @@
5   * is entirely unwilling to provide any assistance with their channel banks
6   * even though their web site says they support their products for life.
7   */
8 -/* #define ZHONE_HACK */
9 +#define ZHONE_HACK 1
10  
11  /*! \note
12   * Define if you want to check the hook state for an FXO (FXS signalled) interface
13 @@ -3700,21 +3700,17 @@
14                 ast_log(LOG_DEBUG, "Got event %s(%d) on channel %d (index %d)\n", event2str(res), res, p->channel, index);
15  
16         if (res & (ZT_EVENT_PULSEDIGIT | ZT_EVENT_DTMFUP)) {
17 -               p->pulsedial =  (res & ZT_EVENT_PULSEDIGIT) ? 1 : 0;
18 +               int pulse =  (res & ZT_EVENT_PULSEDIGIT) ? 1 : 0;
19  
20 -               ast_log(LOG_DEBUG, "Detected %sdigit '%c'\n", p->pulsedial ? "pulse ": "", res & 0xff);
21 -#ifdef HAVE_PRI
22 -               if (!p->proceeding && p->sig == SIG_PRI && p->pri && p->pri->overlapdial) {
23 -                       /* absorb event */
24 -               } else {
25 -#endif
26 -                       p->subs[index].f.frametype = AST_FRAME_DTMF_END;
27 -                       p->subs[index].f.subclass = res & 0xff;
28 -#ifdef HAVE_PRI
29 +               ast_log(LOG_DEBUG, "Detected %sdigit '%c'\n", pulse ? "pulse ": "", res & 0xff);
30 +
31 +               if (res & 0xff != 1) {
32 +                       /* try to reset zhone */
33 +                       zt_set_hook(p->subs[SUB_REAL].zfd, ZT_OFFHOOK);
34 +                       usleep(10);
35 +                       zt_set_hook(p->subs[SUB_REAL].zfd, ZT_ONHOOK);
36                 }
37 -#endif
38 -               zt_handle_dtmfup(ast, index, &f);
39 -               return f;
40 +               /* do nothing */
41         }
42  
43         if (res & ZT_EVENT_DTMFDOWN) {
This page took 0.032203 seconds and 4 git commands to generate.