Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yealink-Support + solved IAXmodem problem #44

Open
wants to merge 43 commits into
base: 3.3-ast-13
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f0c59d0
Problems with some firmware versions
saschadaniels Aug 1, 2016
2db5135
added Yealink T46G and T48G support
Nov 22, 2014
04cd157
yealink changes
Nov 23, 2014
30f4fb5
yealink changes
Nov 23, 2014
fe88c3a
yealink changes
Nov 23, 2014
a27c586
yealink changes
Nov 23, 2014
d22b6c9
yealink changes
Nov 23, 2014
e68ae19
yealink changes
Nov 23, 2014
f965fb0
yealink changes
Nov 23, 2014
2b174e3
yealink cleanup
Nov 23, 2014
0da1ab5
yealink cleanup
Nov 23, 2014
3f3ee4d
Yealink cleanup
Nov 23, 2014
9220373
Added Yealink support in checkcfg ... without phone reboot :)
d-mark Jul 1, 2015
88880af
Bugfixes and further work on yealink provisioning
d-mark Jul 31, 2015
3f18348
added display of provisioned user on T46G
d-mark Feb 24, 2016
3050642
added php5-curl package in install.sh
d-mark Feb 24, 2016
2104622
added DHCP Readme for Yealink provisioning
d-mark Feb 24, 2016
4f257a1
Added Yealink firmware folder and short Readme.
d-mark Feb 26, 2016
413564f
Ringtone internal/external for Yealink
d-mark Dec 28, 2016
18699dd
added support for Yealink T42G, several bugfixes
d-mark Dec 30, 2016
20b8524
Yealink reprovisioning via SIP NOTIFY, handset volume
d-mark Dec 30, 2016
b715f4e
use group membership of user for dialout by IAXmodem
d-mark Jan 1, 2017
1688614
added phonebooks to Yealink provisioning, search on phone works best
d-mark Jan 31, 2017
5aecaef
Yealink EXP40 support
d-mark Feb 17, 2017
9a72a1b
syntax fehler beseitigt
sebastianertz Feb 20, 2017
7adcc26
Add Provisioning for SNOM D305, D315, D375
sebastianertz Feb 20, 2017
ff3e4c2
added GS server side Dial log for Yealink
d-mark Feb 23, 2017
04cdcd0
added some settings, especially XML push server
d-mark Feb 24, 2017
b4295ab
speed up yealink provisioning by only settings params for configured …
d-mark Feb 28, 2017
c7599b0
Yealink prov: add XML push server = IP of GS and action URI IP to any
d-mark Feb 28, 2017
60e98ea
Yealink add custom ringtone
d-mark Apr 5, 2017
b9f7213
added support for Yealink T42S and T46S
d-mark Jul 24, 2017
02ffde2
fixed syntax error
d-mark Jul 24, 2017
3998cc2
Bugfix Yealink Support T4xS Key assignment
d-mark Aug 15, 2017
6971ad0
fix update of CID info to RPID-PAI-FROM
d-mark Dec 2, 2017
f2c0012
RTCP-XR settings added (enabled)
d-mark Jan 30, 2018
09816fe
Yealink - disabled new warning display, bugfixes + asterisk patches i…
d-mark Nov 5, 2018
50b4e96
G.722 Codec added in SIP and IAX gateways
d-mark Nov 6, 2018
056a1fe
newer Yealink phones have another MAC vendor ID
d-mark Nov 6, 2018
f9ecb07
use G722 codec in SIP and IAX nodes with higher prio than alaw if act…
d-mark Nov 20, 2018
def9af6
show login source IP and telephone type in admin users module
d-mark Nov 20, 2018
903458a
Merge branch 'snom-d' of https://github.com/sebastianertz/GS3 into 3.…
d-mark Jan 21, 2019
049403b
Added support for Yealink T46U + EXT43
d-mark Aug 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ opt/gemeinschaft/etc/asterisk/extensions.ael
*.pyc
.gemeinschaft-version
*.komodoproject

# exclude yealink firmware images
opt/gemeinschaft/htdocs/prov/yealink/fw/*.rom

2 changes: 1 addition & 1 deletion etc/asterisk/asterisk.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
astetcdir => /opt/gemeinschaft/etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astdatadir => /usr/share/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
Expand Down
54 changes: 54 additions & 0 deletions etc/gemeinschaft/gemeinschaft.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
//$PROV_MODELS_ENABLED_AASTRA = '*'; # or '51i,53i,55i,57i'
//$PROV_MODELS_ENABLED_GRANDSTREAM = '*'; # or 'bt110,gxp2000,gxp2020', ...
//$PROV_MODELS_ENABLED_TIPTEL = '*'; # or 'ip280,ip284,ip286'
//$PROV_MODELS_ENABLED_YEALINK = '*'; # or 'yealink-sip-t46g,yealink-sip-t48g'
//$PROV_MODELS_ENABLED_POLYCOM = '*'; # or 'spip-550,spip-670', ...


Expand Down Expand Up @@ -490,6 +491,56 @@
# 'f20' Private Hold
# 'f27' XML Browser

//-----------------------[ Yealink ]-----------------------//

$YEALINK_PROV_ENABLED = true; # do provisioning for Yealink?

$YEALINK_PROV_HTTP_PASS = 'admin'; # e.g. "gEheiM23y89sdo23", default: 'admin'
# to password protect the phone's web gui.
# changing these values will likely cause automatic rebooting to fail

//$YEALINK_PROV_NTP = @$PROV_HOST;
//$YEALINK_PROV_NTP = '192.168.1.130';
# NTP Server. the stupid Tiptel needs it

# Set $LOG_LEVEL to "NOTICE" or even "DEBUG" and
# tail -f /var/log/gemeinschaft/gs.log
# Test the update mechanism with 1 or 2 phones. This is especially
# important with PoE (Power over Ethernet) switches.
$YEALINK_PROV_FW_UPDATE = false; # allow firmware updates?

//$YEALINK_PROV_KEY_BLACKLIST = '';
# do not show these softkey functions in GUI,
# comma separated list (e.g. 'f5,f12,f17'), default: ''
# 'f13' SpeedDial
# 'f16' BLF
# 'f1' Conference
# 'f2' Forward
# 'f3' Transfer
# 'f4' Hold
# 'f5' DND
# 'f6' Redial
# 'f7' Call Return
# 'f8' SMS
# 'f9' Call Pickup
# 'f10' Call Park
# 'f11' Custom
# 'f12' Voicemail
# 'f14' Intercom
# 'f15' Line
# 'f17' URL
# 'f18' Group Listening
# 'f19' Public Hold
# 'f20' Private Hold
# 'f27' XML Browser

$YEALINK_PROV_FW_DEFAULT_SIP_T42G = '';
$YEALINK_PROV_FW_DEFAULT_SIP_T46G = '';
$YEALINK_PROV_FW_DEFAULT_SIP_T48G = '';

$YEALINK_PROV_FW_DEFAULT_SIP_T42S = '';
$YEALINK_PROV_FW_DEFAULT_SIP_T46S = '';
$YEALINK_PROV_FW_DEFAULT_SIP_T46U = '';

//-----------------------[ Polycom ]----------------------//

Expand Down Expand Up @@ -676,6 +727,9 @@
//$FAX_INIT_DOCDIR = '/tmp/';
# directory containing fax documents to be used by "send-fax.php"

//$FAX_MAP_IAXMODEM_USER = "";
# use group membership of user for dialout by IAXmodem

/***********************************************************
* BRANCH OFFICE INTEGRATION (BOI)
***********************************************************/
Expand Down
51 changes: 46 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ ${APTITUDE_INSTALL} \
vim less git linux-headers-$(uname -r) \
gcc make gcc make ncurses-dev zlib1g-dev \
g++ libxml2-dev doxygen libmysql++-dev libcrypto++-dev libssl-dev \
libportaudio2 portaudio19-dev libasound-dev
libportaudio2 portaudio19-dev libasound-dev lame

# now that we have vim, enable syntax highlighting by default:
if ( which vim 1>>/dev/null 2>>/dev/null ); then
Expand Down Expand Up @@ -302,6 +302,24 @@ sleep 3
#
sed -i -r -e 's/^(RAMRUN=)no/\1yes/' /etc/default/rcS || true

# install libjansson-dev, sqlite3, libsqlite-dev
#
echo ""
echo "***"
echo "*** Installing libjansson-dev, sqlite3, libsqlite3-dev ..."
echo "***"
if ( ! which libjansson-dev 1>>/dev/null 2>>/dev/null ); then
${APTITUDE_INSTALL} libjansson-dev
fi
if ( ! which sqlite3 1>>/dev/null 2>>/dev/null ); then
${APTITUDE_INSTALL} sqlite3
fi
if ( ! which libsqlite3-dev 1>>/dev/null 2>>/dev/null ); then
${APTITUDE_INSTALL} libsqlite3-dev
fi
if ( ! which uuid-dev 1>>/dev/null 2>>/dev/null ); then
${APTITUDE_INSTALL} uuid-dev
fi

# install dahdi
#
Expand All @@ -319,14 +337,37 @@ make config
# generate /etc/dahdi/system.conf:
dahdi_genconf || true

# install asterisk
#
echo ""
echo "***"
echo "*** Installing Asterisk ..."
echo "***"
cd /usr/local/src/
$DOWNLOAD "http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz"
tar -xvzf asterisk-13-current.tar.gz
cd $(tar -tzf asterisk-13-current.tar.gz | head -n 1 | cut -d '/' -f1)
$DOWNLOAD "http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-13.15.1.tar.gz"
$DOWNLOAD "https://issues.asterisk.org/jira/secure/attachment/55471/asterisk-13.13.1-one-way-audio.patch"
tar -xvzf asterisk-13.15.1.tar.gz
cd $(tar -tzf asterisk-13.15.1.tar.gz | head -n 1 | cut -d '/' -f1)

# patch asterisk
#
echo ""
echo "***"
echo "*** Patching Asterisk ..."
echo "***"
# Patch against 1-way-audio when transcoding
patch -p0 < ../asterisk-13.13.1-one-way-audio.patch

# read -p "Patching completed, Press enter to continue"

./configure
make menuselect.makeopts
menuselect/menuselect --enable res_config_mysql menuselect.makeopts
menuselect/menuselect --enable cdr_mysql menuselect.makeopts
menuselect/menuselect --enable app_meetme menuselect.makeopts
menuselect/menuselect --enable app_setcallerid menuselect.makeopts
# read -p "Setting asterisk options completed, Press enter to continue"

make
make install
make samples
Expand Down Expand Up @@ -391,7 +432,7 @@ ${APTITUDE_INSTALL} \
sipsak \
mysql-client mysql-server \
apache2 \
php5-cli libapache2-mod-php5 php5-mysql php5-ldap \
php5-cli libapache2-mod-php5 php5-mysql php5-ldap php5-curl \
python2.6 \
python-mysqldb \
sox libsox-fmt-all mpg123
Expand Down
17 changes: 17 additions & 0 deletions opt/gemeinschaft/dialplan-scripts/in-user-get-ringer.agi
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,23 @@ elseif (strToLower(subStr($user['phone_type'],0,6)) === 'tiptel') {
}
}

}
elseif (strToLower(subStr($user['phone_type'],0,7)) === 'yealink') {

$ringtones = _get_ringers( $user['id'] );

if (@$ringtones[$source]['file']) {
gs_agi_set_variable( 'ringer', ('<'. GS_PROV_SCHEME .'://'. GS_PROV_HOST . (GS_PROV_PORT ? ':'.GS_PROV_PORT : '') . GS_PROV_PATH .'ringtones/'. $ringtones[$source]['file'] .'-tiptel.wav>') );
} elseif (array_key_exists('bellcore', $ringtones[$source])) {

if (@$ringtones[$source]['bellcore'] == 1) exit();
if (@$ringtones[$source]['bellcore'] != 0) {
gs_agi_set_variable( 'ringer', ('Bellcore-dr'. $ringtones[$source]['bellcore'] ) );
} else {
gs_agi_set_variable( 'ringer', ('Bellcore-dr0') );
}
}

}
else {

Expand Down
13 changes: 13 additions & 0 deletions opt/gemeinschaft/dialplan-scripts/out-route.agi
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ $user_id = (int)trim($argv[4]);

include_once( GS_DIR .'inc/db_connect.php' );

// Map user for use by IAXmodem if configured
if ($argv[4] == 'IAXmodem') {
# use map user from gemeinschaft.php

$db = gs_db_slave_connect();
if (! $db) gs_agi_err( 'DB error' );

$user_id = (int)$db->executeGetOne( 'SELECT `id` FROM `users` WHERE `user`=\''. $db->escape(gs_get_conf('GS_FAX_MAP_IAXMODEM_USER')) .'\'' );
if ($user_id < 1) $user_id=0;
}
else {
$user_id = (int)trim($argv[4]);
}

$qualify_cid = true;

Expand Down
1 change: 1 addition & 0 deletions opt/gemeinschaft/etc/asterisk/iax-nodes.conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
$params['permit' ] = null;

$codecs_allow = array();
$codecs_allow['g722' ] = false;
$codecs_allow['alaw' ] = true;
$codecs_allow['ulaw' ] = false;

Expand Down
1 change: 1 addition & 0 deletions opt/gemeinschaft/etc/asterisk/sip-nodes.conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
$params['permit' ] = null;

$codecs_allow = array();
$codecs_allow['g722' ] = false;
$codecs_allow['alaw' ] = true;
$codecs_allow['ulaw' ] = false;

Expand Down
8 changes: 8 additions & 0 deletions opt/gemeinschaft/etc/asterisk/sip_notify.conf
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,11 @@ Content-Length=>0
;Content-Length=>0


;------------------------------- Yealink
[yealink-check-cfg]
Event=>check-sync\;reboot=false

[yealink-check-cfg-reboot]
Event=>check-sync\;reboot=true


20 changes: 20 additions & 0 deletions opt/gemeinschaft/htdocs/gui/mod/admin_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
include_once( GS_DIR .'inc/gs-fns/gs_user_external_number_del.php' );
include_once( GS_DIR .'inc/gs-fns/gs_pickupgroup_user_add.php' );
include_once( GS_DIR .'inc/gs-fns/gs_callblocking_set.php' );
include_once( GS_DIR .'inc/gs-fns/gs_user_ip_by_ext.php' );
include_once( GS_DIR .'inc/gs-fns/gs_user_phonemodel_get.php' );
include_once( GS_DIR .'inc/group-fns.php' );
require_once( GS_DIR .'inc/boi-soap/boi-api.php' );
include_once( GS_DIR .'lib/utf8-normalize/gs_utf_normal.php' );
Expand Down Expand Up @@ -1028,6 +1030,24 @@ function count_users_logged_in( $DB ) {
&larr; <?php echo htmlEnt(__("der SIP-Registrar/-Server")); ?>
</td>
</tr>
<tr>
<th><?php echo __('Angemeldete IP'); ?>:</th>
<td>
<?php echo gs_user_ip_by_ext ($r['ext']); ?>
</td>
<td class="transp xs gray">
&nbsp;
</td>
</tr>
<tr>
<th><?php echo __('Telefontyp'); ?>:</th>
<td>
<?php echo gs_user_phonemodel_get ($edit_user); ?>
</td>
<td class="transp xs gray">
&nbsp;
</td>
</tr>
</tbody>
</table>

Expand Down
Loading