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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
d7a1c2d6
Commit
d7a1c2d6
authored
17 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
IAX codecs negociation according to user config
parent
a421cde9
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/iaxcall.cpp
+15
-25
15 additions, 25 deletions
src/iaxcall.cpp
src/iaxvoiplink.cpp
+12
-0
12 additions, 0 deletions
src/iaxvoiplink.cpp
with
27 additions
and
25 deletions
src/iaxcall.cpp
+
15
−
25
View file @
d7a1c2d6
...
@@ -35,16 +35,6 @@ IAXCall::setFormat(int format)
...
@@ -35,16 +35,6 @@ IAXCall::setFormat(int format)
{
{
_format
=
format
;
_format
=
format
;
switch
(
format
)
{
switch
(
format
)
{
/*case AST_FORMAT_ULAW:
setAudioCodec(_codecMap.getCodec(PAYLOAD_CODEC_ULAW)); break;
case AST_FORMAT_GSM:
setAudioCodec(_codecMap.getCodec(PAYLOAD_CODEC_GSM)); break;
case AST_FORMAT_ALAW:
setAudioCodec(_codecMap.getCodec(PAYLOAD_CODEC_ALAW)); break;
case AST_FORMAT_ILBC:
setAudioCodec(_codecMap.getCodec(PAYLOAD_CODEC_ILBC_20)); break;
case AST_FORMAT_SPEEX:
setAudioCodec(_codecMap.getCodec(PAYLOAD_CODEC_SPEEX_8000)); break;*/
case
AST_FORMAT_ULAW
:
case
AST_FORMAT_ULAW
:
setAudioCodec
(
PAYLOAD_CODEC_ULAW
);
break
;
setAudioCodec
(
PAYLOAD_CODEC_ULAW
);
break
;
case
AST_FORMAT_GSM
:
case
AST_FORMAT_GSM
:
...
@@ -65,12 +55,12 @@ IAXCall::setFormat(int format)
...
@@ -65,12 +55,12 @@ IAXCall::setFormat(int format)
int
int
IAXCall
::
getSupportedFormat
()
IAXCall
::
getSupportedFormat
()
{
{
Codec
Map
map
=
getCodecMap
().
getCodec
Map
();
Codec
Order
map
=
getCodecMap
().
get
Active
Codec
s
();
int
format
=
0
;
int
format
=
0
;
int
iter
;
CodecMap
::
iterator
iter
=
map
.
begin
();
for
(
iter
=
0
;
iter
<
map
.
size
()
;
iter
++
){
while
(
iter
!=
map
.
end
())
{
switch
(
map
[
iter
])
{
switch
(
iter
->
first
)
{
case
PAYLOAD_CODEC_ULAW
:
case
PAYLOAD_CODEC_ULAW
:
format
|=
AST_FORMAT_ULAW
;
break
;
format
|=
AST_FORMAT_ULAW
;
break
;
case
PAYLOAD_CODEC_GSM
:
case
PAYLOAD_CODEC_GSM
:
...
@@ -80,11 +70,11 @@ IAXCall::getSupportedFormat()
...
@@ -80,11 +70,11 @@ IAXCall::getSupportedFormat()
case
PAYLOAD_CODEC_ILBC_20
:
case
PAYLOAD_CODEC_ILBC_20
:
format
|=
AST_FORMAT_ILBC
;
break
;
format
|=
AST_FORMAT_ILBC
;
break
;
case
PAYLOAD_CODEC_SPEEX_8000
:
case
PAYLOAD_CODEC_SPEEX_8000
:
format
|=
AST_FORMAT_SPEEX
;
break
;
format
|=
AST_FORMAT_SPEEX
;
break
;
default:
default:
break
;
break
;
}
}
iter
++
;
}
}
return
format
;
return
format
;
...
@@ -93,18 +83,19 @@ IAXCall::getSupportedFormat()
...
@@ -93,18 +83,19 @@ IAXCall::getSupportedFormat()
int
int
IAXCall
::
getFirstMatchingFormat
(
int
needles
)
IAXCall
::
getFirstMatchingFormat
(
int
needles
)
{
{
Codec
Map
map
=
getCodecMap
().
getCodec
Map
();
Codec
Order
map
=
getCodecMap
().
get
Active
Codec
s
();
int
format
=
0
;
int
format
=
0
;
int
iter
;
CodecMap
::
iterator
iter
=
map
.
begin
();
for
(
iter
=
0
;
iter
<
map
.
size
()
;
iter
++
)
{
while
(
iter
!=
map
.
end
())
{
switch
(
map
[
iter
])
{
switch
(
iter
->
first
)
{
case
PAYLOAD_CODEC_ULAW
:
case
PAYLOAD_CODEC_ULAW
:
format
=
AST_FORMAT_ULAW
;
break
;
format
=
AST_FORMAT_ULAW
;
break
;
case
PAYLOAD_CODEC_GSM
:
case
PAYLOAD_CODEC_GSM
:
format
=
AST_FORMAT_GSM
;
break
;
format
=
AST_FORMAT_GSM
;
break
;
case
PAYLOAD_CODEC_ALAW
:
case
PAYLOAD_CODEC_ALAW
:
format
=
AST_FORMAT_ALAW
;
break
;
format
=
AST_FORMAT_ALAW
;
break
;
case
PAYLOAD_CODEC_ILBC_20
:
case
PAYLOAD_CODEC_ILBC_20
:
format
=
AST_FORMAT_ILBC
;
break
;
format
=
AST_FORMAT_ILBC
;
break
;
case
PAYLOAD_CODEC_SPEEX_8000
:
case
PAYLOAD_CODEC_SPEEX_8000
:
...
@@ -112,11 +103,10 @@ IAXCall::getFirstMatchingFormat(int needles)
...
@@ -112,11 +103,10 @@ IAXCall::getFirstMatchingFormat(int needles)
default:
default:
break
;
break
;
}
}
// Return the first that matches
// Return the first that matches
if
(
format
&
needles
)
if
(
format
&
needles
)
return
format
;
return
format
;
iter
++
;
}
}
return
0
;
return
0
;
}
}
This diff is collapsed.
Click to expand it.
src/iaxvoiplink.cpp
+
12
−
0
View file @
d7a1c2d6
...
@@ -515,6 +515,8 @@ Call*
...
@@ -515,6 +515,8 @@ Call*
IAXVoIPLink
::
newOutgoingCall
(
const
CallID
&
id
,
const
std
::
string
&
toUrl
)
IAXVoIPLink
::
newOutgoingCall
(
const
CallID
&
id
,
const
std
::
string
&
toUrl
)
{
{
IAXCall
*
call
=
new
IAXCall
(
id
,
Call
::
Outgoing
);
IAXCall
*
call
=
new
IAXCall
(
id
,
Call
::
Outgoing
);
call
->
setCodecMap
(
Manager
::
instance
().
getCodecDescriptorMap
());
if
(
call
)
{
if
(
call
)
{
call
->
setPeerNumber
(
toUrl
);
call
->
setPeerNumber
(
toUrl
);
...
@@ -957,6 +959,7 @@ IAXVoIPLink::iaxHandlePrecallEvent(iax_event* event)
...
@@ -957,6 +959,7 @@ IAXVoIPLink::iaxHandlePrecallEvent(iax_event* event)
call
->
setCodecMap
(
Manager
::
instance
().
getCodecDescriptorMap
());
call
->
setCodecMap
(
Manager
::
instance
().
getCodecDescriptorMap
());
call
->
setConnectionState
(
Call
::
Progressing
);
call
->
setConnectionState
(
Call
::
Progressing
);
if
(
event
->
ies
.
calling_number
)
if
(
event
->
ies
.
calling_number
)
call
->
setPeerNumber
(
std
::
string
(
event
->
ies
.
calling_number
));
call
->
setPeerNumber
(
std
::
string
(
event
->
ies
.
calling_number
));
if
(
event
->
ies
.
calling_name
)
if
(
event
->
ies
.
calling_name
)
...
@@ -1008,3 +1011,12 @@ IAXVoIPLink::iaxHandlePrecallEvent(iax_event* event)
...
@@ -1008,3 +1011,12 @@ IAXVoIPLink::iaxHandlePrecallEvent(iax_event* event)
}
}
int
IAXVoIPLink
::
iaxCodecMapToFormat
(
IAXCall
*
call
)
{
CodecOrder
map
=
call
->
getCodecMap
().
getActiveCodecs
();
printf
(
"taytciatcia = %i
\n
"
,
map
.
size
());
return
0
;
}
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