X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=route.c;h=925bfe86e3334f2a7d0a3ed6ff40db20f80d7a49;hp=7954b6feeb7d513914cb4725745bc8c9c6982056;hb=034d3a91404addedc1c7a3494862c79532b0b878;hpb=acaf278f7f616d264afe480e4f9c64768540941b diff --git a/route.c b/route.c index 7954b6f..925bfe8 100644 --- a/route.c +++ b/route.c @@ -1955,8 +1955,7 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset) struct timeval current_time; #ifdef WITH_MISDN struct mISDNport *mISDNport; - int avail, - any; + int avail; int jj; class Port *port; class Pfxs *ourfxs, *fxs; @@ -2250,7 +2249,6 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset) case MATCH_BUSY: case MATCH_IDLE: #ifdef WITH_MISDN - any = 0; mISDNport = mISDNport_first; while(mISDNport) { if (mISDNport->ifport) @@ -2394,7 +2392,7 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset) /* we must have greater or equal length to values */ if ((unsigned long)strlen(string) < comp_len) { /* special case for unfinished dialing */ - if (cond->match == MATCH_DIALING) { + if (cond->match == MATCH_DIALING && !e_dialinginfo.sending_complete) { couldbetrue = 1; /* could match */ comp_len = strlen(string); } else { @@ -2468,7 +2466,8 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset) cond = cond->next; } - if (timeout>now_ll && match==1) { /* the matching rule with timeout in the future */ + /* if sending complete, we use future match now, since waiting does not make sense anymore */ + if (timeout>now_ll && match==1 && !e_dialinginfo.sending_complete) { /* the matching rule with timeout in the future */ if (match_timeout == 0 || timeout < match_timeout) { /* first timeout or lower */ /* set timeout in the furture */ match_timeout = timeout;