diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-20 21:12:53 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-20 21:12:53 +0000 |
commit | 8d14d2255818deacb493ff997938be8fa9786de6 (patch) | |
tree | d9a976f0c1e49c15f520493fa94cdd56b6ae937c /channels/iax2-parser.c | |
parent | 59c77fe14b1b7a0a89147f7f82b58ab0265098f5 (diff) |
Merge changes from team/russell/iax2_osp
This set of changes adds OSP support to chan_iax2. However, I have modified
the patch a bit from what was submitted. You now use the CHANNEL() function
to get and set the OSP token for IAX2.
(issue #8531, reported by and original patch by homesick, patch updated by me)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@61702 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/iax2-parser.c')
-rw-r--r-- | channels/iax2-parser.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/channels/iax2-parser.c b/channels/iax2-parser.c index c491f7a02..28bb07230 100644 --- a/channels/iax2-parser.c +++ b/channels/iax2-parser.c @@ -264,6 +264,7 @@ static struct iax2_ie { { IAX_IE_RR_DROPPED, "RR_DROPPED", dump_int }, { IAX_IE_RR_OOO, "RR_OUTOFORDER", dump_int }, { IAX_IE_VARIABLE, "VARIABLE", dump_string }, + { IAX_IE_OSPTOKEN, "OSPTOKEN" }, }; static struct iax2_ie prov_ies[] = { @@ -617,6 +618,7 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) int ie; char tmp[256], *tmp2; struct ast_variable *var, *var2, *prev; + unsigned int count; memset(ies, 0, (int)sizeof(struct iax_ies)); ies->msgcount = -1; ies->firmwarever = -1; @@ -930,6 +932,15 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) ies->vars = var; } break; + case IAX_IE_OSPTOKEN: + if ((count = data[2]) < IAX_MAX_OSPBLOCK_NUM) { + ies->osptokenblock[count] = (char *)data + 2 + 1; + ies->ospblocklength[count] = len - 1; + } else { + snprintf(tmp, (int)sizeof(tmp), "Expected OSP token block index to be 0~%d but was %d\n", IAX_MAX_OSPBLOCK_NUM - 1, count); + errorf(tmp); + } + break; default: snprintf(tmp, (int)sizeof(tmp), "Ignoring unknown information element '%s' (%d) of length %d\n", iax_ie2str(ie), ie, len); outputf(tmp); |