Skip to content

Commit 34f9367

Browse files
committed
DAHDI: Fix compilation issues in DAHDI Linux.
* Compile and successfully build dahdi_dummy * Compile and successfully build dahdi_echocan_oslec * Build against Rocky Linux 9.6 * Fix compilation following commit asterisk/asterisk@43bf8a4 * Rebase and re-enable real time pulsing patches
1 parent 9c8b559 commit 34f9367

File tree

6 files changed

+131
-113
lines changed

6 files changed

+131
-113
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,9 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
kernel_branch: [
24-
'linux-4.14.y',
2524
'linux-4.19.y',
26-
'linux-5.4.y',
27-
'linux-5.10.y',
28-
'linux-5.15.y',
29-
'linux-5.17.y',
30-
'linux-5.18.y',
3125
'linux-5.19.y',
3226
'linux-6.1.y',
33-
'linux-6.5.y',
3427
'linux-6.8.y',
3528
'linux-6.9.y',
3629
'linux-6.10.y',
@@ -304,7 +297,19 @@ jobs:
304297
run: |
305298
./phreaknet.sh make
306299
GIT_REPO_PATH=${GITHUB_WORKSPACE} phreaknet install --fast --dahdi --autokvers --drivers --devmode
307-
rocky-9:
300+
rocky-96:
301+
runs-on: ubuntu-24.04
302+
name: Rocky Linux 9.6
303+
container: rockylinux:9
304+
steps:
305+
- uses: actions/checkout@v4
306+
- name: Build DAHDI and Asterisk
307+
run: |
308+
dnf install -y git tar
309+
./phreaknet.sh make
310+
cat /etc/rocky-release
311+
GIT_REPO_PATH=${GITHUB_WORKSPACE} phreaknet install --fast --dahdi --autokvers --drivers --devmode
312+
rocky-93:
308313
runs-on: ubuntu-24.04
309314
name: Rocky Linux 9.3
310315
container: rockylinux:9.3
@@ -314,7 +319,7 @@ jobs:
314319
run: |
315320
./phreaknet.sh make
316321
GIT_REPO_PATH=${GITHUB_WORKSPACE} phreaknet install --fast --dahdi --autokvers --drivers --devmode
317-
rocky-8:
322+
rocky-89:
318323
runs-on: ubuntu-24.04
319324
name: Rocky Linux 8.9
320325
container: rockylinux:8.9
Lines changed: 13 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
2-
index e6c41e51e9..3baabb0872 100644
2+
index 99a28b0286..9cd6c17eac 100644
33
--- a/channels/chan_dahdi.c
44
+++ b/channels/chan_dahdi.c
5-
@@ -2573,6 +2573,12 @@ static enum analog_event dahdievent_to_analogevent(int event)
5+
@@ -2708,6 +2708,12 @@ static enum analog_event dahdievent_to_analogevent(int event)
66
case DAHDI_EVENT_PULSE_START:
77
res = ANALOG_EVENT_PULSE_START;
88
break;
@@ -15,7 +15,7 @@ index e6c41e51e9..3baabb0872 100644
1515
case DAHDI_EVENT_POLARITY:
1616
res = ANALOG_EVENT_POLARITY;
1717
break;
18-
@@ -7778,6 +7784,10 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
18+
@@ -7928,6 +7934,10 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
1919
if (!ast_channel_pbx(ast))
2020
tone_zone_play_tone(p->subs[idx].dfd, -1);
2121
break;
@@ -27,10 +27,10 @@ index e6c41e51e9..3baabb0872 100644
2727
/* DAHDI has completed dialing all digits sent using DAHDI_DIAL. */
2828
#if defined(HAVE_PRI)
2929
diff --git a/channels/chan_dahdi.h b/channels/chan_dahdi.h
30-
index b7955cdddf..23d0691f24 100644
30+
index 43c89d93b4..1a42f0fa47 100644
3131
--- a/channels/chan_dahdi.h
3232
+++ b/channels/chan_dahdi.h
33-
@@ -354,6 +354,11 @@ struct dahdi_pvt {
33+
@@ -358,6 +358,11 @@ struct dahdi_pvt {
3434
unsigned int pulse:1;
3535
/*! \brief TRUE if a pulsed digit was detected. (Pulse dial phone detected) */
3636
unsigned int pulsedial:1;
@@ -43,10 +43,10 @@ index b7955cdddf..23d0691f24 100644
4343
/*!
4444
* \brief TRUE if caller ID is restricted.
4545
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
46-
index cbf4ab4479..e72917d126 100644
46+
index 1ddf66fe3d..a4becf3042 100644
4747
--- a/channels/chan_iax2.c
4848
+++ b/channels/chan_iax2.c
49-
@@ -1438,6 +1438,7 @@ static int iax2_is_control_frame_allowed(int subtype)
49+
@@ -1460,6 +1460,7 @@ static int iax2_is_control_frame_allowed(int subtype)
5050
case AST_CONTROL_TAKEOFFHOOK:
5151
case AST_CONTROL_OFFHOOK:
5252
case AST_CONTROL_CONGESTION:
@@ -55,7 +55,7 @@ index cbf4ab4479..e72917d126 100644
5555
case AST_CONTROL_WINK:
5656
case AST_CONTROL_OPTION:
5757
diff --git a/channels/sig_analog.c b/channels/sig_analog.c
58-
index 7ebb06239f..1cd63365c6 100644
58+
index e0d57b53ee..360cf23842 100644
5959
--- a/channels/sig_analog.c
6060
+++ b/channels/sig_analog.c
6161
@@ -290,6 +290,12 @@ static char *analog_event2str(enum analog_event event)
@@ -71,7 +71,7 @@ index 7ebb06239f..1cd63365c6 100644
7171
case ANALOG_EVENT_POLARITY:
7272
res = "ANALOG_EVENT_POLARITY";
7373
break;
74-
@@ -2874,10 +2880,30 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
74+
@@ -3098,10 +3104,30 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
7575
break;
7676
#endif
7777
case ANALOG_EVENT_PULSE_START:
@@ -103,7 +103,7 @@ index 7ebb06239f..1cd63365c6 100644
103103
if (p->inalarm) {
104104
break;
105105
diff --git a/channels/sig_analog.h b/channels/sig_analog.h
106-
index 81043f39a5..02b1a4de17 100644
106+
index ae909ebba6..878794ba81 100644
107107
--- a/channels/sig_analog.h
108108
+++ b/channels/sig_analog.h
109109
@@ -88,6 +88,8 @@ enum analog_event {
@@ -129,99 +129,11 @@ index 81043f39a5..02b1a4de17 100644
129129
/*! \brief -1 = unknown, 0 = no messages, 1 = new messages available */
130130
int msgstate;
131131

132-
@@ -300,6 +309,7 @@ struct analog_pvt {
133-
unsigned int permcallwaiting:1; /*!< TRUE if call waiting is enabled. (Configured option) */
132+
@@ -302,6 +311,7 @@ struct analog_pvt {
133+
unsigned int callwaitingdeluxe:1; /*!< TRUE if Call Waiting Deluxe options are available */
134134
unsigned int permhidecallerid:1; /*!< Whether to hide our outgoing caller ID or not */
135135
unsigned int pulse:1;
136-
+ unsigned int realtimepulsing:1;
136+
+ unsigned int realtimepulsing:1; /*!< TRUE if realtimepulsing is enabled */
137137
unsigned int threewaycalling:1;
138138
unsigned int threewaysilenthold:1; /*!< Whether to time out a three-way dial tone to silence */
139139
unsigned int transfer:1;
140-
diff --git a/funcs/func_frame_drop.c b/funcs/func_frame_drop.c
141-
index 522685cbd0..ee2c8781d3 100644
142-
--- a/funcs/func_frame_drop.c
143-
+++ b/funcs/func_frame_drop.c
144-
@@ -77,6 +77,7 @@
145-
<enum name = "TAKEOFFHOOK" />
146-
<enum name = "OFFHOOK" />
147-
<enum name = "CONGESTION" />
148-
+ <enum name = "PULSE" />
149-
<enum name = "FLASH" />
150-
<enum name = "WINK" />
151-
<enum name = "PROGRESS" />
152-
@@ -134,6 +135,7 @@ static struct {
153-
{ AST_CONTROL_TAKEOFFHOOK, ",TAKEOFFHOOK," },
154-
{ AST_CONTROL_OFFHOOK, ",OFFHOOK," },
155-
{ AST_CONTROL_CONGESTION, ",CONGESTION," },
156-
+ { AST_CONTROL_PULSE, ",PULSE," },
157-
{ AST_CONTROL_FLASH, ",FLASH," },
158-
{ AST_CONTROL_WINK, ",WINK," },
159-
{ AST_CONTROL_PROGRESS, ",PROGRESS," },
160-
diff --git a/funcs/func_frame_trace.c b/funcs/func_frame_trace.c
161-
index 67345ef9e1..97ef1f7516 100644
162-
--- a/funcs/func_frame_trace.c
163-
+++ b/funcs/func_frame_trace.c
164-
@@ -266,6 +266,9 @@ static void print_frame(struct ast_frame *frame)
165-
case AST_CONTROL_CONGESTION:
166-
ast_verbose("SubClass: CONGESTION\n");
167-
break;
168-
+ case AST_CONTROL_PULSE:
169-
+ ast_verbose("SubClass: PULSE\n");
170-
+ break;
171-
case AST_CONTROL_FLASH:
172-
ast_verbose("SubClass: FLASH\n");
173-
break;
174-
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
175-
index 78e369c642..41f328c7ca 100644
176-
--- a/include/asterisk/frame.h
177-
+++ b/include/asterisk/frame.h
178-
@@ -312,6 +312,7 @@ enum ast_control_frame_type {
179-
AST_CONTROL_STREAM_TOPOLOGY_REQUEST_CHANGE = 35, /*!< Channel indication that a stream topology change has been requested */
180-
AST_CONTROL_STREAM_TOPOLOGY_CHANGED = 36, /*!< Channel indication that a stream topology change has occurred */
181-
AST_CONTROL_STREAM_TOPOLOGY_SOURCE_CHANGED = 37, /*!< Channel indication that one of the source streams has changed its source */
182-
+ AST_CONTROL_PULSE = 38, /*!< Dial Pulse */
183-
184-
/*
185-
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
186-
diff --git a/main/channel.c b/main/channel.c
187-
index 122f6e55a3..a98e635d95 100644
188-
--- a/main/channel.c
189-
+++ b/main/channel.c
190-
@@ -3321,6 +3321,7 @@ int ast_waitfordigit_full(struct ast_channel *c, int timeout_ms, const char *bre
191-
case AST_CONTROL_HOLD:
192-
case AST_CONTROL_UNHOLD:
193-
case AST_CONTROL_FLASH:
194-
+ case AST_CONTROL_PULSE:
195-
case -1:
196-
/* Unimportant */
197-
break;
198-
@@ -4294,6 +4295,7 @@ static int attribute_const is_visible_indication(enum ast_control_frame_type con
199-
case AST_CONTROL_OPTION:
200-
case AST_CONTROL_WINK:
201-
case AST_CONTROL_FLASH:
202-
+ case AST_CONTROL_PULSE:
203-
case AST_CONTROL_OFFHOOK:
204-
case AST_CONTROL_TAKEOFFHOOK:
205-
case AST_CONTROL_ANSWER:
206-
@@ -4595,6 +4597,7 @@ static int indicate_data_internal(struct ast_channel *chan, int _condition, cons
207-
case AST_CONTROL_OPTION:
208-
case AST_CONTROL_WINK:
209-
case AST_CONTROL_FLASH:
210-
+ case AST_CONTROL_PULSE:
211-
case AST_CONTROL_OFFHOOK:
212-
case AST_CONTROL_TAKEOFFHOOK:
213-
case AST_CONTROL_ANSWER:
214-
diff --git a/main/frame.c b/main/frame.c
215-
index 711f9e15f1..2a80921c24 100644
216-
--- a/main/frame.c
217-
+++ b/main/frame.c
218-
@@ -444,6 +444,9 @@ char *ast_frame_subclass2str(struct ast_frame *f, char *subclass, size_t slen, c
219-
case AST_CONTROL_CONGESTION:
220-
ast_copy_string(subclass, "Congestion", slen);
221-
break;
222-
+ case AST_CONTROL_PULSE:
223-
+ ast_copy_string(subclass, "Pulse", slen);
224-
+ break;
225-
case AST_CONTROL_FLASH:
226-
ast_copy_string(subclass, "Flash", slen);
227-
break;

patches/ast_rtoutpulsing_core.diff

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
2+
index a81ff92024..5fa49f91ab 100644
3+
--- a/include/asterisk/frame.h
4+
+++ b/include/asterisk/frame.h
5+
@@ -312,6 +312,7 @@ enum ast_control_frame_type {
6+
AST_CONTROL_STREAM_TOPOLOGY_REQUEST_CHANGE = 35, /*!< Channel indication that a stream topology change has been requested */
7+
AST_CONTROL_STREAM_TOPOLOGY_CHANGED = 36, /*!< Channel indication that a stream topology change has occurred */
8+
AST_CONTROL_STREAM_TOPOLOGY_SOURCE_CHANGED = 37, /*!< Channel indication that one of the source streams has changed its source */
9+
+ AST_CONTROL_PULSE = 38, /*!< Dial Pulse */
10+
11+
/*
12+
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
13+
diff --git a/main/channel.c b/main/channel.c
14+
index 374d6974c5..915d0fe57e 100644
15+
--- a/main/channel.c
16+
+++ b/main/channel.c
17+
@@ -3290,6 +3290,7 @@ int ast_waitfordigit_full(struct ast_channel *c, int timeout_ms, const char *bre
18+
case AST_CONTROL_HOLD:
19+
case AST_CONTROL_UNHOLD:
20+
case AST_CONTROL_FLASH:
21+
+ case AST_CONTROL_PULSE:
22+
case -1:
23+
/* Unimportant */
24+
break;
25+
@@ -4248,6 +4249,7 @@ static int attribute_const is_visible_indication(enum ast_control_frame_type con
26+
case AST_CONTROL_OPTION:
27+
case AST_CONTROL_WINK:
28+
case AST_CONTROL_FLASH:
29+
+ case AST_CONTROL_PULSE:
30+
case AST_CONTROL_OFFHOOK:
31+
case AST_CONTROL_TAKEOFFHOOK:
32+
case AST_CONTROL_ANSWER:
33+
@@ -4550,6 +4552,7 @@ static int indicate_data_internal(struct ast_channel *chan, int _condition, cons
34+
case AST_CONTROL_OPTION:
35+
case AST_CONTROL_WINK:
36+
case AST_CONTROL_FLASH:
37+
+ case AST_CONTROL_PULSE:
38+
case AST_CONTROL_OFFHOOK:
39+
case AST_CONTROL_TAKEOFFHOOK:
40+
case AST_CONTROL_ANSWER:
41+
diff --git a/main/frame.c b/main/frame.c
42+
index e9e3663530..bd06b01efc 100644
43+
--- a/main/frame.c
44+
+++ b/main/frame.c
45+
@@ -447,6 +447,9 @@ char *ast_frame_subclass2str(struct ast_frame *f, char *subclass, size_t slen, c
46+
case AST_CONTROL_FLASH:
47+
ast_copy_string(subclass, "Flash", slen);
48+
break;
49+
+ case AST_CONTROL_PULSE:
50+
+ ast_copy_string(subclass, "Pulse", slen);
51+
+ break;
52+
case AST_CONTROL_WINK:
53+
ast_copy_string(subclass, "Wink", slen);
54+
break;

patches/ast_rtoutpulsing_funcs.diff

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
diff --git a/funcs/func_frame_drop.c b/funcs/func_frame_drop.c
2+
index 19694bc387..95c466744b 100644
3+
--- a/funcs/func_frame_drop.c
4+
+++ b/funcs/func_frame_drop.c
5+
@@ -76,6 +76,7 @@
6+
<enum name = "TAKEOFFHOOK" />
7+
<enum name = "OFFHOOK" />
8+
<enum name = "CONGESTION" />
9+
+ <enum name = "PULSE" />
10+
<enum name = "FLASH" />
11+
<enum name = "WINK" />
12+
<enum name = "PROGRESS" />
13+
@@ -133,6 +134,7 @@ static struct {
14+
{ AST_CONTROL_TAKEOFFHOOK, ",TAKEOFFHOOK," },
15+
{ AST_CONTROL_OFFHOOK, ",OFFHOOK," },
16+
{ AST_CONTROL_CONGESTION, ",CONGESTION," },
17+
+ { AST_CONTROL_PULSE, ",PULSE," },
18+
{ AST_CONTROL_FLASH, ",FLASH," },
19+
{ AST_CONTROL_WINK, ",WINK," },
20+
{ AST_CONTROL_PROGRESS, ",PROGRESS," },
21+
diff --git a/funcs/func_frame_trace.c b/funcs/func_frame_trace.c
22+
index cdb747311e..581f004ba2 100644
23+
--- a/funcs/func_frame_trace.c
24+
+++ b/funcs/func_frame_trace.c
25+
@@ -269,6 +269,9 @@ static void print_frame(struct ast_frame *frame)
26+
case AST_CONTROL_CONGESTION:
27+
ast_verbose("SubClass: CONGESTION\n");
28+
break;
29+
+ case AST_CONTROL_PULSE:
30+
+ ast_verbose("SubClass: PULSE\n");
31+
+ break;
32+
case AST_CONTROL_FLASH:
33+
ast_verbose("SubClass: FLASH\n");
34+
break;

phreaknet.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ FREEPBX_GUI=0
274274
GENERIC_HEADERS=0
275275
AUTOSET_KVERS=0
276276
EXTERNAL_CODECS=0
277-
RTPULSING=0 # Disabled temporarily, patches must be rebased
277+
RTPULSING=1 # Disabled temporarily, patches must be rebased
278278
HEARPULSING=1
279279
HAVE_COMPATIBLE_SPANDSP=1
280280
PACMAN_UPDATED=0 # Internal flag
@@ -2063,6 +2063,13 @@ install_dahdi() {
20632063
die "Directory not found: $AST_SOURCE_PARENT_DIR/$DAHDI_LIN_SRC_DIR"
20642064
fi
20652065

2066+
# Download the dahdi-linux-extra repo. This is needed for OSLEC support.
2067+
if [ ! -d dahdi-linux-extra.git ]; then
2068+
git clone --depth 1 --single-branch --branch extra-2.10.y https://notabug.org/tzafrir/dahdi-linux-extra.git
2069+
fi
2070+
cp -r dahdi-linux-extra/drivers/staging $AST_SOURCE_PARENT_DIR/$DAHDI_LIN_SRC_DIR/drivers
2071+
# Since the OSLEC code is unlikely to change, there isn't much point in redownloading dahdi-linux-extra more than once.
2072+
20662073
# DAHDI Linux (generally recommended to install DAHDI Linux and DAHDI Tools separately, as opposed to bundled)
20672074
cd $AST_SOURCE_PARENT_DIR/$DAHDI_LIN_SRC_DIR
20682075

@@ -2084,6 +2091,8 @@ install_dahdi() {
20842091

20852092
if [ "$DAHDI_OLD_DRIVERS" = "1" ]; then
20862093
dahdi_unpurge $DAHDI_LIN_SRC_DIR # for some reason, this needs to be applied before the next branch patches
2094+
# Enable building dahdi_dummy, which is disabled by default
2095+
sed -i 's/#obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DUMMY)/obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DUMMY)/g' drivers/dahdi/Kbuild
20872096
fi
20882097

20892098
# Merged in master, but not yet in a current release
@@ -2103,6 +2112,8 @@ install_dahdi() {
21032112
dahlin_apply_pr 79 # vpmadt032 binary blob
21042113
dahlin_apply_pr 92 # del_timer_sync wrapper
21052114
dahlin_apply_pr 96 # from_timer renamed to timer_container_of
2115+
dahlin_apply_pr 98 # hrtimer_init changed to hrtimer_setup
2116+
dahlin_apply_pr 99 # use module_init/module_exit instead of init_module/cleanup_module
21062117

21072118
KERN_VER_MM=$( uname -r | cut -d. -f1-2 )
21082119
OS_DIST_2=$( printf "$OS_DIST_INFO" | cut -d' ' -f1-2)
@@ -2580,7 +2591,9 @@ phreak_patches() {
25802591

25812592
if [ "$RTPULSING" = "1" ]; then
25822593
# Patches split up to make it easier to selectively redo the 2nd one if a patch conflict occurs and the patch needs to be rebased.
2583-
git_patch "ast_rtoutpulsing1.diff" # chan_dahdi: add rtoutpulsing
2594+
git_patch "ast_rtoutpulsing_core.diff"
2595+
git_patch "ast_rtoutpulsing_funcs.diff"
2596+
git_patch "ast_rtoutpulsing_channels.diff"
25842597
git_patch "ast_rtoutpulsing2.diff" # chan_dahdi: add rtoutpulsing
25852598
fi
25862599

res/res_alarmsystem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,7 @@ static void *client_thread(void *arg)
16981698
/* Wait until the PBX is fully booted, similar to "core waitfullybooted"
16991699
* This is necessary because dialplan won't execute while the PBX is still booting,
17001700
* and events, including EVENT_ALARM_OKAY, can trigger user callbacks which execute dialplan. */
1701-
while (!ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)) {
1701+
while (!ast_fully_booted) {
17021702
usleep(1000);
17031703
}
17041704

0 commit comments

Comments
 (0)