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
673964d3
Commit
673964d3
authored
8 years ago
by
zuul
Committed by
Gerrit Code Review
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge "chan_dahdi: remove by_name support"
parents
a380bba1
0646b48e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
UPGRADE.txt
+9
-0
9 additions, 0 deletions
UPGRADE.txt
channels/chan_dahdi.c
+5
-79
5 additions, 79 deletions
channels/chan_dahdi.c
configs/samples/chan_dahdi.conf.sample
+0
-18
0 additions, 18 deletions
configs/samples/chan_dahdi.conf.sample
with
14 additions
and
97 deletions
UPGRADE.txt
+
9
−
0
View file @
673964d3
...
@@ -32,3 +32,12 @@ Queue:
...
@@ -32,3 +32,12 @@ Queue:
added via the CLI command "queue add" or the AMI action "QueueAdd") now have
added via the CLI command "queue add" or the AMI action "QueueAdd") now have
their ringinuse value updated to the value of the queue. Previously, the
their ringinuse value updated to the value of the queue. Previously, the
ringinuse value for dynamic members was not updated on reload.
ringinuse value for dynamic members was not updated on reload.
Channel Drivers:
chan_dahdi:
- Support for specifying a DAHDI channel using a path under /dev/dahdi
("by name") has been removed. It was never used. Instead you should
use kernel-level channel number allocation using span assignments.
See the documentation of dahdi-linux and dahdi-tools.
This diff is collapsed.
Click to expand it.
channels/chan_dahdi.c
+
5
−
79
View file @
673964d3
...
@@ -11975,38 +11975,6 @@ static int sigtype_to_signalling(int sigtype)
...
@@ -11975,38 +11975,6 @@ static int sigtype_to_signalling(int sigtype)
return sigtype;
return sigtype;
}
}
/*!
* \internal
* \brief Get file name and channel number from (subdir,number)
*
* \param subdir name of the subdirectory under /dev/dahdi/
* \param channel name of device file under /dev/dahdi/<subdir>/
* \param path buffer to put file name in
* \param pathlen maximal length of path
*
* \retval minor number of dahdi channel.
* \retval -errno on error.
*/
static int device2chan(const char *subdir, int channel, char *path, int pathlen)
{
struct stat stbuf;
int num;
snprintf(path, pathlen, "/dev/dahdi/%s/%d", subdir, channel);
if (stat(path, &stbuf) < 0) {
ast_log(LOG_ERROR, "stat(%s) failed: %s\n", path, strerror(errno));
return -errno;
}
if (!S_ISCHR(stbuf.st_mode)) {
ast_log(LOG_ERROR, "%s: Not a character device file\n", path);
return -EINVAL;
}
num = minor(stbuf.st_rdev);
ast_debug(1, "%s -> %d\n", path, num);
return num;
}
/*!
/*!
* \internal
* \internal
* \brief Initialize/create a channel interface.
* \brief Initialize/create a channel interface.
...
@@ -17424,33 +17392,9 @@ static int unload_module(void)
...
@@ -17424,33 +17392,9 @@ static int unload_module(void)
return __unload_module();
return __unload_module();
}
}
static void string_replace(char *str, int char1, int char2)
{
for (; *str; str++) {
if (*str == char1) {
*str = char2;
}
}
}
static char *parse_spanchan(char *chanstr, char **subdir)
{
char *p;
if ((p = strrchr(chanstr, '!')) == NULL) {
*subdir = NULL;
return chanstr;
}
*p++ = '\0';
string_replace(chanstr, '!', '/');
*subdir = chanstr;
return p;
}
static int build_channels(struct dahdi_chan_conf *conf, const char *value, int reload, int lineno)
static int build_channels(struct dahdi_chan_conf *conf, const char *value, int reload, int lineno)
{
{
char *c, *chan;
char *c, *chan;
char *subdir;
int x, start, finish;
int x, start, finish;
struct dahdi_pvt *tmp;
struct dahdi_pvt *tmp;
...
@@ -17460,7 +17404,6 @@ static int build_channels(struct dahdi_chan_conf *conf, const char *value, int r
...
@@ -17460,7 +17404,6 @@ static int build_channels(struct dahdi_chan_conf *conf, const char *value, int r
}
}
c = ast_strdupa(value);
c = ast_strdupa(value);
c = parse_spanchan(c, &subdir);
while ((chan = strsep(&c, ","))) {
while ((chan = strsep(&c, ","))) {
if (sscanf(chan, "%30d-%30d", &start, &finish) == 2) {
if (sscanf(chan, "%30d-%30d", &start, &finish) == 2) {
...
@@ -17482,39 +17425,22 @@ static int build_channels(struct dahdi_chan_conf *conf, const char *value, int r
...
@@ -17482,39 +17425,22 @@ static int build_channels(struct dahdi_chan_conf *conf, const char *value, int r
}
}
for (x = start; x <= finish; x++) {
for (x = start; x <= finish; x++) {
char fn[PATH_MAX];
int real_channel = x;
if (!ast_strlen_zero(subdir)) {
real_channel = device2chan(subdir, x, fn, sizeof(fn));
if (real_channel < 0) {
if (conf->ignore_failed_channels) {
ast_log(LOG_WARNING, "Failed configuring %s!%d, (got %d). But moving on to others.\n",
subdir, x, real_channel);
continue;
} else {
ast_log(LOG_ERROR, "Failed configuring %s!%d, (got %d).\n",
subdir, x, real_channel);
return -1;
}
}
}
if (conf->wanted_channels_start &&
if (conf->wanted_channels_start &&
(
real_channel
< conf->wanted_channels_start ||
(
x
< conf->wanted_channels_start ||
real_channel
> conf->wanted_channels_end)
x
> conf->wanted_channels_end)
) {
) {
continue;
continue;
}
}
tmp = mkintf(
real_channel
, conf, reload);
tmp = mkintf(
x
, conf, reload);
if (tmp) {
if (tmp) {
ast_verb(3, "%s channel %d, %s signalling\n", reload ? "Reconfigured" : "Registered",
real_channel
, sig2str(tmp->sig));
ast_verb(3, "%s channel %d, %s signalling\n", reload ? "Reconfigured" : "Registered",
x
, sig2str(tmp->sig));
} else {
} else {
ast_log(LOG_ERROR, "Unable to %s channel '%s'\n",
ast_log(LOG_ERROR, "Unable to %s channel '%s'\n",
(reload == 1) ? "reconfigure" : "register", value);
(reload == 1) ? "reconfigure" : "register", value);
return -1;
return -1;
}
}
if (
real_channel
== CHAN_PSEUDO) {
if (
x
== CHAN_PSEUDO) {
has_pseudo = 1;
has_pseudo = 1;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
configs/samples/chan_dahdi.conf.sample
+
0
−
18
View file @
673964d3
...
@@ -1330,24 +1330,6 @@ pickupgroup=1
...
@@ -1330,24 +1330,6 @@ pickupgroup=1
; signalling = pri_cpe
; signalling = pri_cpe
; group = 2
; group = 2
; channel => 1-23
; channel => 1-23
;
; Alternatively, the number of the channel may be replaced with a relative
; path to a device file under /dev/dahdi . The final element of that file
; must be a number, though. The directory separator is '!', as we can't
; use '/' in a dial string. So if we have
;
; /dev/dahdi/span-name/pstn/00/1
; /dev/dahdi/span-name/pstn/00/2
; /dev/dahdi/span-name/pstn/00/3
; /dev/dahdi/span-name/pstn/00/4
;
; we could use:
;channel => span-name!pstn!00!1-4
;
; or:
;channel => span-name!pstn!00!1,2,3,4
;
; See also ignore_failed_channels above.
; Used for distinctive ring support for x100p.
; Used for distinctive ring support for x100p.
; You can see the dringX patterns is to set any one of the dringXcontext fields
; You can see the dringX patterns is to set any one of the dringXcontext fields
...
...
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