Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
567e11c5
Commit
567e11c5
authored
Aug 03, 2006
by
yanmorin
Browse files
Adding new method to iaxvoiplink (answer, refuse, transfer, senddtmf)
parent
6726d18c
Changes
6
Hide whitespace changes
Inline
Side-by-side
TODO
View file @
567e11c5
...
...
@@ -17,7 +17,7 @@ For sflphone-qt:
---------------
Add samplerate combobox if sample rate is compiled
Save account status if modified in configuration
Bug when moving sflphone and clicking inside the lcd
From FIXME:
...
...
src/audio/audiortp.cpp
View file @
567e11c5
...
...
@@ -54,8 +54,9 @@ AudioRtp::createNewSession (SIPCall *ca) {
// something should stop the thread before...
if
(
_RTXThread
!=
0
)
{
_debug
(
"Try to create a new audio rtp thread...
\n
"
);
return
-
1
;
_debug
(
"AudioRTP Failure: Thread already exists..., stopping it
\n
"
);
delete
_RTXThread
;
_RTXThread
=
0
;
//return -1;
}
// Start RTP Send/Receive threads
...
...
@@ -64,6 +65,7 @@ AudioRtp::createNewSession (SIPCall *ca) {
try
{
if
(
_RTXThread
->
start
()
!=
0
)
{
_debug
(
"AudioRTP Failure: unable to start RTX Thread
\n
"
);
return
-
1
;
}
}
catch
(...)
{
...
...
src/iaxvoiplink.cpp
View file @
567e11c5
...
...
@@ -292,6 +292,19 @@ IAXVoIPLink::newOutgoingCall(const CallID& id, const std::string& toUrl)
return
call
;
}
bool
IAXVoIPLink
::
answer
(
const
CallID
&
id
)
{
IAXCall
*
call
=
getIAXCall
(
id
);
if
(
call
==
0
)
{
_debug
(
"Call doesn't exists
\n
"
);
return
false
;
}
_mutexIAX
.
enterMutex
();
iax_answer
(
call
->
getSession
());
_mutexIAX
.
leaveMutex
();
call
->
setState
(
Call
::
Active
);
call
->
setConnectionState
(
Call
::
Connected
);
return
true
;
}
bool
IAXVoIPLink
::
hangup
(
const
CallID
&
id
)
{
...
...
@@ -335,6 +348,44 @@ IAXVoIPLink::offhold(const CallID& id)
return
true
;
}
bool
IAXVoIPLink
::
transfer
(
const
CallID
&
id
,
const
std
::
string
&
to
)
{
IAXCall
*
call
=
getIAXCall
(
id
);
if
(
call
==
0
)
{
_debug
(
"Call doesn't exists
\n
"
);
return
false
;
}
char
callto
[
to
.
length
()
+
1
];
strcpy
(
callto
,
to
.
c_str
());
_mutexIAX
.
enterMutex
();
iax_transfer
(
call
->
getSession
(),
callto
);
_mutexIAX
.
leaveMutex
();
// should we remove it?
// removeCall(id);
}
bool
IAXVoIPLink
::
refuse
(
const
CallID
&
id
)
{
IAXCall
*
call
=
getIAXCall
(
id
);
if
(
call
==
0
)
{
_debug
(
"Call doesn't exists
\n
"
);
return
false
;
}
_mutexIAX
.
enterMutex
();
iax_reject
(
call
->
getSession
(),
"Call rejected manually."
);
_mutexIAX
.
leaveMutex
();
removeCall
(
id
);
}
bool
IAXVoIPLink
::
carryingDTMFdigits
(
const
CallID
&
id
,
char
code
)
{
IAXCall
*
call
=
getIAXCall
(
id
);
if
(
call
==
0
)
{
_debug
(
"Call doesn't exists
\n
"
);
return
false
;
}
_mutexIAX
.
enterMutex
();
iax_send_dtmf
(
call
->
getSession
(),
code
);
_mutexIAX
.
leaveMutex
();
}
bool
IAXVoIPLink
::
iaxOutgoingInvite
(
IAXCall
*
call
)
{
...
...
src/iaxvoiplink.h
View file @
567e11c5
...
...
@@ -51,15 +51,15 @@ public:
bool
setUnregister
(
void
);
Call
*
newOutgoingCall
(
const
CallID
&
id
,
const
std
::
string
&
toUrl
);
bool
answer
(
const
CallID
&
id
)
{
return
false
;}
bool
answer
(
const
CallID
&
id
)
;
bool
hangup
(
const
CallID
&
id
);
bool
cancel
(
const
CallID
&
id
)
{
return
false
;
}
bool
onhold
(
const
CallID
&
id
);
bool
offhold
(
const
CallID
&
id
);
bool
transfer
(
const
CallID
&
id
,
const
std
::
string
&
to
)
{
return
false
;
}
bool
refuse
(
const
CallID
&
id
)
{
return
false
;
}
bool
carryingDTMFdigits
(
const
CallID
&
id
,
char
code
)
{
return
false
;
}
bool
transfer
(
const
CallID
&
id
,
const
std
::
string
&
to
)
;
bool
refuse
(
const
CallID
&
id
)
;
bool
carryingDTMFdigits
(
const
CallID
&
id
,
char
code
)
;
bool
sendMessage
(
const
std
::
string
&
to
,
const
std
::
string
&
body
)
{
return
false
;
}
public:
// iaxvoiplink only
...
...
src/sipvoiplink.cpp
View file @
567e11c5
...
...
@@ -613,6 +613,13 @@ SIPVoIPLink::onhold(const CallID& id)
SIPCall
*
call
=
getSIPCall
(
id
);
if
(
call
==
0
)
{
_debug
(
"Call doesn't exist
\n
"
);
return
false
;
}
// Stop sound
call
->
setAudioStart
(
false
);
call
->
setState
(
Call
::
Hold
);
_debug
(
"SIP: Stopping AudioRTP when onhold
\n
"
);
_audiortp
.
closeRtpSession
();
int
did
=
call
->
getDid
();
eXosip_lock
();
...
...
@@ -661,12 +668,6 @@ SIPVoIPLink::onhold(const CallID& id)
osip_message_set_content_type
(
invite
,
"application/sdp"
);
}
// Stop sound
call
->
setAudioStart
(
false
);
call
->
setState
(
Call
::
Hold
);
_debug
(
"SIP: Stopping AudioRTP when onhold
\n
"
);
_audiortp
.
closeRtpSession
();
// send request
_debug
(
"< Send on hold request
\n
"
);
eXosip_lock
();
...
...
tools/sflphone-bash/call
View file @
567e11c5
...
...
@@ -30,7 +30,7 @@ if [ -z `$pidof 'sflphoned'` ]; then
echo
-en
"
\n
"
;
fi
callstring
=
"call someone
with
$callid
$telephonenumber
\n
"
callstring
=
"call someone
SIP0
$callid
$telephonenumber
\n
"
echo
"Calling
$telephonenumber
..."
echo
-en
$callstring
|
$netcat
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment