Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAX fixes #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions libs/yiax/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ const TokenDict IAXInfoElement::s_ieData[] = {
{"CALLTOKEN", CALLTOKEN},
{"CAPABILITY2", CAPABILITY2},
{"FORMAT2", FORMAT2},
{"CALLINGANI2", CALLINGANI2},
{0,0}
};

Expand Down Expand Up @@ -455,6 +456,7 @@ bool IAXIEList::createFromFrame(const IAXFullFrame* frame, bool incoming)
case IAXInfoElement::RR_PKTS:
case IAXInfoElement::RR_DROPPED:
case IAXInfoElement::RR_OOO:
case IAXInfoElement::CALLINGANI2:
if (data[i] != 4) {
i = 0xFFFF;
break;
Expand All @@ -474,6 +476,7 @@ bool IAXIEList::createFromFrame(const IAXFullFrame* frame, bool incoming)
case IAXInfoElement::CALLINGTNS:
case IAXInfoElement::FIRMWAREVER:
case IAXInfoElement::RR_DELAY:
case IAXInfoElement::ENCRYPTION:
if (data[i] != 2) {
i = 0xFFFF;
break;
Expand All @@ -487,7 +490,6 @@ bool IAXIEList::createFromFrame(const IAXFullFrame* frame, bool incoming)
case IAXInfoElement::CALLINGPRES:
case IAXInfoElement::CALLINGTON:
case IAXInfoElement::CAUSECODE:
case IAXInfoElement::ENCRYPTION:
if (data[i] != 1) {
i = 0xFFFF;
break;
Expand All @@ -506,10 +508,12 @@ bool IAXIEList::createFromFrame(const IAXFullFrame* frame, bool incoming)
i += 1;
break;
default:
Debug(DebugInfo,"IAX Frame(%u,%u) with unknown IE identifier %u [%p]",
Debug(DebugWarn,"IAX Frame(%u,%u) with unknown IE identifier %u [%p]",
frame->type(),frame->subclass(),data[i-1],frame);
appendBinary((IAXInfoElement::Type)data[i-1],data+i+1,data[i]);
i += data[i] + 1;
// unknown IEs are skipped by asterisk for future compatibility
break;
}
if (i == 0xFFFF)
break;
Expand Down Expand Up @@ -683,6 +687,7 @@ void IAXIEList::toString(String& dest, const char* indent)
case IAXInfoElement::RR_DROPPED:
case IAXInfoElement::RR_OOO:
case IAXInfoElement::RR_DELAY:
case IAXInfoElement::CALLINGANI2:
dest << (unsigned int)((static_cast<IAXInfoElementNumeric*>(ie))->data());
break;
case IAXInfoElement::TRANSFERID:
Expand All @@ -701,11 +706,11 @@ void IAXIEList::toString(String& dest, const char* indent)
case IAXInfoElement::CALLINGTNS: //TODO: print more data
case IAXInfoElement::FIRMWAREVER:
case IAXInfoElement::VERSION:
case IAXInfoElement::ENCRYPTION: //TODO: print more data
ie->toString(dest);
break;
// 1 byte
case IAXInfoElement::IAX_UNKNOWN:
case IAXInfoElement::ENCRYPTION: //TODO: print more data
ie->toString(dest);
break;
case IAXInfoElement::CALLINGPRES:
Expand Down
1 change: 1 addition & 0 deletions libs/yiax/yateiax.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class YIAX_API IAXInfoElement : public RefObject
CALLTOKEN = 0x36, // BIN
CAPABILITY2 = 0x37, // BIN 1 byte version + array
FORMAT2 = 0x38, // BIN 1 byte version + array
CALLINGANI2 = 0x39, // DW
};

/**
Expand Down