@@ 12,7 12,6 @@
// Globals, ew
static void *chat = NULL;
-static void *dtmf = NULL;
static pa_simple *pulse = NULL;
static pa_sample_spec ss_rec;
static pa_simple *pulse_rec = NULL;
@@ 118,9 117,6 @@ void on_call_media(void* session, bool audio, bool video, void* dummy) {
streams[cstreams++] = snikket_jingle_media_stream_make_audio();
size_t ctracks = snikket_jingle_media_stream_get_tracks(streams[cstreams-1], &tracks);
for (size_t i = 0; i < ctracks; i++) {
- if (!dtmf) {
- dtmf = snikket_jingle_dtmf_sender_new(tracks[i]);
- }
snikket_jingle_media_stream_track_add_pcm_listener(tracks[i], &on_pcm, NULL);
snikket_jingle_media_stream_track_add_ready_for_pcm_listener(tracks[i], &on_ready_for_pcm, tracks[i]);
snikket_release(tracks[i]);
@@ 235,8 231,10 @@ int main(int argc, const char **argv) {
return 1;
}
+ void *dtmf = NULL;
char tone[2] = " ";
while ((tone[0] = fgetc(stdin)) != EOF && tone[0] != 4) {
+ if (!dtmf && chat) dtmf = snikket_chat_dtmf(chat);
if (dtmf) snikket_jingle_dtmf_sender_insert_dtmf(dtmf, tone);
}