diff --git a/libs/freetdm/src/zap_isdn.c b/libs/freetdm/src/zap_isdn.c index 800627d6a2..e9647319c4 100644 --- a/libs/freetdm/src/zap_isdn.c +++ b/libs/freetdm/src/zap_isdn.c @@ -196,11 +196,12 @@ static L3INT zap_isdn_931_34(void *pvt, L2UCHAR *msg, L2INT mlen) zchan->caller_data.raw_data_len = cplen; zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_RING); fail = 0; + zap_log(ZAP_LOG_CRIT, "hi %s\n", zchan->caller_data.cid_num); } } if (fail) { - zap_log(ZAP_LOG_CRIT, "FIX ME!\n"); + zap_log(ZAP_LOG_CRIT, "FIX ME! %s\n", zap_channel_state2str(zchan->state)); // add me } diff --git a/libs/freetdm/src/zap_zt.c b/libs/freetdm/src/zap_zt.c index be33a7c536..47d5d3cc6b 100644 --- a/libs/freetdm/src/zap_zt.c +++ b/libs/freetdm/src/zap_zt.c @@ -171,11 +171,22 @@ static unsigned zt_open_range(zap_span_t *span, unsigned start, unsigned end, za zchan->physical_span_id = ztp.span_no; zchan->physical_chan_id = ztp.chan_no; - if (type == ZAP_CHAN_TYPE_FXS || type == ZAP_CHAN_TYPE_FXO) { + if (type == ZAP_CHAN_TYPE_FXS || type == ZAP_CHAN_TYPE_FXO || type == ZAP_CHAN_TYPE_B) { if (ztp.g711_type == ZT_G711_ALAW) { zchan->native_codec = zchan->effective_codec = ZAP_CODEC_ALAW; - } else { + } else if (ztp.g711_type == ZT_G711_MULAW) { zchan->native_codec = zchan->effective_codec = ZAP_CODEC_ULAW; + } else { + int type; + + if (zchan->span->trunk_type == ZAP_TRUNK_E1) { + type = ZAP_CODEC_ALAW; + } else { + type = ZAP_CODEC_ULAW; + } + + zchan->native_codec = zchan->effective_codec = type; + } }