Index: channels/sig_pri.c =================================================================== --- channels/sig_pri.c (revision 417185) +++ channels/sig_pri.c (working copy) @@ -1516,6 +1516,9 @@ #if defined(HAVE_PRI_CALL_WAITING) new_chan->is_call_waiting = old_chan->is_call_waiting; #endif /* defined(HAVE_PRI_CALL_WAITING) */ +#if defined(HAVE_PRI_SETUP_ACK_INBAND) + new_chan->no_dialed_digits = old_chan->no_dialed_digits; +#endif /* defined(HAVE_PRI_SETUP_ACK_INBAND) */ #if defined(HAVE_PRI_AOC_EVENTS) old_chan->aoc_s_request_invoke_id_valid = 0; @@ -1531,6 +1534,9 @@ #if defined(HAVE_PRI_CALL_WAITING) old_chan->is_call_waiting = 0; #endif /* defined(HAVE_PRI_CALL_WAITING) */ +#if defined(HAVE_PRI_SETUP_ACK_INBAND) + old_chan->no_dialed_digits = 0; +#endif /* defined(HAVE_PRI_SETUP_ACK_INBAND) */ /* More stuff to transfer to the new channel. */ new_chan->call_level = old_chan->call_level; @@ -7363,8 +7369,18 @@ * We explicitly DO NOT want to check PRI_PROG_CALL_NOT_E2E_ISDN * because it will mess up ISDN to SIP interoperability for * the ALERTING message. + * + * Q.931 Section 5.1.3 says that in scenarios with overlap + * dialing where no called digits are received and the tone + * option requires dialtone, the switch MAY send an inband + * progress indication ie to indicate dialtone presence in + * the SETUP ACKNOWLEDGE. Therefore, if we did not send any + * digits with the SETUP then we must assume that dialtone + * is present and open the voice path. Fortunately when + * interoperating with SIP, we should be sending digits. */ - && (e->setup_ack.progressmask & PRI_PROG_INBAND_AVAILABLE) + && ((e->setup_ack.progressmask & PRI_PROG_INBAND_AVAILABLE) + || pri->pvts[chanpos]->no_dialed_digits) #endif /* defined(HAVE_PRI_SETUP_ACK_INBAND) */ ) { /* @@ -7977,7 +7993,12 @@ if (!keypad || !ast_strlen_zero(c + p->stripmsd + dp_strip)) #endif /* defined(HAVE_PRI_SETUP_KEYPAD) */ { - pri_sr_set_called(sr, c + p->stripmsd + dp_strip, pridialplan, s ? 1 : 0); + char *called = c + p->stripmsd + dp_strip; + + pri_sr_set_called(sr, called, pridialplan, s ? 1 : 0); +#if defined(HAVE_PRI_SETUP_ACK_INBAND) + p->no_dialed_digits = !called[0]; +#endif /* defined(HAVE_PRI_SETUP_ACK_INBAND) */ } #if defined(HAVE_PRI_SUBADDR) Index: channels/sig_pri.h =================================================================== --- channels/sig_pri.h (revision 417185) +++ channels/sig_pri.h (working copy) @@ -343,6 +343,10 @@ /*! \brief TRUE if this is a call waiting call */ unsigned int is_call_waiting:1; #endif /* defined(HAVE_PRI_CALL_WAITING) */ +#if defined(HAVE_PRI_SETUP_ACK_INBAND) + /*! TRUE if outgoing SETUP had no called digits */ + unsigned int no_dialed_digits:1; +#endif /* defined(HAVE_PRI_SETUP_ACK_INBAND) */ struct ast_channel *owner;