diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-08-06 08:26:54 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-08-06 08:29:37 +0800 |
commit | 4634013cde42402d1ab744986c4c064efc53c080 (patch) | |
tree | 3b55c9f8be99175b2a50ee8028036080470766db /openbsc/src/mgcp | |
parent | 9c31cfc3a23bf1218800da6ddebd083817ef20d4 (diff) |
mgcp: Make the CI uint32_t all the way to avoid mismatch
Diffstat (limited to 'openbsc/src/mgcp')
-rw-r--r-- | openbsc/src/mgcp/mgcp_protocol.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c index 743913264..e5f9a145d 100644 --- a/openbsc/src/mgcp/mgcp_protocol.c +++ b/openbsc/src/mgcp/mgcp_protocol.c @@ -89,7 +89,7 @@ static struct msgb *handle_delete_con(struct mgcp_config *cfg, struct msgb *msg) static struct msgb *handle_modify_con(struct mgcp_config *cfg, struct msgb *msg); static struct msgb *handle_rsip(struct mgcp_config *cfg, struct msgb *msg); -static int generate_call_id(struct mgcp_config *cfg) +static uint32_t generate_call_id(struct mgcp_config *cfg) { int i; @@ -170,7 +170,7 @@ static struct msgb *create_response_with_sdp(struct mgcp_endpoint *endp, addr = endp->cfg->source_addr; snprintf(sdp_record, sizeof(sdp_record) - 1, - "I: %d\n\n" + "I: %u\n\n" "v=0\r\n" "c=IN IP4 %s\r\n" "m=audio %d RTP/AVP %d\r\n" @@ -324,11 +324,13 @@ static int verify_call_id(const struct mgcp_endpoint *endp, } static int verify_ci(const struct mgcp_endpoint *endp, - const char *ci) + const char *_ci) { - if (atoi(ci) != endp->ci) { - LOGP(DMGCP, LOGL_ERROR, "ConnectionIdentifiers do not match on 0x%x. %d != %s\n", - ENDPOINT_NUMBER(endp), endp->ci, ci); + uint32_t ci = strtoul(_ci, NULL, 10); + + if (ci != endp->ci) { + LOGP(DMGCP, LOGL_ERROR, "ConnectionIdentifiers do not match on 0x%x. %u != %s\n", + ENDPOINT_NUMBER(endp), endp->ci, _ci); return -1; } |