diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-08-08 07:51:51 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-08-08 07:51:51 +0800 |
commit | 5b084017017dc410897e6e4691d0bac10f0639c1 (patch) | |
tree | b01055fc295b2866f6c53a8fd849757bc4042706 | |
parent | 7b7c297c8f5de70fb534643c28b2bd5851f08f90 (diff) |
mgcp: Use uint32_t for the CI in every place.
-rw-r--r-- | include/mgcp/mgcp.h | 2 | ||||
-rw-r--r-- | include/mgcp/mgcp_internal.h | 2 | ||||
-rw-r--r-- | src/mgcp/mgcp_protocol.c | 14 |
3 files changed, 10 insertions, 8 deletions
diff --git a/include/mgcp/mgcp.h b/include/mgcp/mgcp.h index db05cc4..8271c7f 100644 --- a/include/mgcp/mgcp.h +++ b/include/mgcp/mgcp.h @@ -107,7 +107,7 @@ struct mgcp_config { void *data; struct mgcp_endpoint *endpoints; - unsigned int last_call_id; + uint32_t last_call_id; }; /* config management */ diff --git a/include/mgcp/mgcp_internal.h b/include/mgcp/mgcp_internal.h index 2d9629a..b190f55 100644 --- a/include/mgcp/mgcp_internal.h +++ b/include/mgcp/mgcp_internal.h @@ -50,7 +50,7 @@ struct mgcp_rtp_state { }; struct mgcp_endpoint { - int ci; + uint32_t ci; char *callid; char *local_options; int conn_mode; diff --git a/src/mgcp/mgcp_protocol.c b/src/mgcp/mgcp_protocol.c index 8b4923f..e4d1996 100644 --- a/src/mgcp/mgcp_protocol.c +++ b/src/mgcp/mgcp_protocol.c @@ -91,7 +91,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; @@ -172,7 +172,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" @@ -326,11 +326,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; } |