{
char *to;
char *msg, *c;
- struct ast_rtp *rtp;
struct ast_channel *owner;
struct sip_peer *peer;
int pingtime;
ast_verbose(VERBOSE_PREFIX_3 "Got SIP response %d \"%s\" back from %s\n", resp, rest, inet_ntoa(p->sa.sin_addr));
p->alreadygone = 1;
if (p->rtp) {
- struct sockaddr_in sin = { AF_INET, };
- /* Immediately stop RTP by setting transmit to 0 */
- ast_rtp_setpeer(p->rtp, &sin);
+ /* Immediately stop RTP */
+ ast_rtp_stop(p->rtp);
}
/* XXX Locking issues?? XXX */
switch(resp) {
p->alreadygone = 1;
if (p->rtp) {
/* Immediately stop RTP */
- ast_rtp_destroy(p->rtp);
- p->rtp = NULL;
+ ast_rtp_stop(p->rtp);
}
if (p->owner)
ast_queue_hangup(p->owner, 1);
memcpy(us, &rtp->us, sizeof(rtp->us));
}
+void ast_rtp_stop(struct ast_rtp *rtp)
+{
+ memset(&rtp->them.sin_addr, 0, sizeof(rtp->them.sin_addr));
+ memset(&rtp->them.sin_port, 0, sizeof(rtp->them.sin_port));
+}
+
void ast_rtp_destroy(struct ast_rtp *rtp)
{
if (rtp->smoother)