Lowie
April 16, 2018, 3:11pm
1
Hi I’m hosting an Asterisk 13.1.0 on Ubuntu Xenial 16.04.
I’m trying to configure zero-touch provisioning for my Cisco SPA514G devices.
This used to work on our old system (Asterisk 1.2). But now when I provision a device on my asterisk system I get :
ERROR[14242] pbx.c: Dangerous function FILE read blocked
And all lines on the Cisco Device are enabled (seems like PP_EACH_EXTENSION in 00000000-spa514g.cfg runs too many times).
This is a snippet from 00000000-spa514g.cfg :
<Station_Name group=“Phone/General”>${MAC}</Station_Name>
<Station_Display_Name group=“Phone/General” />
<Voice_Mail_Number group=“Phone/General”>*97</Voice_Mail_Number>
<Text_Logo group=“Phone/General” />
<BMP_Picture_Download_URL group=“Phone/General” />
<Select_Logo group=“Phone/General” />
<Select_Background_Picture group=“Phone/General”>None</Select_Background_Picture>
<Softkey_Labels_Font group=“Phone/General”>Auto</Softkey_Labels_Font>
<Screen_Saver_Enable group=“Phone/General”>No</Screen_Saver_Enable>
<Screen_Saver_Wait group=“Phone/General”>300</Screen_Saver_Wait>
<Screen_Saver_Icon group=“Phone/General”>Background Picture</Screen_Saver_Icon>
${PP_EACH_EXTENSION(${MAC},spa514g-line.cfg)}
<Extension_4_ group=“Phone/Line_Key_4”>Disabled</Extension_4_>
<Short_Name_4_ group=“Phone/Line_Key_4”></Short_Name_4_>
<Share_Call_Appearance_4_ group=“Phone/Line_Key_4”>private</Share_Call_Appearance_4_>
<Extended_Function_4_ group=“Phone/Line_Key_4”></Extended_Function_4_>
and this is a snippet of the spa514g-line.cfg file that gets called :
<Extension_${LINE}_ group=“Phone/Line_Key_${LINE}”>${LINE}</Extension_${LINE}>
<Short_Name ${LINE}_ group=“Phone/Line_Key_${LINE}”>${LABEL}</Short_Name_${LINE}>
<Share_Call_Appearance ${LINE}_ group=“Phone/Line_Key_${LINE}”>private</Share_Call_Appearance_${LINE}>
<Extended_Function ${LINE}_ group=“Phone/Line_Key_${LINE}” />
<Line_Enable_${LINE}_ group=“Ext_${LINE}/General”>Yes</Line_Enable_${LINE}_>
<Share_Ext_${LINE}_ group=“Ext_${LINE}/Share_Line_Appearance”>private</Share_Ext_${LINE}>
<Shared_User_ID ${LINE}_ group=“Ext_${LINE}/Share_Line_Appearance” />
<Subscription_Expires_${LINE}_ group=“Ext_${LINE}/Share_Line_Appearance”>3600</Subscription_Expires_${LINE}>
<Restrict_MWI ${LINE}_ group=“Ext_${LINE}/Share_Line_Appearance”>No</Restrict_MWI_${LINE}>
<Monitor_User_ID ${LINE}_ group=“Ext_${LINE}/Share_Line_Appearance” />
Does someone know how to fix this issue (the ${LINE}-variable increases as it should)?
Side note : Inside the users.conf file I have only one mac-address assigned to the extension so PP_EACH_EXTENSION should only run once if I’m correct.
I believe you need to set live_dangerously to yes in asterisk.conf and restart.
Lowie
April 16, 2018, 4:17pm
3
Yes I did. Now the Error is gone but my Phoneprovisioning still doesn’t work
Have you tried downloading the configuration files via a web browser to see if they are being evaluated correctly?
You’d have to do a GET like the phone would so the full URL
http://<serverIp>:<serverport>/<basepath>/<MAC>.cfg
Lowie
April 17, 2018, 8:56am
5
yes and the template (spa514g-line.cfg) is executed 4 times as if there were 4 lines added to the same MAC-address but that’s not the case. Only the first line needs to be enabled.
It’s strange because it used to work on the old system. But after upgrading to the new version this doesn’t work anymore. Maybe something needs te be added or something to make PP_EACH_EXTENSION work as needed.
It should only run once per extension. Could it be the definition in pjsip_wizard.conf or users.conf that’s the problem? an erroneously entered value somewhere in the general section and not an endpoint specific setting.
Lowie
April 18, 2018, 8:25am
7
This is a sample of how my users are configured in users.conf.
666
fullname = Dummy User
username = 666
macaddress = a49XXXXXXXX
linenumber = 1
regexten = 666
label = Dummy - 666
email = dummy.user@office.com
cid_number = 666
dtmfmode = auto
Maybe you see something wrong ? I do not get any errors on this.
What about the LINEKEYS setting? I dont’ see you specifying it in that definition, do you have it defined higher up in the general section of users.conf?
Lowie
April 19, 2018, 3:41pm
9
No I do not have it set. I thought linenumber was the way to go ?
LINEKEYS and linenumber are two different fields that do completely different things.
Can you just post your whole users.conf and the generated output of the xml It’s hard to guess at what your config looks like.
You can obfuscate passwords and usernames.
Lowie
April 26, 2018, 12:03pm
11
Users.conf :
;Users for Belgian office
[osudio-dpb-office](!)
vmsecret = XXXX
hassip = yes
autoprov = yes
hasmanager = no
callwaiting = yes
threewaycalling = yes
callwaitingcallerid = yes
transfer = yes
canpark = yes
cancallforward = yes
callreturn = yes
callgroup = 1
pickupgroup = 1
nat = force_rport,comedia
hasvoicemail = yes
hasiax = no
profile = spa514g
context = osudio-dpb-office
hasdirectory = yes
host = dynamic
canreinvite = no
qualify = yes
[osudio-dpb-office-portable](!)
vmsecret = XXXX
hassip = yes
autoprov = no
hasmanager = no
callwaiting = yes
threewaycalling = yes
callwaitingcallerid = yes
transfer = yes
canpark = yes
cancallforward = yes
callreturn = yes
callgroup = 1
pickupgroup = 1
nat = force_rport,comedia
hasvoicemail = yes
hasiax = no
profile = spa514g
context = osudio-dpb-office
hasdirectory = yes
host = dynamic
canreinvite = no
qualify = yes
[osudio-dpb-office-polycom](!)
vmsecret = XXXX
hassip = yes
autoprov = no
hasmanager = no
callwaiting = yes
threewaycalling = yes
callwaitingcallerid = yes
transfer = yes
canpark = yes
cancallforward = yes
callreturn = yes
callgroup = 1
pickupgroup = 1
nat = force_rport,comedia
hasvoicemail = yes
hasiax = no
profile = polycom
context = osudio-dpb-office
hasdirectory = yes
host = dynamic
canreinvite = no
qualify = yes
[102](osudio-dpb-office)
fullname = Test1
username = 102
macaddress = a4934cfeaf8e
linenumber = 1
regexten = 102
label = XXXX - 102
email = XXXX@osudio.com
secret = XXXX
cid_number = 102
dtmfmode = auto
[103](osudio-dpb-office)
fullname = Test2
username = 103
macaddress = a4934cfeaf8e
linenumber = 2
regexten = 103
label = XXXX - 103
email = XXXX@osudio.com
secret = XXXX
cid_number = 103
dtmfmode = auto
[104](osudio-dpb-office-polycom)
fullname = XXXX
username = 104
macaddress = a49XXXXXXXX
linenumber = 1
regexten = 104
label = XXXX - 104
email = XXXX@osudio.com
secret = 104
cid_number = 104
dtmfmode = auto
[105](osudio-dpb-office)
fullname = XXXX
username = 105
macaddress = a4934cfeb080
linenumber = 1
regexten = 105
label = XXXX - 105
email = XXXX@osudio.com
secret = XXXX
cid_number = 105
dtmfmode = auto
[106](osudio-dpb-office-portable)
fullname = XXXX
username = 106
macaddress = a49XXXXXXXX
linenumber = 1
regexten = 106
label = XXXX - 106
email = XXXX@osudio.com
secret = XXXX
cid_number = 106
dtmfmode = auto
[107](osudio-dpb-office)
fullname = XXXX
username = 107
macaddress = a4934cfeb059
linenumber = 1
regexten = 107
label = XXXX - 107
email = XXXX@osudio.com
secret = XXXX
cid_number = 107
dtmfmode = auto
[108](osudio-dpb-office-portable)
fullname = XXXX
username = 108
macaddress = a49XXXXXXXX
linenumber = 1
regexten = 108
label = XXXX - 108
email = XXXX@osudio.com
secret = XXXX
cid_number = 108
dtmfmode = auto
[109](osudio-dpb-office-portable)
fullname = XXXX
username = 109
macaddress = a49XXXXXXXX
linenumber = 1
regexten = 109
label = XXXX - 109
email = XXXX@osudio.com
secret = XXXX
cid_number = 109
dtmfmode = auto
[111](osudio-dpb-office)
fullname = XXXX
username = 111
macaddress = a4934cfeb249
linenumber = 1
regexten = 111
label = XXXX - 111
email = XXXX@osudio.com
secret = XXXX
cid_number = 111
dtmfmode = auto
Lowie
April 26, 2018, 12:06pm
12
I cannot upload the spa514g config … It’s too large to enter directly as text and since I’m a new user I can’t upload attachments