comparison mgw/dtmf_timer.c @ 150:529906fddcfa

mgw DTMF timing fix in the corner case of no speech arriving between the end of one DTMF and the start of next
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 11 Oct 2022 14:10:29 -0800
parents f062c32a5116
children
comparison
equal deleted inserted replaced
149:cfc249906145 150:529906fddcfa
53 ep->dtmf_sample_ptr += SAMPLES_PER_FRAME; 53 ep->dtmf_sample_ptr += SAMPLES_PER_FRAME;
54 addrlen = sizeof(struct sockaddr_in); 54 addrlen = sizeof(struct sockaddr_in);
55 sendto(ep->rtp_pstn.rtp_fd, &pkt, RTP_PACKET_SIZE_PSTN, 0, 55 sendto(ep->rtp_pstn.rtp_fd, &pkt, RTP_PACKET_SIZE_PSTN, 0,
56 (struct sockaddr *) &ep->rtp_pstn.remote_addr, addrlen); 56 (struct sockaddr *) &ep->rtp_pstn.remote_addr, addrlen);
57 ep->dtmf_frames_sent++; 57 ep->dtmf_frames_sent++;
58 ep->dtmf_last_time = cur_event_time;
58 frame_limit = ep->dtmf_stop_req ? DTMF_MIN_FRAMES : DTMF_MAX_FRAMES; 59 frame_limit = ep->dtmf_stop_req ? DTMF_MIN_FRAMES : DTMF_MAX_FRAMES;
59 if (ep->dtmf_frames_sent >= frame_limit) 60 if (ep->dtmf_frames_sent >= frame_limit)
60 return 1; 61 return 1;
61 else 62 else
62 return 0; 63 return 0;