Index: channels/chan_dahdi.c =================================================================== --- channels/chan_dahdi.c (revision 211273) +++ channels/chan_dahdi.c (working copy) @@ -2021,6 +2021,19 @@ p->dialing = flag; } +static void my_set_ringtimeout(void *pvt, int ringt) +{ + struct dahdi_pvt *p = pvt; + p->ringt = ringt; +} + +/* +static int my_get_ringtimeout(void *pvt) +{ + struct dahdi_pvt *p = pvt; + return p->ringt; +} +*/ static void my_increase_ss_count(void) { ast_mutex_lock(&ss_thread_lock); @@ -2743,6 +2756,8 @@ .get_sub_fd = my_get_sub_fd, .set_cadence = my_set_cadence, .set_dialing = my_set_dialing, + .set_ringtimeout = my_set_ringtimeout, +/* .get_ringtimeout = my_get_ringtimeout, */ }; static struct dahdi_pvt *round_robin[32]; Index: channels/sig_analog.c =================================================================== --- channels/sig_analog.c (revision 211273) +++ channels/sig_analog.c (working copy) @@ -707,6 +707,25 @@ } } +static void analog_set_ringtimeout(struct analog_pvt *p, int ringt) +{ + p->ringt = ringt; + if (!p->calls->set_ringtimeout) { + return; + } + p->calls->set_ringtimeout(p->chan_pvt, ringt); +} + +/* +static int analog_get_ringtimeout(struct analog_pvt *p) +{ + if (!p->calls->get_ringtimeout) { + return -1; + } + return p->calls->get_ringtimeout(p->chan_pvt); +} +*/ + int analog_call(struct analog_pvt *p, struct ast_channel *ast, char *rdest, int timeout) { int res, index,mysig; @@ -1060,7 +1079,7 @@ if (!p->subs[ANALOG_SUB_REAL].owner && !p->subs[ANALOG_SUB_CALLWAIT].owner && !p->subs[ANALOG_SUB_THREEWAY].owner) { p->owner = NULL; - p->ringt = 0; + analog_set_ringtimeout(p, 0); p->outgoing = 0; p->onhooktime = time(NULL); p->cidrings = 1; @@ -1130,7 +1149,7 @@ case ANALOG_SIG_FXSLS: case ANALOG_SIG_FXSGS: case ANALOG_SIG_FXSKS: - p->ringt = 0; + analog_set_ringtimeout(p, 0); /* Fall through */ case ANALOG_SIG_EM: case ANALOG_SIG_EM_E1: @@ -2093,7 +2112,7 @@ ast_setstate(chan, AST_STATE_RING); chan->rings = 1; - p->ringt = p->ringt_base; + analog_set_ringtimeout(p, p->ringt_base); res = ast_pbx_run(chan); if (res) { ast_hangup(chan); @@ -2413,7 +2432,7 @@ case ANALOG_SIG_FXSGS: case ANALOG_SIG_FXSKS: if (ast->_state == AST_STATE_RING) { - p->ringt = p->ringt_base; + analog_set_ringtimeout(p, p->ringt_base); } /* Fall through */ @@ -2457,7 +2476,7 @@ case ANALOG_SIG_FXSGS: case ANALOG_SIG_FXSKS: if (ast->_state == AST_STATE_RING) { - p->ringt = p->ringt_base; + analog_set_ringtimeout(p, p->ringt_base); } break; } @@ -3007,7 +3026,7 @@ case ANALOG_SIG_FXSLS: case ANALOG_SIG_FXSGS: case ANALOG_SIG_FXSKS: - i->ringt = i->ringt_base; + analog_set_ringtimeout(i, i->ringt_base); /* Fall through */ case ANALOG_SIG_EMWINK: case ANALOG_SIG_FEATD: Index: channels/sig_analog.h =================================================================== --- channels/sig_analog.h (revision 211273) +++ channels/sig_analog.h (working copy) @@ -193,6 +193,9 @@ int (* const get_sub_fd)(void *pvt, enum analog_sub sub); void (* const set_cadence)(void *pvt, int *cidrings, struct ast_channel *chan); void (* const set_dialing)(void *pvt, int flag); + void (* const set_ringtimeout)(void *pvt, int ringt); + int (* const get_ringtimeout)(void *pvt); + };