5
#include "JabberComponent.hxx"
7
using namespace gateway;
10
void sleepSeconds(unsigned int seconds)
19
JabberComponent* g_component;
22
signalHandler(int signo)
24
//std::cerr << "Shutting down" << endl;
29
main (int argc, char** argv)
32
if ( signal( SIGPIPE, SIG_IGN) == SIG_ERR)
34
cerr << "Couldn't install signal handler for SIGPIPE" << endl;
39
if ( signal( SIGINT, signalHandler ) == SIG_ERR )
41
cerr << "Couldn't install signal handler for SIGINT" << endl;
45
if ( signal( SIGTERM, signalHandler ) == SIG_ERR )
47
cerr << "Couldn't install signal handler for SIGTERM" << endl;
51
if(argc != 11 || std::string(argv[0]) != std::string("ichat-gw"))
53
cerr << "argc=" << argc << ", argv[0]=" << argv[0] << endl;
54
cerr << "Jabber connector process must not be launched manually, it is launched automatically from the main ichat-gw program." << endl;
59
WORD wVersionRequested = MAKEWORD( 2, 2 );
61
int err = WSAStartup( wVersionRequested, &wsaData );
64
// could not find a usable WinSock DLL
65
cerr << "Could not load winsock" << endl;
71
unsigned int jabberConnectorIPCPort = atoi(argv[1]);
72
unsigned int gatewayIPCPort = atoi(argv[2]);
74
g_component = new JabberComponent(jabberConnectorIPCPort,
76
argv[3], // Jabber server
77
argv[4], // Jabber component name
78
argv[5], // Jabber component password
79
atoi(argv[6]), // Jabber component port
80
atoi(argv[7]), // Jabber server ping duration
81
argv[8], // Jabber control username
82
argv[9]); // IPPort Data blob
90
cout << "ichat-gw-jc is shutdown." << endl;
95
/* ====================================================================
97
Copyright (c) 2009, SIP Spectrum, Inc.
100
Redistribution and use in source and binary forms, with or without
101
modification, are permitted provided that the following conditions are
104
1. Redistributions of source code must retain the above copyright
105
notice, this list of conditions and the following disclaimer.
107
2. Redistributions in binary form must reproduce the above copyright
108
notice, this list of conditions and the following disclaimer in the
109
documentation and/or other materials provided with the distribution.
111
3. Neither the name of SIP Spectrum nor the names of its contributors
112
may be used to endorse or promote products derived from this
113
software without specific prior written permission.
115
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
116
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
117
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
118
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
119
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
120
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
121
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
122
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
123
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
124
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
125
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
127
==================================================================== */