diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-12-11 18:30:19 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-12-16 12:10:26 +0100 |
commit | 2df07d549db99e8aeb829308311f420bd7ee2f85 (patch) | |
tree | f59179d3e57b486f8a9f12988a1b8de178a49124 /src/mgcp/mgcp_protocol.c | |
parent | fe55ed14f74ba9cfc3c4251adfe180cd36396e7d (diff) |
mgw: Implement the specific RSIP handling
The RSIP has morphed from a global reset, to a per trunk reset and now
it is possible to reset specific ranges on a trunk. This will be used by
the ISUP filter code in the STP.
For legacy range == -1 will be used. This will reset all endpoints
on the trunk. Use OSMO_MAX on endpoint and number of endpoints in case
number_endpoints is 0.
This code will now free everything from the endpoint to endpoint + range
including endpoint+range.
Diffstat (limited to 'src/mgcp/mgcp_protocol.c')
-rw-r--r-- | src/mgcp/mgcp_protocol.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mgcp/mgcp_protocol.c b/src/mgcp/mgcp_protocol.c index be6ec00..f847caf 100644 --- a/src/mgcp/mgcp_protocol.c +++ b/src/mgcp/mgcp_protocol.c @@ -860,13 +860,29 @@ out_silent: static struct msgb *handle_rsip(struct mgcp_parse_data *p) { + int range = -1; + const char *line; + if (p->found != 0) { LOGP(DMGCP, LOGL_ERROR, "Failed to find the endpoint.\n"); return NULL; } + for_each_line(line, p->save) { + if (strlen(line) < 4) + continue; + + switch (line[0]) { + case 'R': + range = atoi(line + 3); + break; + } + } + + if (p->cfg->reset_cb) - p->cfg->reset_cb(p->endp->tcfg); + p->cfg->reset_cb(p->endp->tcfg, + ENDPOINT_NUMBER(p->endp), range); return NULL; } |