Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
131
Issues
131
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
88381436
Commit
88381436
authored
Sep 16, 2005
by
jpbl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added the newgui option for configure
parent
e7a1ac34
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
248 additions
and
165 deletions
+248
-165
configure.ac
configure.ac
+17
-0
sflphonegui-uml.xmi
sflphonegui-uml.xmi
+47
-47
src/gui/Makefile.am
src/gui/Makefile.am
+5
-1
src/gui/official/account.cpp
src/gui/official/account.cpp
+19
-8
src/gui/official/account.h
src/gui/official/account.h
+7
-2
src/gui/official/call.cpp
src/gui/official/call.cpp
+33
-17
src/gui/official/call.h
src/gui/official/call.h
+2
-14
src/gui/official/objectpool.h
src/gui/official/objectpool.h
+3
-3
src/gui/official/request.cpp
src/gui/official/request.cpp
+20
-12
src/gui/official/request.h
src/gui/official/request.h
+36
-11
src/gui/official/requesterimpl.cpp
src/gui/official/requesterimpl.cpp
+22
-8
src/gui/official/requesterimpl.h
src/gui/official/requesterimpl.h
+33
-38
src/gui/official/sessionio.cpp
src/gui/official/sessionio.cpp
+1
-1
src/gui/official/sessionio.h
src/gui/official/sessionio.h
+2
-2
utilspp/singleton/SingletonHolder.hpp
utilspp/singleton/SingletonHolder.hpp
+1
-1
No files found.
configure.ac
View file @
88381436
...
...
@@ -111,6 +111,22 @@ maintener="no"
AM_CONDITIONAL(MAINTENER_CODE, test x$maintener = xyes)
AC_MSG_CHECKING([whether to enable the new gui])
AC_ARG_ENABLE(newgui,
[ --enable-newgui Enable new gui code [default=no]],
[
AC_MSG_RESULT(yes)
newgui="yes"
],
[
AC_MSG_RESULT(no)
newgui="no"
]
)
AM_CONDITIONAL(NEWGUI_CODE, test x$newgui = xyes)
if test $ac_cv_header_portaudio_h = no; then
AC_MSG_ERROR([*** missing portaudio.h. You need a working PortAudio installation. See http://www.portaudio.com])
...
...
@@ -179,6 +195,7 @@ src/audio/pacpp/source/Makefile \
src/audio/pacpp/source/portaudiocpp/Makefile \
src/gui/Makefile \
src/gui/qt/Makefile \
src/gui/official/Makefile \
src/gui/server/Makefile \
src/zeroconf/Makefile \
utilspp/Makefile \
...
...
sflphonegui-uml.xmi
View file @
88381436
This diff is collapsed.
Click to expand it.
src/gui/Makefile.am
View file @
88381436
SUBDIRS
=
qt server
if
NEWGUI_CODE
officialdir
=
official
endif
SUBDIRS
=
$(officialdir)
qt server
noinst_LTLIBRARIES
=
libguiframework.la
...
...
src/gui/official/account.cpp
View file @
88381436
...
...
@@ -20,27 +20,38 @@
#include "account.h"
#include "requester.h"
#include "call.h"
Account
::
Account
(
const
std
::
string
&
id
)
:
mId
(
id
)
Account
::
Account
(
const
std
::
string
&
sessionId
,
const
std
::
string
&
name
)
:
mSessionId
(
sessionId
)
,
mId
(
name
)
{}
Call
Account
::
c
reateCall
(
)
Account
::
c
all
(
const
std
::
string
&
to
)
{
std
::
string
callId
=
Requester
::
instance
().
generateCallId
();
return
Call
(
mSessionId
,
mAccountId
,
callId
);
std
::
list
<
std
::
string
>
args
;
args
.
push_back
(
mId
);
args
.
push_back
(
to
);
Requester
::
instance
().
send
(
mSessionId
,
"register"
,
args
);
return
Call
(
mSessionId
,
callId
);
}
std
::
string
Account
::
register
()
Account
::
register
Account
()
{
return
Requester
::
instance
().
sendAccountRequest
(
mSessionId
,
mId
,
"register"
);
std
::
list
<
std
::
string
>
args
;
args
.
push_back
(
mId
);
return
Requester
::
instance
().
send
(
mSessionId
,
"register"
,
args
);
}
std
::
string
Account
::
unregister
()
Account
::
unregister
Account
()
{
return
Requester
::
instance
().
sendAccountRequest
(
mSessionId
,
mId
,
"unregister"
);
std
::
list
<
std
::
string
>
args
;
args
.
push_back
(
mId
);
return
Requester
::
instance
().
send
(
mSessionId
,
"unregister"
,
args
);
}
src/gui/official/account.h
View file @
88381436
...
...
@@ -27,14 +27,19 @@ class Call;
class
Account
{
public:
Account
(
const
std
::
string
&
sessionId
,
const
std
::
string
&
name
);
/**
* This will generate a call ready to be used.
*/
Call
call
(
const
std
::
string
&
to
);
std
::
string
register
();
std
::
string
unregister
();
std
::
string
register
Account
();
std
::
string
unregister
Account
();
private:
Account
();
/**
* This is the session id that we are related to.
*/
...
...
src/gui/official/call.cpp
View file @
88381436
...
...
@@ -18,59 +18,75 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <string>
#include <list>
#include "call.h"
#include "requester.h"
std
::
string
Call
::
call
(
const
std
::
string
&
destination
)
{
std
::
list
<
std
::
string
>
args
;
args
.
push_back
(
mAccountId
);
args
.
push_back
(
to
);
return
Requester
::
instance
().
sendCallCommand
(
mSession
,
mId
,
"answer"
,
args
)
}
Call
::
Call
(
const
std
::
string
&
sessionId
,
const
std
::
string
&
callId
)
:
mSessionId
(
sessionId
)
,
mId
(
callId
)
{}
std
::
string
Call
::
answer
()
{
return
Requester
::
instance
().
sendCallCommand
(
mSession
,
mId
,
"answer"
)
std
::
list
<
std
::
string
>
args
;
args
.
push_back
(
mId
);
return
Requester
::
instance
().
send
(
mSessionId
,
"answer"
,
args
);
}
std
::
string
Call
::
hangup
()
{
return
Requester
::
instance
().
sendCallCommand
(
mSession
,
mId
,
"hangup"
)
std
::
list
<
std
::
string
>
args
;
args
.
push_back
(
mId
);
return
Requester
::
instance
().
send
(
mSessionId
,
"hangup"
,
args
);
}
std
::
string
Call
::
cancel
()
{
return
Requester
::
instance
().
sendCallCommand
(
mSession
,
mId
,
"cancel"
)
std
::
list
<
std
::
string
>
args
;
args
.
push_back
(
mId
);
return
Requester
::
instance
().
send
(
mSessionId
,
"cancel"
,
args
);
}
std
::
string
Call
::
hold
()
{
return
Requester
::
instance
().
sendCallCommand
(
mSession
,
mId
,
"hold"
)
std
::
list
<
std
::
string
>
args
;
args
.
push_back
(
mId
);
return
Requester
::
instance
().
send
(
mSessionId
,
"hold"
,
args
);
}
std
::
string
Call
::
unhold
()
{
return
Requester
::
instance
().
sendCallCommand
(
mSession
,
mId
,
"unhold"
)
std
::
list
<
std
::
string
>
args
;
args
.
push_back
(
mId
);
return
Requester
::
instance
().
send
(
mSessionId
,
"unhold"
,
args
);
}
std
::
string
Call
::
refuse
()
{
return
Requester
::
instance
().
sendCallCommand
(
mSession
,
mId
,
"refuse"
)
std
::
list
<
std
::
string
>
args
;
args
.
push_back
(
mId
);
return
Requester
::
instance
().
send
(
mSessionId
,
"refuse"
,
args
);
}
std
::
string
Call
::
sendDtmf
(
char
c
)
{
std
::
list
<
std
::
string
>
args
;
args
.
push_back
(
std
::
string
(
c
));
return
Requester
::
instance
().
sendCallCommand
(
mSession
,
mId
,
"senddtmf"
,
args
)
std
::
list
<
std
::
string
>
args
;
args
.
push_back
(
mId
);
std
::
string
s
;
s
+=
c
;
args
.
push_back
(
s
);
return
Requester
::
instance
().
send
(
mSessionId
,
"senddtmf"
,
args
);
}
src/gui/official/call.h
View file @
88381436
...
...
@@ -27,15 +27,8 @@ class Call
{
public:
Call
(
const
std
::
string
&
sessionId
,
const
std
::
string
&
accountId
,
const
std
::
string
&
callId
);
/**
* This function will try to call the destination.
*
*/
std
::
string
call
(
const
std
::
string
&
destination
);
/**
* This function will answer the call.
*/
...
...
@@ -80,20 +73,15 @@ class Call
private:
/**
* This is the unique identifier of the call.
*/
std
::
string
mId
;
/**
* This is the session id that we belong to.
*/
std
::
string
mSessionId
;
/**
* This is the
account id that we belong to
.
* This is the
unique identifier of the call
.
*/
std
::
string
m
Account
Id
;
std
::
string
mId
;
};
#endif
src/gui/official/objectpool.h
View file @
88381436
...
...
@@ -22,10 +22,10 @@
#define SFLPHONEGUI_OBJECTPOOL_H
#include <string>
#include <
QMutex
>
#include <
QWaitCondition
>
#include <
qmutex.h
>
#include <
qwaitcondition.h
>
template
<
T
>
template
<
typename
T
>
class
ObjectPool
{
public:
...
...
src/gui/official/request.cpp
View file @
88381436
...
...
@@ -18,7 +18,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <sstream>
#include "request.h"
#include "requester.h"
Request
::
Request
(
const
std
::
string
&
sequenceId
,
const
std
::
string
&
command
,
...
...
@@ -29,19 +32,19 @@ Request::Request(const std::string &sequenceId,
{}
void
Request
::
onError
(
int
code
,
const
std
::
string
&
message
)
Request
::
onError
(
const
std
::
string
&
,
const
std
::
string
&
)
{}
void
Request
::
onSuccess
(
int
code
,
const
std
::
string
&
message
)
Request
::
onSuccess
(
const
std
::
string
&
,
const
std
::
string
&
)
{}
std
::
string
Request
::
toString
()
{
std
::
ostream
id
;
std
::
ostr
ingstr
eam
id
;
id
<<
mCommand
<<
mSequenceId
;
for
(
std
::
list
<
std
::
string
>::
iterator
pos
=
mArgs
.
begin
();
for
(
std
::
list
<
std
::
string
>::
const_
iterator
pos
=
mArgs
.
begin
();
pos
!=
mArgs
.
end
();
pos
++
)
{
id
<<
" "
<<
(
*
pos
);
...
...
@@ -52,30 +55,35 @@ Request::toString()
CallRequest
::
CallRequest
(
const
std
::
string
&
sequenceId
,
const
std
::
string
&
callId
,
const
std
::
string
&
command
,
const
std
::
list
<
std
::
string
>
&
args
)
:
Request
(
sequenceId
,
command
,
args
)
,
mCallId
(
callId
)
,
mCallId
(
*
args
.
begin
()
)
{}
void
CallRequest
::
onError
(
int
code
,
const
std
::
string
&
message
)
CallRequest
::
onError
(
const
std
::
string
&
code
,
const
std
::
string
&
message
)
{
onError
(
Call
(
mCallId
),
code
,
message
);
onError
(
Call
(
Requester
::
instance
().
getSessionIdFromSequenceId
(
getSequenceId
()),
mCallId
),
code
,
message
);
}
void
CallRequest
::
onError
(
Call
call
,
int
code
,
const
std
::
string
&
message
)
CallRequest
::
onError
(
Call
,
const
std
::
string
&
,
const
std
::
string
&
)
{}
void
CallRequest
::
onSuccess
(
int
code
,
const
std
::
string
&
message
)
CallRequest
::
onSuccess
(
const
std
::
string
&
code
,
const
std
::
string
&
message
)
{
onSuccess
(
Call
(
mCallId
),
code
,
message
);
onSuccess
(
Call
(
Requester
::
instance
().
getSessionIdFromSequenceId
(
getSequenceId
()),
mCallId
),
code
,
message
);
}
void
CallRequest
::
onSuccess
(
Call
call
,
int
code
,
const
std
::
string
&
message
)
CallRequest
::
onSuccess
(
Call
,
const
std
::
string
&
,
const
std
::
string
&
)
{}
src/gui/official/request.h
View file @
88381436
...
...
@@ -21,6 +21,11 @@
#ifndef SFLPHONEGUI_REQUEST_H
#define SFLPHONEGUI_REQUEST_H
#include <list>
#include <string>
#include "call.h"
class
Request
{
public:
...
...
@@ -33,14 +38,20 @@ class Request
* receive its answer, if the request didn't successfully
* ended.
*/
virtual
void
onError
(
int
code
,
const
std
::
string
&
message
);
virtual
void
onError
(
const
std
::
string
&
code
,
const
std
::
string
&
message
);
/**
* This function will be called when the request
* receive an answer, but there's other answers to come.
*/
virtual
void
onEntry
(
const
std
::
string
&
code
,
const
std
::
string
&
message
);
/**
* This function will be called when the request
* receive its answer, if the request successfully
* ended.
*/
virtual
void
onSuccess
(
int
code
,
const
std
::
string
&
message
);
virtual
void
onSuccess
(
const
std
::
string
&
code
,
const
std
::
string
&
message
);
/**
* This function will translate the function into a string.
...
...
@@ -51,7 +62,7 @@ class Request
/**
* Return the sequence ID.
*/
std
::
string
getSequenceI
D
()
std
::
string
getSequenceI
d
()
{
return
mSequenceId
;}
/**
...
...
@@ -63,21 +74,21 @@ class Request
/**
* Return the args.
*/
std
::
string
getArgs
()
std
::
list
<
std
::
string
>
getArgs
()
{
return
mArgs
;}
private:
const
std
::
string
mSequenceId
;
const
std
::
string
mSessionId
;
const
std
::
string
mCommand
;
const
std
::
list
<
std
::
string
>
mArgs
;
}
}
;
class
CallRequest
:
public
Request
{
public:
CallRequest
(
const
std
::
string
&
sequenceId
,
const
std
::
string
&
callId
,
const
std
::
string
&
command
,
const
std
::
list
<
std
::
string
>
&
args
);
...
...
@@ -87,14 +98,26 @@ class CallRequest : public Request
* receive its answer, if the request didn't successfully
* ended.
*/
virtual
void
onError
(
Call
call
,
int
code
,
const
std
::
string
&
message
);
virtual
void
onError
(
Call
call
,
const
std
::
string
&
code
,
const
std
::
string
&
message
);
/**
* This function will be called when the request
* receive an answer, but there's other answers to come.
*/
virtual
void
onEntry
(
Call
call
,
const
std
::
string
&
code
,
const
std
::
string
&
message
);
/**
* This function will be called when the request
* receive its answer, if the request successfully
* ended.
*/
virtual
void
onSuccess
(
Call
call
,
const
std
::
string
&
message
);
virtual
void
onSuccess
(
Call
call
,
const
std
::
string
&
code
,
const
std
::
string
&
message
);
private:
/**
...
...
@@ -103,7 +126,8 @@ class CallRequest : public Request
* ended. This function will call the onError, but with
* the call linked to this request.
*/
virtual
void
onError
(
int
code
,
const
std
::
string
&
message
);
virtual
void
onError
(
const
std
::
string
&
code
,
const
std
::
string
&
message
);
/**
* This function will be called when the request
...
...
@@ -111,11 +135,12 @@ class CallRequest : public Request
* ended. This function will call the onSuccess function,
* but with the call linked to this request.
*/
virtual
void
onSuccess
(
int
code
,
const
std
::
string
&
message
);
virtual
void
onSuccess
(
const
std
::
string
&
code
,
const
std
::
string
&
message
);
private:
const
std
::
string
mCallId
;
}
}
;
#endif
src/gui/official/requesterimpl.cpp
View file @
88381436
...
...
@@ -29,10 +29,10 @@ RequesterImpl::RequesterImpl()
,
mSequenceIdCount
(
0
)
{}
SessionI
mpl
*
getSessionImpl
(
const
std
::
string
&
sessionId
)
SessionI
O
*
RequesterImpl
::
getSessionIO
(
const
std
::
string
&
sessionId
)
{
std
::
map
<
std
::
string
,
SessionI
mpl
*
>::
iterator
pos
=
mSessions
.
find
(
sessionId
);
std
::
map
<
std
::
string
,
SessionI
O
*
>::
iterator
pos
=
mSessions
.
find
(
sessionId
);
if
(
pos
==
mSessions
.
end
())
{
throw
std
::
runtime_error
(
"The session is not valid."
);
}
...
...
@@ -41,17 +41,17 @@ getSessionImpl(const std::string &sessionId)
}
std
::
string
RequesterImpl
::
send
CallCommand
(
const
std
::
string
&
sessionId
,
const
std
::
string
&
callId
,
const
std
::
string
&
command
)
RequesterImpl
::
send
(
const
std
::
string
&
sessionId
,
const
std
::
string
&
command
,
const
std
::
list
<
std
::
string
>
&
args
)
{
// We retreive the internal of a session.
SessionIO
*
session
=
getSessionIO
(
sessionId
);
// We ask the factory to create the request.
Request
*
request
=
mCallRequestFactory
.
create
(
command
,
sequenceId
,
callId
)
std
::
string
sequenceId
=
generateSequenceId
();
Request
*
request
=
mRequestFactory
.
create
(
command
,
sequenceId
,
args
);
registerRequest
(
sessionId
,
sequenceId
,
request
);
s
->
send
(
request
.
toString
());
...
...
@@ -68,6 +68,20 @@ RequesterImpl::registerRequest(const std::string &sessionId,
}
mRequests
.
insert
(
std
::
make_pair
(
sequenceId
,
request
));
mSequenceToSession
.
insert
(
std
::
make_pair
(
sequenceId
,
sessionId
));
}
void
RequesterImpl
::
registerSession
(
const
std
::
string
&
id
,
SessionIO
*
s
)
{
if
(
mSessions
.
find
(
id
)
!=
mSessions
.
end
())
{
throw
std
::
logic_error
(
"Registering an already know Session ID"
);
}
mSessions
.
insert
(
std
::
make_pair
(
id
,
s
));
s
->
start
();
}
void
...
...
src/gui/official/requesterimpl.h
View file @
88381436
...
...
@@ -21,6 +21,9 @@
#ifndef SFLPHONEGUI_REQUESTERIMPL_H
#define SFLPHONEGUI_REQUESTERIMPL_H
#include "request.h"
#include "objectfactory.h"
class
Call
;
class
SessionIO
;
...
...
@@ -34,26 +37,17 @@ class RequesterImpl
* This command is non-blocking. The command linked
* to this command will be executed.
*/
void
sendCallCommand
(
const
std
::
string
&
sessionId
,
const
std
::
string
&
callId
,
const
std
::
string
&
command
);
void
sendCallCommand
(
const
std
::
string
&
sessionId
,
const
std
::
string
&
callId
,
char
*
command
);
std
::
string
send
(
const
std
::
string
&
sessionId
,
const
std
::
string
&
command
,
const
std
::
list
<
std
::
string
>
&
args
);
static
int
getCodeCategory
(
const
std
::
string
&
code
);
private:
/**
* Generate a unique call ID.
*/
std
::
string
generateCallId
();
/**
* Generate a unique account ID.
*/
std
::
string
generateAccountId
();
/**
* Generate a unique session ID.
*/
...
...
@@ -65,49 +59,50 @@ class RequesterImpl
std
::
string
generateSequenceId
();
/**
* Return the SessionIO instance related to
* the session ID.
* Register the string to return a Actual type.
*/
SessionIO
*
getSessionIO
(
const
std
::
string
&
sessionId
);
private:
std
::
map
<
std
::
string
,
SessionIO
*
>
mSessions
;
std
::
map
<
std
::
string
,
Request
*
>
mRequests
;
template
<
typename
Actual
>
void
registerObject
(
const
std
::
string
&
name
);
std
::
string
getSessionIdFromSequenceId
(
const
std
::
string
&
sequence
)
{
return
mSequenceToSession
[
sequence
];}
/**
* This map is used to map accounts ids to session ids.
*/
std
::
map
<
std
::
string
,
std
::
string
>
mAccountToSessionMap
;
private:
/**
* This map is used to map call ids to session ids.
* Return the SessionIO instance related to
* the session ID.
*/
std
::
map
<
std
::
string
,
std
::
string
>
mCallToSessionMap
;
SessionIO
*
getSessionIO
(
const
std
::
string
&
sessionId
)
;
/**
*
This is the list of all accounts in each
session.
*
Register the
session.
*/
std
::
map
<
std
::
string
,
std
::
list
<
std
::
string
>
>
mSessionAccounts
;
void
registerSession
(
const
std
::
string
&
id
,
SessionIO
*
io
)
;
/**
*
This is the list of all calls ids in each accounts
.
*
Register the string to return a Actual type
.
*/
std
::
map
<
std
::
string
,
std
::
list
<
std
::
string
>
>
mAccountCalls
;
void
registerRequest
(
const
std
::
string
&
sessionId
,
const
std
::
string
&
sequenceId
,
Request
*
request
);
/**
* Those maps are used to create a request from a request
* string.
*/
std
::
map
<
std
::
string
,
*
CallRequestCreator
>
mCallCommandCreators
;
std
::
map
<
std
::
string
,
*
AccountRequestCreator
>
mAccountRequestCreators
;
std
::
map
<
std
::
string
,
*
SessionRequestCreator
>
mSessionRequestCreators
;
std
::
map
<
std
::
string
,
*
SessionListRequestCreator
>
mSessionListRequestCreators
;
private:
ObjectFactory
<
Request
>
mRequestFactory
;
std
::
map
<
std
::
string
,
SessionIO
*
>
mSessions
;
std
::
map
<
std
::
string
,
Request
*
>
mRequests
;
std
::
map
<
std
::
string
,
std
::
string
>
mSequenceToSession
;
/**
* This is the integer used to generate the call IDs.
*/
unsigned
long
mCallIdCount
;
}
unsigned
long
mSessionIdCount
;
unsigned
long
mSequenceIdCount
;
};
#include "requesterimpl.inl"
#endif
src/gui/official/sessionio.cpp
View file @
88381436
...
...
@@ -57,7 +57,7 @@ SessionIO::~SessionIO()
}
void
SessionIO
::
run
()
SessionIO
::
start
()
{