示例#1
0
/*
 *  Function: poundDialingEnabled()
 *
 *  Parameters: None
 *
 *  Description: Determines if '#' is treated as a "dial now" character
 *
 *  Returns: TRUE if # is treated as end of dial signal
 *           FALSE if # is treated as a dialed digit
 */
static boolean
poundDialingEnabled (void)
{
    if (sip_regmgr_get_cc_mode(1) == REG_MODE_NON_CCM) {
        /*
         * Operating in Peer-to-Peer SIP mode, allow # dialing
         */
        return (TRUE);
    } else {
        return (FALSE);
    }
}
示例#2
0
/*
 *  Function: dp_dial_immediate
 *
 *  Parameters:
 *        line_id - line number
 *        call_id - call indentification
 *
 *  Description:
 *     called when the client wants DP module to stop matching and
 *     send the dialstring. This used for example when User pressed Dial Softkey.
 *
 *  Returns: none
 */
static void
dp_dial_immediate (line_t line, callid_t call_id, boolean collect_more,
                   char *digit_str, char *global_call_id, 
                   monitor_mode_t monitor_mode)
{
    const char fname[] = "dp_dial_immediate";

    if (g_dp_int.line != line || g_dp_int.call_id != call_id) {
        return;
    }

    DPINT_DEBUG(DEB_F_PREFIX"line=%d call_id=%d dialed digits=%s\n",
                DEB_F_PREFIX_ARGS(DIALPLAN, fname), line, call_id, g_dp_int.gDialed);

    /* Do not dial anything else even if UI asks to do so, if the line is PLAR */
    if (dp_check_and_handle_plar_dialing(line, call_id) == TRUE) {
        return;
    }

    if (g_dp_int.dial_timer) {
        (void) cprCancelTimer(g_dp_int.dial_timer);
    }


    if (g_dp_int.gDialplanDone) {

        // if used with CCM, we should allow user to continue to input more digits 
        // after they've entered partial destination number onhook then press dial
        if (sip_regmgr_get_cc_mode(line) == REG_MODE_CCM) {
            return;
        }
        // KPML mode and user pressed DIAL softkey. So send 0x82 digit to KPML
        if (!kpml_update_dialed_digits(line, call_id, (char)DIAL_KEY)) {

            kpml_quarantine_digits(line, call_id, (char)DIAL_KEY);
        }
        return;
    }

    /* CTI applications can do a initcallreq without providing the dialstring
     * In this case generate just the offhook event to GSM
     */

    if (digit_str[0] == 0 && global_call_id[0] != 0) {

        cc_offhook_ext(CC_SRC_GSM, call_id, line, 
                       global_call_id, monitor_mode);
        return;
    }

    g_dp_int.gDialplanDone = TRUE;

    if (digit_str[0] != 0) {
        sstrncpy(g_dp_int.gDialed, digit_str, MAX_DIALSTRING);
    }

    /* This case should not happen, as dial softkey is displayed only after the
     * 1st digit. dp_dial_immediate function is called for dial softkey invocation.
     */
    if (g_dp_int.gDialed[0] == 0) {
        return;

    } else {
        g_dp_int.line = line;
        g_dp_int.call_id = call_id;

        kpml_flush_quarantine_buffer(line, call_id);

        cc_dialstring_ext(CC_SRC_GSM, call_id, line, g_dp_int.gDialed,
                          global_call_id, monitor_mode);
    }

    if (collect_more == FALSE) {
        /*
         * Since no more digits are collected,
         * allow proceed event to go through UI.
         */
        g_dp_int.allow_proceed = TRUE;

        kpml_set_subscription_reject(line, call_id);

        kpml_flush_quarantine_buffer(line, call_id);
    }

}