diff options
author | Mark Spencer <markster@digium.com> | 2003-06-28 18:35:58 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2003-06-28 18:35:58 +0000 |
commit | 9befc6968493c84e90a25d4b02889c8ca1853cc8 (patch) | |
tree | 146100d02e079c1c38abfe8de01a88185573f5c8 /channels | |
parent | f5e13431a53e5ce6ebd93e447633b710ef639632 (diff) |
Properly handle broken up packets
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_sip.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 35a506aeb..e911962c3 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1604,7 +1604,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) int portno=0; int vportno=0; int peercapability, peernoncodeccapability; - int vpeercapability, vpeernoncodeccapability; + int vpeercapability=0, vpeernoncodeccapability=0; struct sockaddr_in sin; char *codecs; struct hostent *hp; @@ -1690,8 +1690,6 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) sdpLineNum_iterator_init(&iterator); while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') { char* mimeSubtype = ast_strdupa(a); // ensures we have enough space - if (sipdebug) - ast_verbose("Pre-Found description format %s\n", mimeSubtype); if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) != 2) continue; if (sipdebug) ast_verbose("Found description format %s\n", mimeSubtype); @@ -1704,7 +1702,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) // Now gather all of the codecs that were asked for: ast_rtp_get_current_formats(p->rtp, &peercapability, &peernoncodeccapability); - ast_rtp_get_current_formats(p->vrtp, + if (p->vrtp) + ast_rtp_get_current_formats(p->vrtp, &vpeercapability, &vpeernoncodeccapability); p->capability = capability & (peercapability | vpeercapability); p->noncodeccapability = noncodeccapability & (peernoncodeccapability | vpeernoncodeccapability); |