27#define RESIPROCATE_SUBSYSTEM AppSubsystem::MOHPARKSERVER
30WebAdmin::RemoveKey::RemoveKey(
const Data &key1,
const Data &key2) : mKey1(key1), mKey2(key2)
35WebAdmin::RemoveKey::operator<(
const RemoveKey& rhs)
const
41 else if(mKey1 == rhs.mKey1 && mKey2 < rhs.mKey2)
54 const Data& adminPassword,
58 mNoWebChallenges( noChal ),
74 const char* anchor = pb.
skipChar(
'/');
77 pb.
data(pageName,anchor);
79 DebugLog (<<
" got page name: " << pageName );
82 if (pageName !=
Data(
"activecalls.html"))
101 pb.
data(key,anchor1);
103 const char* anchor2 = pb.
skipChar(
'=');
106 pb.
data(value,anchor2);
113 if ( key.
prefix(
"remove.") )
124 DebugLog (<<
" key=" << key <<
" value=" << value <<
" & unencoded form: " << value.
urlDecoded() );
133 buildPageOutlinePre(s);
135 if ( pageName ==
Data(
"activecalls.html"))
137 buildActiveCallsSubPage(s);
143 buildPageOutlinePost(s);
147 setPage( page, pageNumber,200 );
152WebAdmin::buildActiveCallsSubPage(
DataStream& s)
154 if (!mRemoveSet.empty())
157 for (set<RemoveKey>::iterator i = mRemoveSet.begin(); i != mRemoveSet.end(); ++i)
166 InfoLog(<<
"Registration removal key was malformed: " << i->mKey2);
181 catch(resip::ParseBuffer::Exception& e)
183 InfoLog(<<
"Registration removal key was malformed: " << e <<
184 " Key was: " << i->mKey2);
188 s <<
"<p><em>Removed:</em> " << j <<
" records</p>" << endl;
192 "<form id=\"showReg\" method=\"get\" action=\"registrations.html\" name=\"showReg\" enctype=\"application/x-www-form-urlencoded\">" << endl <<
196 "<table border=\"1\" cellspacing=\"2\" cellpadding=\"0\" align=\"left\">" << endl <<
199 " <td>Held URI</td>" << endl <<
200 " <td>Invoking URI</td>" << endl <<
201 " <td>Hold Type</td>" << endl <<
202 " <td>Participant ID</td>" << endl <<
203 " <td>Conversation ID</td>" << endl <<
209 for (CallInfoList::iterator it = callInfos.begin(); it != callInfos.end(); ++it )
214 <<
" <td>" << it->mHoldType <<
"</td>" << endl
215 <<
" <td>" << it->mParticipantId <<
"</td>" << endl
216 <<
" <td>" << it->mConversationId <<
"</td>" << endl
221 s <<
"</table>" << endl <<
228s <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
229s <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
230s <<
"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
232s <<
" <meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" />\n";
233s <<
" <title>MOHParkServer Active Call List</title>\n";
236s <<
"body { bgcolor: white; font-size: 90%; font-family: Arial, Helvetica, sans-serif }\n";
237s <<
"h1 { font-size: 200%; font-weight: bold }\n";
238s <<
"h2 { font-size: 100%; font-weight: bold; text-transform: uppercase }\n";
239s <<
"h3 { font-size: 100%; font-weight: normal }\n";
240s <<
"h4 { font-size: 100%; font-style: oblique; font-weight: normal } \n";
241s <<
"hr { line-height: 2px; margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; height: 10px }\n";
242s <<
"div.title { color: white; background-color: #395af6; padding-top: 10px; padding-bottom: 10px; padding-left: 10px }\n";
243s <<
"div.title h1 { text-transform: uppercase; margin-top: 0; margin-bottom: 0 } \n";
244s <<
"div.menu { color: black; background-color: #ff8d09; padding: 0 10px 10px; \n";
245s <<
" width: 9em; float: left; clear: none; overflow: hidden }\n";
246s <<
"div.menu p { font-weight: bold; text-transform: uppercase; list-style-type: none; \n";
247s <<
" margin-top: 0; margin-bottom: 0; margin-left: 10px }\n";
248s <<
"div.menu h2 { margin-top: 10px; margin-bottom: 0 ; text-transform: uppercase; }\n";
249s <<
"div.main { color: black; background-color: #dae1ed; margin-left: 11em }\n";
250s <<
"div.space { font-size: 5px; height: 10px }\n";
#define resip_assert(x)
This file needs to work for both C and C++ code.
Handles cross-platform sockets compatibility.
void setPage(const resip::Data &page, int pageNumber, int response=200, const resip::Mime &pType=resip::Mime("text","html"))
void getActiveCallsInfo(CallInfoList &callInfos)
virtual void buildPage(const resip::Data &uri, int pageNumber, const resip::Data &user, const resip::Data &password)
WebAdmin(Server &server, bool noWebChallenges, const resip::Data &realm, const resip::Data &adminPassword, int port=5082, resip::IpVersion version=resip::V4)
An iostream that operates on an existing Data.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
static const Data Empty
Constant that represents a zero-length data.
Data xmlCharDataEncode() const
Performs in-place XML Character Data escaping of a Data.
bool prefix(const Data &pre) const noexcept
Returns true if this Data starts with the bytes indicated by the passed-in Data.
Data substr(size_type first, size_type count=Data::npos) const
Copies a portion of this Data into a new Data.
bool empty() const noexcept
Checks whether the Data is empty.
Data urlDecoded() const
Performs in-place HTTP URL un-escaping of a Data.
static Data from(const T &x)
Converts from arbitrary other type to Data.
static const size_type npos
Represents an impossible position; returned to indicate failure to find.
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Provides string-parsing functionality with protection from buffer overflow.
CurrentPosition skipToChar(char c)
CurrentPosition position() const
CurrentPosition skipChar()
void data(Data &data, const char *start) const
make the passed in data share memory with the buffer (uses Data::Share)
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
std::list< ActiveCallInfo > CallInfoList
dcm! – add UnusedChecking(_enum) below;
IpVersion
An enumeration of IP versions.