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: https://origsvn.digium.com/svn/asterisk/trunk@61702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-04-20 21:12:53 +00:00
parent c21f118a65
commit b94378b5e6
5 changed files with 139 additions and 0 deletions

View File

@@ -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);