Skip to content

Commit

Permalink
Updated SapWatch as not all AES67 uses rtpmap:96
Browse files Browse the repository at this point in the history
  • Loading branch information
martim01 committed Sep 10, 2019
1 parent 1da6226 commit 0cfda29
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
21 changes: 20 additions & 1 deletion pam2/pnlRTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,27 @@ void pnlRTP::OnSap(wxCommandEvent& event)
wxString sSDP = event.GetString().AfterFirst(wxT('\n'));
wxString sName;

wmLog::Get()->Log(wxT("OnSAP"));

//is it an L24 or L16 session
if(sSDP.Find(wxT("a=rtpmap:96 L24")) != wxNOT_FOUND || sSDP.Find(wxT("a=rtpmap:96 L16")) != wxNOT_FOUND)
bool bCanDecode(false);
wxArrayString asLines(wxStringTokenize(sSDP, wxT("\n")));
for(size_t i = 0; i < asLines.size(); i++)
{
if(asLines[i].Find(wxT("a=rtpmap:")) != wxNOT_FOUND)
{
unsigned long nCodec;
if(asLines[i].AfterFirst(wxT(':')).BeforeFirst(wxT(' ')).ToULong(&nCodec) && nCodec > 95 && nCodec < 127) //dynamic
{
if(asLines[i].Find(wxT("L24")) || asLines[i].Find(wxT("L16")))
{
bCanDecode = true;
break;
}
}
}
}
if(bCanDecode)
{
//find the source name:
int nStart = sSDP.Find(wxT("s="));
Expand Down
16 changes: 8 additions & 8 deletions pam2/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace AutoVersion{

//Date Version Types
static const char DATE[] = "10";
static const char MONTH[] = "07";
static const char MONTH[] = "09";
static const char YEAR[] = "2019";
static const char UBUNTU_VERSION_STYLE[] = "19.07";
static const char UBUNTU_VERSION_STYLE[] = "19.09";

//Software Status
static const char STATUS[] = "Release";
Expand All @@ -16,14 +16,14 @@ namespace AutoVersion{
//Standard Version Type
static const long MAJOR = 1;
static const long MINOR = 0;
static const long BUILD = 1225;
static const long REVISION = 6817;
static const long BUILD = 1228;
static const long REVISION = 6827;

//Miscellaneous Version Types
static const long BUILDS_COUNT = 3027;
#define RC_FILEVERSION 1,0,1225,6817
#define RC_FILEVERSION_STRING "1, 0, 1225, 6817\0"
static const char FULLVERSION_STRING [] = "1.0.1225.6817";
static const long BUILDS_COUNT = 3035;
#define RC_FILEVERSION 1,0,1228,6827
#define RC_FILEVERSION_STRING "1, 0, 1228, 6827\0"
static const char FULLVERSION_STRING [] = "1.0.1228.6827";

//These values are to keep track of your versioning state, don't modify them.
static const long BUILD_HISTORY = 0;
Expand Down
4 changes: 3 additions & 1 deletion pambase/sapwatchthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ void* SapWatchThread::Entry()
TaskScheduler* scheduler = PamTaskScheduler::createNew();
UsageEnvironment* env = BasicUsageEnvironment::createNew(*scheduler);

wmLog::Get()->Log(wxT("Start SapWatch"));

// Create a 'groupsock' for the input multicast group,port:
char const* sessionAddressStr = "239.255.255.255";
Expand Down Expand Up @@ -53,6 +54,7 @@ void* SapWatchThread::Entry()
{
if(inputGroupsock.handleRead(m_packet, 65536, packetSize, fromAddress))
{
wmLog::Get()->Log(wxString::Format(wxT("SapWatch: read %d"), packetSize));
// Ignore the first 8 bytes (SAP header).
if (packetSize >= 8)
{
Expand All @@ -69,7 +71,7 @@ void* SapWatchThread::Entry()

wxString sSDP;
sSDP.Printf(wxT("%s\n%s"), wxString::FromAscii(AddressString(fromAddress).val()).c_str(), wxString::FromAscii((char*)(m_packet+8)).c_str());

wmLog::Get()->Log(wxString::Format(wxT("SapWatch: read %s"),sSDP.c_str()));
if(m_pParent)
{
wxCommandEvent event(wxEVT_SAP);
Expand Down

0 comments on commit 0cfda29

Please sign in to comment.