summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2003-03-20 22:01:53 +0000
committerMark Spencer <markster@digium.com>2003-03-20 22:01:53 +0000
commit83016e1bce1286bc6454366025877ad4acc12c29 (patch)
tree671d8650b6e48650564af2af9e0f25ce7bfb949b
parentf02b64d25839f5034c496823a12e749431bc9074 (diff)
Don't destory rtp until destroy, use rtp_stop instead
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@668 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-xchannels/chan_sip.c9
-rwxr-xr-xinclude/asterisk/rtp.h2
-rwxr-xr-xrtp.c6
3 files changed, 11 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 9e9d3585e..fbeba9a6f 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3117,7 +3117,6 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
{
char *to;
char *msg, *c;
- struct ast_rtp *rtp;
struct ast_channel *owner;
struct sip_peer *peer;
int pingtime;
@@ -3267,9 +3266,8 @@ retrylock:
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) {
@@ -3608,8 +3606,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
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);
diff --git a/include/asterisk/rtp.h b/include/asterisk/rtp.h
index 769656cd0..6ae6b0a2c 100755
--- a/include/asterisk/rtp.h
+++ b/include/asterisk/rtp.h
@@ -95,6 +95,8 @@ int ast_rtp_proto_register(struct ast_rtp_protocol *proto);
void ast_rtp_proto_unregister(struct ast_rtp_protocol *proto);
+void ast_rtp_stop(struct ast_rtp *rtp);
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
diff --git a/rtp.c b/rtp.c
index faa39c741..555b7cf1c 100755
--- a/rtp.c
+++ b/rtp.c
@@ -586,6 +586,12 @@ void ast_rtp_get_us(struct ast_rtp *rtp, struct sockaddr_in *us)
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)