@@ -2588,6 +2588,38 @@ build_g72x() {
25882588 fi
25892589}
25902590
2591+ get_sccp_source () {
2592+ cd $AST_SOURCE_PARENT_DIR
2593+ # The SCCP repo is currently stagnant, so if it's present, then just use the latest 'develop' HEAD and apply any needed patches
2594+ if [ -d chan-sccp ]; then
2595+ cd chan-sccp
2596+ git checkout .
2597+ git clean -df
2598+ else
2599+ git clone --depth 1 " https://github.com/chan-sccp/chan-sccp.git"
2600+ cd chan-sccp
2601+ fi
2602+ if [ $? -eq 0 ]; then
2603+ if [ $AST_MAJOR_VER -ge 21 ]; then
2604+ github_apply_pr " chan-sccp/chan-sccp" " 611" # Remove macros, or it won't even compile
2605+ fi
2606+ github_apply_pr " chan-sccp/chan-sccp" " 626" # Fix compilation with AST_DEV_MODE and DEBUG_FD_LEAKS
2607+ fi
2608+ }
2609+
2610+ build_sccp () {
2611+ cd $AST_SOURCE_PARENT_DIR
2612+ if [ ! -d chan-sccp ]; then
2613+ die " chan-sccp source directory not found"
2614+ fi
2615+ cd chan-sccp
2616+ ./configure --enable-conference --enable-advanced-functions --with-asterisk=$AST_SOURCE_PARENT_DIR /$AST_SRC_DIR
2617+ $AST_MAKE -j$( nproc) && $AST_MAKE install && $AST_MAKE reload
2618+ if [ $? -ne 0 ]; then
2619+ die " Failed to install chan_sccp"
2620+ fi
2621+ }
2622+
25912623# Instantiate an instance of the PhreakScript repository, if not already present
25922624# This is necessary since this script file is designed to be able to be used standalone,
25932625# without the rest of the repository necessarily being present.
@@ -3692,6 +3724,9 @@ elif [ "$cmd" = "offline" ]; then
36923724 git clone --depth 1 https://github.com/arkadijs/asterisk-g72x.git
36933725 fi
36943726 get_ast_source # end up with an asterisk-offline directory
3727+ if [ " $CHAN_SCCP " = " 1" ]; then
3728+ get_sccp_source
3729+ fi
36953730 echog " Offline installation source prepared in $AST_SOURCE_PARENT_DIR - copy this directory to target system for offline installation"
36963731 ls $AST_SOURCE_PARENT_DIR
36973732elif [ " $cmd " = " install" ]; then
@@ -4076,22 +4111,13 @@ elif [ "$cmd" = "install" ]; then
40764111 fi
40774112
40784113 if [ " $CHAN_SCCP " = " 1" ]; then
4079- cd $AST_SOURCE_PARENT_DIR
4080- cd chan-sccp
4081- if [ $? -eq 0 ]; then
4082- git fetch
4083- git pull
4084- if [ $AST_MAJOR_VER -ge 21 ]; then
4085- # Remove macros, or it won't even compile
4086- $WGET " https://github.com/chan-sccp/chan-sccp/commit/3c90b6447b17639c52b47ed61cfb154b15ee84ec.patch"
4087- git apply " 3c90b6447b17639c52b47ed61cfb154b15ee84ec.patch"
4088- fi
4089- ./configure --enable-conference --enable-advanced-functions --with-asterisk=../$AST_SRC_DIR
4090- $AST_MAKE -j$( nproc) && $AST_MAKE install && $AST_MAKE reload
4091- if [ $? -ne 0 ]; then
4092- die " Failed to install chan_sccp"
4093- fi
4114+ if [ " $OFFLINE_INSTALL " = " 1" ]; then
4115+ cd $AST_SOURCE_PARENT_DIR
4116+ cp -r $OFFLINE_DIR /chan-sccp .
4117+ else
4118+ get_sccp_source
40944119 fi
4120+ build_sccp
40954121 fi
40964122
40974123 # Development Mode (Asterisk Test Suite)
0 commit comments