Пример #1
0
static void handler(void *user_data, v8_result_t *result)
{
    const char *s;
    
    s = (const char *) user_data;
    
    if (result == NULL)
    {
        printf("%s V.8 negotiation failed\n", s);
        return;
    }
    printf("%s V.8 negotiation result:\n", s);
    printf("  Call function '%s'\n", v8_call_function_to_str(result->call_function));
    printf("  Negotiated modulation '%s'\n", v8_modulation_to_str(result->negotiated_modulation));
    printf("  Protocol '%s'\n", v8_protocol_to_str(result->protocol));
    printf("  PSTN access '%s'\n", v8_pstn_access_to_str(result->pstn_access));
    printf("  PCM modem availability '%s'\n", v8_pcm_modem_availability_to_str(result->pcm_modem_availability));
    if (result->call_function == V8_CALL_V_SERIES
        &&
        result->negotiated_modulation == V8_MOD_V90
        &&
        result->protocol == V8_PROTOCOL_LAPM_V42)
    {
        negotiations_ok++;
    }
}
Пример #2
0
SPAN_DECLARE(void) v8_log_supported_modulations(v8_state_t *s, int modulation_schemes)
{
    const char *comma;
    int i;
    
    comma = "";
    span_log(&s->logging, SPAN_LOG_FLOW, "");
    for (i = 0;  i < 32;  i++)
    {
        if ((modulation_schemes & (1 << i)))
        {
            span_log(&s->logging, SPAN_LOG_FLOW | SPAN_LOG_SUPPRESS_LABELLING, "%s%s", comma, v8_modulation_to_str(modulation_schemes & (1 << i)));
            comma = ", ";
        }
    }
    span_log(&s->logging, SPAN_LOG_FLOW | SPAN_LOG_SUPPRESS_LABELLING, " supported\n");
}