summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/audio.c b/src/audio.c
index d1b19fd..78adc7d 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -132,7 +132,6 @@ struct aurx {
int16_t *sampv_rs; /**< Sample buffer for resampler */
uint32_t ptime; /**< Packet time for receiving */
int pt; /**< Payload type for incoming RTP */
- int pt_tel; /**< Event payload type - receive */
};
@@ -594,9 +593,15 @@ static void stream_recv_handler(const struct rtp_header *hdr,
goto out;
/* Telephone event? */
- if (hdr->pt == rx->pt_tel) {
- handle_telev(a, mb);
- return;
+ if (hdr->pt != rx->pt) {
+ const struct sdp_format *fmt;
+
+ fmt = sdp_media_lformat(stream_sdpmedia(a->strm), hdr->pt);
+
+ if (fmt && !str_casecmp(fmt->name, "telephone-event")) {
+ handle_telev(a, mb);
+ return;
+ }
}
/* Comfort Noise (CN) as of RFC 3389 */
@@ -631,8 +636,6 @@ static int add_telev_codec(struct audio *a)
if (err)
return err;
- a->rx.pt_tel = sf->pt;
-
return err;
}
@@ -1367,10 +1370,10 @@ int audio_debug(struct re_printf *pf, const struct audio *a)
aubuf_debug, tx->aubuf,
tx->ptime);
- err |= re_hprintf(pf, " rx: %H %H ptime=%ums pt=%d pt_tel=%d\n",
+ err |= re_hprintf(pf, " rx: %H %H ptime=%ums pt=%d\n",
aucodec_print, rx->ac,
aubuf_debug, rx->aubuf,
- rx->ptime, rx->pt, rx->pt_tel);
+ rx->ptime, rx->pt);
err |= re_hprintf(pf,
" %H"