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
8c3ed468
Commit
8c3ed468
authored
5 years ago
by
George Joseph
Committed by
Gerrit Code Review
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge "openr2(2/6): Stop polling channels when DAHDI returns -ENODEV (e.g: plug-out)"
parents
497308b5
97d2549b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
channels/chan_dahdi.c
+16
-0
16 additions, 0 deletions
channels/chan_dahdi.c
with
16 additions
and
0 deletions
channels/chan_dahdi.c
+
16
−
0
View file @
8c3ed468
...
...
@@ -748,6 +748,7 @@ struct dahdi_mfcr2 {
openr2_context_t *protocol_context; /*!< OpenR2 context handle */
struct dahdi_pvt *pvts[SIG_MFCR2_MAX_CHANNELS]; /*!< Member channel pvt structs */
int numchans; /*!< Number of channels in this R2 block */
int nodev; /*!< Link disconnected? */
struct dahdi_mfcr2_conf conf; /*!< Configuration used to setup this pseudo-link */
};
...
...
@@ -3636,7 +3637,19 @@ static void dahdi_r2_on_hardware_alarm(openr2_chan_t *r2chan, int alarm)
static void dahdi_r2_on_os_error(openr2_chan_t *r2chan, int errorcode)
{
struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
ast_log(LOG_ERROR, "OS error on chan %d: %s\n", openr2_chan_get_number(r2chan), strerror(errorcode));
ast_mutex_lock(&p->lock);
/* Disconnected? */
if (errorcode == ENODEV) {
struct dahdi_mfcr2 *r2link = p->mfcr2;
p->mfcr2call = 0;
if (r2link) {
r2link->nodev = 1;
}
}
ast_mutex_unlock(&p->lock);
}
static void dahdi_r2_on_protocol_error(openr2_chan_t *r2chan, openr2_protocol_error_t reason)
...
...
@@ -13741,6 +13754,9 @@ static void *mfcr2_monitor(void *data)
if (mfcr2->pvts[i]->owner) {
continue;
}
if (mfcr2->nodev) {
continue;
}
if (!mfcr2->pvts[i]->r2chan) {
ast_debug(1, "Wow, no r2chan on channel %d\n", mfcr2->pvts[i]->channel);
quit_loop = 1;
...
...
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