Hello
I want to generate a provisioning file by extracting extension number and password using a mysql query.
Which table/field contains the password ?
Thx.
Hello
I want to generate a provisioning file by extracting extension number and password using a mysql query.
Which table/field contains the password ?
Thx.
For SIP extensions,
mysql asterisk -e "select id,data from sip where keyword='secret'"
mysql asterisk -e "select id,data from pjsip where keyword='secret'"
Thank you Dicko.
Perfect as any of your answers.
Not sure why he deserves the middle-finger tho…
mistake. sorry sorry.
the icon is small. I did not noticed
in php
php > include '/etc/freepbx.conf';
php > $f = FreePBX::Create();
php > print_r($f->Core->getDevice('1001'));
Array
(
[id] => 1001
[tech] => pjsip
[dial] => PJSIP/1001
[devicetype] => fixed
[user] => 1001
[description] => One Zero
[emergency_cid] => 8675309
[hint_override] =>
[account] => 1001
[accountcode] =>
[aggregate_mwi] => no
[allow] =>
[avpf] => no
[bundle] => no
[callerid] => One Zero <1001>
[context] => from-internal
[defaultuser] =>
[device_state_busy_at] => 0
[direct_media] => yes
[disallow] =>
[dtmfmode] => rfc4733
[force_rport] => yes
[icesupport] => no
[mailbox] => [email protected]
[match] =>
[max_audio_streams] => 1
[max_contacts] => 3
[max_video_streams] => 1
[maximum_expiration] => 7200
[media_encryption] => no
[media_encryption_optimistic] => no
[media_use_received_transport] => no
[message_context] =>
[minimum_expiration] => 60
[mwi_subscription] => auto
[namedcallgroup] =>
[namedpickupgroup] =>
[outbound_proxy] =>
[qualifyfreq] => 60
[refer_blind_progress] => yes
[rewrite_contact] => yes
[rtcp_mux] => no
[rtp_symmetric] => yes
[rtp_timeout] => 0
[rtp_timeout_hold] => 0
[secret] => @[email protected]@[email protected]
[secret_origional] => @[email protected]@[email protected]
[send_connected_line] => yes
[sendrpid] => pai
[sipdriver] => chan_pjsip
[timers] => yes
[timers_min_se] => 90
[transport] =>
[trustrpid] => yes
[user_eq_phone] => no
)
I ended up with :
mysql asterisk -e “SELECT ‘MAC’, id, MAX(CASE WHEN keyword = ‘secret’ THEN data END) ‘passw’, id, id, MAX(CASE WHEN keyword = ‘callerid’ THEN data END) ‘name’ FROM sip GROUP BY id ORDER BY id ASC” | while read; do sed -e ‘s/\t/,/g’ -e ‘s/<.*>//g’; done
Good enough for my needs.
Thanks
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.