// Init array
$this->dataXmlNodes = array(
- XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => '',
- XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => '',
- XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS => '',
- XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID => '',
- XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT => 9060,
- XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT => 9060
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => '',
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => '',
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS => '',
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID => '',
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT => 9060,
+ XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT => 9060
);
}
$helperInstance = new NodeAnnouncementMessageAnswerHelper();
// Set session id of other peer as recipient
- $helperInstance->setRecipientType($messageData[XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID]);
+ $helperInstance->setRecipientType($messageData[XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID]);
// Set message data
$helperInstance->setMessageData($messageData);
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class XmlAnnouncementAnswerTemplateEngine extends BaseTemplateEngine implements CompileableTemplate, Registerable {
+ /**
+ * Some XML nodes must be available for later data extraction
+ */
+ const ANNOUNCEMENT_DATA_SESSION_ID = 'my-session-id';
+ const ANNOUNCEMENT_DATA_NODE_STATUS = 'my-status';
+ const ANNOUNCEMENT_DATA_EXTERNAL_IP = 'my-external-ip';
+ const ANNOUNCEMENT_DATA_INTERNAL_IP = 'my-internal-ip';
+ const ANNOUNCEMENT_DATA_TCP_PORT = 'my-tcp-port';
+ const ANNOUNCEMENT_DATA_UDP_PORT = 'my-udp-port';
+
/**
* Main nodes in the XML tree
*/
<!--
This node's external IP/hostname
//-->
- <my-external-ip>{?external_ip?}</my-external-ip>
+ <my-external-ip>{?my_external_ip?}</my-external-ip>
<!--
This node's internal IP/hostname
//-->
- <my-internal-ip>{?internal_ip?}</my-internal-ip>
+ <my-internal-ip>{?my_internal_ip?}</my-internal-ip>
<!--
This node's TCP port
//-->
- <my-tcp-port>{?node_tcp_listen_port?}</my-tcp-port>
+ <my-tcp-port>{?my_tcp_port?}</my-tcp-port>
<!--
This node's UDP port
//-->
- <my-udp-port>{?node_udp_listen_port?}</my-udp-port>
+ <my-udp-port>{?my_udp_port?}</my-udp-port>
<!--
This node's session id
//-->
- <my-session-id>{?session_id?}</my-session-id>
+ <my-session-id>{?my_session_id?}</my-session-id>
<!--
This node's status
//-->
- <my-status>{?node_status?}</my-status>
+ <my-status>{?my_status?}</my-status>
</my-data>
<!--
The following data is the other node's data. This data is being sent to