Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
e9455d22
Commit
e9455d22
authored
7 years ago
by
Jenkins2
Committed by
Gerrit Code Review
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge "chan_rtp: Use μ-law by default instead of signed linear"
parents
ba27a650
eec03963
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
channels/chan_rtp.c
+18
-2
18 additions, 2 deletions
channels/chan_rtp.c
with
18 additions
and
2 deletions
channels/chan_rtp.c
+
18
−
2
View file @
e9455d22
...
@@ -117,6 +117,22 @@ static int rtp_hangup(struct ast_channel *ast)
...
@@ -117,6 +117,22 @@ static int rtp_hangup(struct ast_channel *ast)
return
0
;
return
0
;
}
}
static
struct
ast_format
*
derive_format_from_cap
(
struct
ast_format_cap
*
cap
)
{
struct
ast_format
*
fmt
=
ast_format_cap_get_format
(
cap
,
0
);
if
(
ast_format_cap_count
(
cap
)
==
1
&&
fmt
==
ast_format_slin
)
{
/*
* Because we have no SDP, we must use one of the static RTP payload
* assignments. Signed linear @ 8kHz does not map, so if that is our
* only capability, we force μ-law instead.
*/
fmt
=
ast_format_ulaw
;
}
return
fmt
;
}
/*! \brief Function called when we should prepare to call the multicast destination */
/*! \brief Function called when we should prepare to call the multicast destination */
static
struct
ast_channel
*
multicast_rtp_request
(
const
char
*
type
,
struct
ast_format_cap
*
cap
,
const
struct
ast_assigned_ids
*
assignedids
,
const
struct
ast_channel
*
requestor
,
const
char
*
data
,
int
*
cause
)
static
struct
ast_channel
*
multicast_rtp_request
(
const
char
*
type
,
struct
ast_format_cap
*
cap
,
const
struct
ast_assigned_ids
*
assignedids
,
const
struct
ast_channel
*
requestor
,
const
char
*
data
,
int
*
cause
)
{
{
...
@@ -171,7 +187,7 @@ static struct ast_channel *multicast_rtp_request(const char *type, struct ast_fo
...
@@ -171,7 +187,7 @@ static struct ast_channel *multicast_rtp_request(const char *type, struct ast_fo
fmt
=
ast_multicast_rtp_options_get_format
(
mcast_options
);
fmt
=
ast_multicast_rtp_options_get_format
(
mcast_options
);
if
(
!
fmt
)
{
if
(
!
fmt
)
{
fmt
=
ast
_format_
cap_get_format
(
cap
,
0
);
fmt
=
derive
_format_
from_cap
(
cap
);
}
}
if
(
!
fmt
)
{
if
(
!
fmt
)
{
ast_log
(
LOG_ERROR
,
"No codec available for sending RTP to '%s'
\n
"
,
ast_log
(
LOG_ERROR
,
"No codec available for sending RTP to '%s'
\n
"
,
...
@@ -298,7 +314,7 @@ static struct ast_channel *unicast_rtp_request(const char *type, struct ast_form
...
@@ -298,7 +314,7 @@ static struct ast_channel *unicast_rtp_request(const char *type, struct ast_form
goto
failure
;
goto
failure
;
}
}
}
else
{
}
else
{
fmt
=
ast
_format_
cap_get_format
(
cap
,
0
);
fmt
=
derive
_format_
from_cap
(
cap
);
if
(
!
fmt
)
{
if
(
!
fmt
)
{
ast_log
(
LOG_ERROR
,
"No codec available for sending RTP to '%s'
\n
"
,
ast_log
(
LOG_ERROR
,
"No codec available for sending RTP to '%s'
\n
"
,
args
.
destination
);
args
.
destination
);
...
...
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