Stefan Schuermans commited on 2011-12-22 20:00:11
Showing 3 changed files, with 23 additions and 2 deletions.
| ... | ... |
@@ -28,13 +28,13 @@ OpPrinter::OpPrinter(const std::string &name, Mgrs &mgrs, |
| 28 | 28 |
const Directory &dirBase): |
| 29 | 29 |
Module(name, mgrs, dirBase) |
| 30 | 30 |
{
|
| 31 |
- m_mgrs.m_opMgr.open("TODO", this);
|
|
| 31 |
+ m_mgrs.m_opMgr.open(m_name, this); |
|
| 32 | 32 |
} |
| 33 | 33 |
|
| 34 | 34 |
/// virtual destructor |
| 35 | 35 |
OpPrinter::~OpPrinter() |
| 36 | 36 |
{
|
| 37 |
- m_mgrs.m_opMgr.close("TODO");
|
|
| 37 |
+ m_mgrs.m_opMgr.close(m_name); |
|
| 38 | 38 |
} |
| 39 | 39 |
|
| 40 | 40 |
/// check for update of configuration |
| ... | ... |
@@ -106,6 +106,12 @@ protected: |
| 106 | 106 |
/// send heartbeat to server |
| 107 | 107 |
void sendHeartbeat(); |
| 108 | 108 |
|
| 109 |
+ /** |
|
| 110 |
+ * @brief send accept message |
|
| 111 |
+ * @param[in] line number of line accept on |
|
| 112 |
+ */ |
|
| 113 |
+ void sendAccept(unsigned int line); |
|
| 114 |
+ |
|
| 109 | 115 |
/** |
| 110 | 116 |
* @brief send hangup message |
| 111 | 117 |
* @param[in] line number of line to hangup |
| ... | ... |
@@ -244,6 +244,18 @@ void Phone<ADDR, SOCK>::sendHangup(unsigned int line) |
| 244 | 244 |
send(strm.str()); |
| 245 | 245 |
} |
| 246 | 246 |
|
| 247 |
+/** |
|
| 248 |
+ * @brief send accept message |
|
| 249 |
+ * @param[in] line number of line accept on |
|
| 250 |
+ */ |
|
| 251 |
+template<typename ADDR, typename SOCK> |
|
| 252 |
+void Phone<ADDR, SOCK>::sendAccept(unsigned int line) |
|
| 253 |
+{
|
|
| 254 |
+ std::stringstream strm; |
|
| 255 |
+ strm << line << ":accept"; |
|
| 256 |
+ send(strm.str()); |
|
| 257 |
+} |
|
| 258 |
+ |
|
| 247 | 259 |
/** |
| 248 | 260 |
* @brief send message to server |
| 249 | 261 |
* @param[in] msg message to send |
| ... | ... |
@@ -349,6 +361,9 @@ void Phone<ADDR, SOCK>::incomingCall(unsigned int line, |
| 349 | 361 |
// add connection to maps |
| 350 | 362 |
m_lineConnMap[line] = pConn; |
| 351 | 363 |
m_connLineMap[pConn] = line; |
| 364 |
+ |
|
| 365 |
+ // send accept message |
|
| 366 |
+ sendAccept(line); |
|
| 352 | 367 |
} |
| 353 | 368 |
|
| 354 | 369 |
/** |
| 355 | 370 |