Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
397ce0b6
Commit
397ce0b6
authored
19 years ago
by
yanmorin
Browse files
Options
Downloads
Patches
Plain Diff
Adding iaxaccount
parent
f1a637a1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/iaxaccount.cpp
+101
-0
101 additions, 0 deletions
src/iaxaccount.cpp
src/iaxaccount.h
+48
-0
48 additions, 0 deletions
src/iaxaccount.h
with
149 additions
and
0 deletions
src/iaxaccount.cpp
0 → 100644
+
101
−
0
View file @
397ce0b6
/*
* Copyright (C) 2006 Savoir-Faire Linux inc.
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include
"iaxaccount.h"
#include
"iaxvoiplink.h"
#include
"manager.h"
IAXAccount
::
IAXAccount
(
const
AccountID
&
accountID
)
:
Account
(
accountID
)
{
createVoIPLink
();
}
IAXAccount
::~
IAXAccount
()
{
}
/* virtual Account function implementation */
bool
IAXAccount
::
createVoIPLink
()
{
if
(
!
_link
)
{
_link
=
new
IAXVoIPLink
(
_accountID
);
}
return
(
_link
!=
0
?
true
:
false
);
}
bool
IAXAccount
::
registerAccount
()
{
if
(
_link
&&
!
_registered
)
{
_registered
=
_link
->
setRegister
();
}
return
_registered
;
}
bool
IAXAccount
::
unregisterAccount
()
{
if
(
_link
&&
_registered
)
{
_registered
=
_link
->
setUnregister
();
}
return
!
_registered
;
}
bool
IAXAccount
::
init
()
{
if
(
_link
&&
!
_enabled
)
{
_link
->
init
();
_enabled
=
true
;
return
true
;
}
return
false
;
}
bool
IAXAccount
::
terminate
()
{
if
(
_link
&&
_enabled
)
{
_link
->
terminate
();
_enabled
=
false
;
return
true
;
}
return
false
;
}
void
IAXAccount
::
initConfig
(
Conf
::
ConfigTree
&
config
)
{
std
::
string
section
(
_accountID
);
std
::
string
type_str
(
"string"
);
std
::
string
type_int
(
"int"
);
config
.
addConfigTreeItem
(
section
,
Conf
::
ConfigTreeItem
(
CONFIG_ACCOUNT_TYPE
,
"AIX"
,
type_str
));
config
.
addConfigTreeItem
(
section
,
Conf
::
ConfigTreeItem
(
CONFIG_ACCOUNT_ENABLE
,
"1"
,
type_int
));
config
.
addConfigTreeItem
(
section
,
Conf
::
ConfigTreeItem
(
CONFIG_ACCOUNT_AUTO_REGISTER
,
"1"
,
type_int
));
}
void
IAXAccount
::
loadConfig
()
{
_shouldInitOnStart
=
Manager
::
instance
().
getConfigInt
(
_accountID
,
CONFIG_ACCOUNT_ENABLE
)
?
true
:
false
;
_shouldRegisterOnStart
=
Manager
::
instance
().
getConfigInt
(
_accountID
,
CONFIG_ACCOUNT_AUTO_REGISTER
)
?
true
:
false
;
}
This diff is collapsed.
Click to expand it.
src/iaxaccount.h
0 → 100644
+
48
−
0
View file @
397ce0b6
/*
* Copyright (C) 2006 Savoir-Faire Linux inc.
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef IAXACCOUNT_H
#define IAXACCOUNT_H
#include
"account.h"
/**
@author Yan Morin <yan.morin@gmail.com>
An IAX Account specify IAX specific functions and objects (IAXCall/IAXVoIPLink)
*/
class
IAXAccount
:
public
Account
{
public:
IAXAccount
(
const
AccountID
&
accountID
);
~
IAXAccount
();
/* virtual Account function implementation */
void
initConfig
(
Conf
::
ConfigTree
&
config
);
void
loadConfig
();
bool
registerAccount
();
bool
unregisterAccount
();
bool
init
();
bool
terminate
();
private:
/* virtual Account function implementation */
bool
createVoIPLink
();
};
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment