Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
voicemngr
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
voicemngr
Commits
14b34f42
Commit
14b34f42
authored
1 year ago
by
Yalu Zhang
Browse files
Options
Downloads
Patches
Plain Diff
Support DTMF payload type change
parent
837fa877
Branches
Branches containing commit
No related tags found
1 merge request
!44
Support DTMF payload type change
Pipeline
#151141
passed
1 year ago
Stage: static_code_analysis
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libvoice/voice-types.h
+2
-0
2 additions, 0 deletions
libvoice/voice-types.h
ubus.c
+7
-0
7 additions, 0 deletions
ubus.c
with
9 additions
and
0 deletions
libvoice/voice-types.h
+
2
−
0
View file @
14b34f42
...
@@ -41,11 +41,13 @@ enum voice_dtmf_mode {
...
@@ -41,11 +41,13 @@ enum voice_dtmf_mode {
#define UBUS_DATA_CODEC_BIT 1
#define UBUS_DATA_CODEC_BIT 1
#define UBUS_DATA_PTIME_BIT (1<<1)
#define UBUS_DATA_PTIME_BIT (1<<1)
#define UBUS_DATA_DTMF_BIT (1<<2)
#define UBUS_DATA_DTMF_BIT (1<<2)
#define UBUS_DATA_DTMF_PT_BIT (1<<3)
struct
config_update_struct
{
struct
config_update_struct
{
uint8_t
mask
;
// 8 bit mask
uint8_t
mask
;
// 8 bit mask
enum
VOICE_CODEC
codec
;
enum
VOICE_CODEC
codec
;
int
ptime
;
int
ptime
;
enum
voice_dtmf_mode
dtmf_mode
;
enum
voice_dtmf_mode
dtmf_mode
;
int
dtmf_pt
;
// add more if needed
// add more if needed
};
};
...
...
This diff is collapsed.
Click to expand it.
ubus.c
+
7
−
0
View file @
14b34f42
...
@@ -42,6 +42,7 @@ enum {
...
@@ -42,6 +42,7 @@ enum {
CONNECTION_DATA_CODEC
,
CONNECTION_DATA_CODEC
,
CONNECTION_DATA_PTIME
,
CONNECTION_DATA_PTIME
,
CONNECTION_DATA_DTMF_MODE
,
CONNECTION_DATA_DTMF_MODE
,
CONNECTION_DATA_DTMF_PT
,
__CONNECTION_MAX
,
__CONNECTION_MAX
,
};
};
...
@@ -147,6 +148,7 @@ static const struct blobmsg_policy request_connection_policy[] = {
...
@@ -147,6 +148,7 @@ static const struct blobmsg_policy request_connection_policy[] = {
[
CONNECTION_DATA_CODEC
]
=
{
.
name
=
"codec"
,
.
type
=
BLOBMSG_TYPE_INT32
},
[
CONNECTION_DATA_CODEC
]
=
{
.
name
=
"codec"
,
.
type
=
BLOBMSG_TYPE_INT32
},
[
CONNECTION_DATA_PTIME
]
=
{
.
name
=
"ptime"
,
.
type
=
BLOBMSG_TYPE_INT32
},
[
CONNECTION_DATA_PTIME
]
=
{
.
name
=
"ptime"
,
.
type
=
BLOBMSG_TYPE_INT32
},
[
CONNECTION_DATA_DTMF_MODE
]
=
{
.
name
=
"dtmf_mode"
,
.
type
=
BLOBMSG_TYPE_INT32
},
[
CONNECTION_DATA_DTMF_MODE
]
=
{
.
name
=
"dtmf_mode"
,
.
type
=
BLOBMSG_TYPE_INT32
},
[
CONNECTION_DATA_DTMF_PT
]
=
{
.
name
=
"dtmf_pt"
,
.
type
=
BLOBMSG_TYPE_INT32
},
};
};
static
const
struct
blobmsg_policy
request_count_policy
[]
=
{
static
const
struct
blobmsg_policy
request_count_policy
[]
=
{
...
@@ -631,6 +633,7 @@ static int ubus_request_connection(struct ubus_context *uctx, struct ubus_object
...
@@ -631,6 +633,7 @@ static int ubus_request_connection(struct ubus_context *uctx, struct ubus_object
.
codec
=
VOICE_CODEC_G711A
,
.
codec
=
VOICE_CODEC_G711A
,
.
ptime
=
0
,
.
ptime
=
0
,
.
dtmf_mode
=
VOICE_DTMF_RFC_4733
,
.
dtmf_mode
=
VOICE_DTMF_RFC_4733
,
.
dtmf_pt
=
101
,
};
};
if
(
keys
[
CONNECTION_DATA_CODEC
]){
if
(
keys
[
CONNECTION_DATA_CODEC
]){
...
@@ -645,6 +648,10 @@ static int ubus_request_connection(struct ubus_context *uctx, struct ubus_object
...
@@ -645,6 +648,10 @@ static int ubus_request_connection(struct ubus_context *uctx, struct ubus_object
data
.
dtmf_mode
=
blobmsg_get_u32
(
keys
[
CONNECTION_DATA_DTMF_MODE
]);
data
.
dtmf_mode
=
blobmsg_get_u32
(
keys
[
CONNECTION_DATA_DTMF_MODE
]);
data
.
mask
=
data
.
mask
|
UBUS_DATA_DTMF_BIT
;
data
.
mask
=
data
.
mask
|
UBUS_DATA_DTMF_BIT
;
}
}
if
(
keys
[
CONNECTION_DATA_DTMF_PT
]){
data
.
dtmf_pt
=
blobmsg_get_u32
(
keys
[
CONNECTION_DATA_DTMF_PT
]);
data
.
mask
=
data
.
mask
|
UBUS_DATA_DTMF_PT_BIT
;
}
ENDPT_DBG
(
"line: %d connection_id: %d action: %s
\n
"
,
line
,
id
,
action_str
);
ENDPT_DBG
(
"line: %d connection_id: %d action: %s
\n
"
,
line
,
id
,
action_str
);
if
(
strcmp
(
"create"
,
action_str
)
==
0
)
{
if
(
strcmp
(
"create"
,
action_str
)
==
0
)
{
...
...
This diff is collapsed.
Click to expand it.
Yalu Zhang
@Yalu
mentioned in commit
469a95c2
·
1 year ago
mentioned in commit
469a95c2
mentioned in commit 469a95c2c9074793360d8d6f5f2d8894e5fcabcb
Toggle commit list
Yalu Zhang
@Yalu
mentioned in merge request
!45 (merged)
·
1 year ago
mentioned in merge request
!45 (merged)
mentioned in merge request !45
Toggle commit list
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