mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
mgw, mgcp-li: Handle X-Osmux param name as case insensitive
RFC3435 states most text (except SDP) must be handled as case insensitive. Related: OS#4001 Change-Id: Iac073f1db46569b46eddeaecc9934a2986bd50f1
This commit is contained in:
@@ -403,12 +403,12 @@ static int mgcp_parse_osmux_cid(const char *line)
|
||||
int osmux_cid;
|
||||
|
||||
|
||||
if (strstr(line + 2, "Osmux: *")) {
|
||||
if (strcasecmp(line + 2, "Osmux: *") == 0) {
|
||||
LOGP(DLMGCP, LOGL_DEBUG, "Parsed wilcard Osmux CID\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sscanf(line + 2, "Osmux: %u", &osmux_cid) != 1) {
|
||||
if (sscanf(line + 2 + 7, "%u", &osmux_cid) != 1) {
|
||||
LOGP(DLMGCP, LOGL_ERROR, "Failed parsing Osmux in MGCP msg line: %s\n",
|
||||
line);
|
||||
return -2;
|
||||
@@ -602,7 +602,8 @@ static int parse_head_params(struct mgcp_response *r)
|
||||
goto exit;
|
||||
break;
|
||||
case 'X':
|
||||
if (strncmp("Osmux: ", line + 2, strlen("Osmux: ")) == 0) {
|
||||
case 'x':
|
||||
if (strncasecmp("Osmux: ", line + 2, strlen("Osmux: ")) == 0) {
|
||||
rc = mgcp_parse_osmux_cid(line);
|
||||
if (rc < 0) {
|
||||
/* -1: we don't want wildcards in response. -2: error */
|
||||
|
@@ -360,12 +360,12 @@ int mgcp_parse_osmux_cid(const char *line)
|
||||
int osmux_cid;
|
||||
|
||||
|
||||
if (strstr(line + 2, "Osmux: *")) {
|
||||
if (strcasecmp(line + 2, "Osmux: *") == 0) {
|
||||
LOGP(DLMGCP, LOGL_DEBUG, "Parsed wilcard Osmux CID\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sscanf(line + 2, "Osmux: %u", &osmux_cid) != 1) {
|
||||
if (sscanf(line + 2 + 7, "%u", &osmux_cid) != 1) {
|
||||
LOGP(DLMGCP, LOGL_ERROR, "Failed parsing Osmux in MGCP msg line: %s\n",
|
||||
line);
|
||||
return -2;
|
||||
|
@@ -816,7 +816,8 @@ static struct msgb *handle_create_con(struct mgcp_parse_data *p)
|
||||
mode = (const char *)line + 3;
|
||||
break;
|
||||
case 'X':
|
||||
if (strncmp("Osmux: ", line + 2, strlen("Osmux: ")) == 0) {
|
||||
case 'x':
|
||||
if (strncasecmp("Osmux: ", line + 2, strlen("Osmux: ")) == 0) {
|
||||
/* If osmux is disabled, just skip setting it up */
|
||||
if (!p->endp->cfg->osmux)
|
||||
break;
|
||||
@@ -1099,7 +1100,8 @@ static struct msgb *handle_modify_con(struct mgcp_parse_data *p)
|
||||
silent = strcmp("noanswer", line + 3) == 0;
|
||||
break;
|
||||
case 'X':
|
||||
if (strncmp("Osmux: ", line + 2, strlen("Osmux: ")) == 0) {
|
||||
case 'x':
|
||||
if (strncasecmp("Osmux: ", line + 2, strlen("Osmux: ")) == 0) {
|
||||
/* If osmux is disabled, just skip setting it up */
|
||||
if (!p->endp->cfg->osmux)
|
||||
break;
|
||||
|
Reference in New Issue
Block a user