--- chan_mgcp.c-orig 2012-05-14 21:44:27.000000000 +0200 +++ chan_mgcp.c 2013-02-28 12:53:37.377076390 +0100 @@ -1990,8 +1990,9 @@ ast_log(LOG_WARNING, "Unable to lookup host in c= line, '%s'\n", c); return -1; } - if (sscanf(m, "audio %30d RTP/AVP %n", &portno, &len) != 1) { - ast_log(LOG_WARNING, "Unable to determine port number for RTP in '%s'\n", m); + len = 0; + if (sscanf(m, "audio %30d RTP/AVP %n", &portno, &len) != 1 || !len) { + ast_log(LOG_WARNING, "Unable to determine port number or codecs for RTP in '%s'\n", m); return -1; } sin.sin_family = AF_INET;