Skip to content

Commit

Permalink
Improve logging of SDP parser
Browse files Browse the repository at this point in the history
to make the error spotting much easier
  • Loading branch information
bogdan-iancu committed Sep 23, 2021
1 parent cf53d18 commit b7c432a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions parser/sdp/sdp_helpr_funcs.c
Expand Up @@ -90,7 +90,8 @@ int extract_rtpmap(str *body,
cp1 = (char*)l_memmem(cp, "/", len, 1);
len -= cp1 - cp;
if (cp1==NULL || len <= 1 || cp == cp1) {
LM_ERR("invalid encoding in `a=rtpmap'\n");
LM_ERR("invalid encoding in `a=rtpmap' [%.*s]\n",
rtpmap_payload->len,rtpmap_payload->s);
return -1;
}
rtpmap_encoding->len = cp1 - cp;
Expand All @@ -110,7 +111,8 @@ int extract_rtpmap(str *body,
rtpmap_clockrate->len = cp1-cp;
len -= cp1 - cp;
if (len <= 1) {
LM_ERR("invalid encoding in `a=rtpmap:'\n");
LM_ERR("invalid encoding in `a=rtpmap' [%.*s]\n",
rtpmap_payload->len,rtpmap_payload->s);
return -1;
}
rtpmap_parmas->s = cp1 + 1;
Expand Down

0 comments on commit b7c432a

Please sign in to comment.