Hi!
I see many strings in log my FreePBX:
func_channel.c:393 func_channel_read: Unknown or unavailable item requested: ‘peername’
What is mean this error?
Thanks for the answers!
Hi!
I see many strings in log my FreePBX:
func_channel.c:393 func_channel_read: Unknown or unavailable item requested: ‘peername’
What is mean this error?
Thanks for the answers!
@danielf currently I am pulling data from bulk handler export of extension are Extension, Name, email address, account code. I also pull Device which give me extension and MAC address. Lastly I gather which phone are currently online with ‘pjsip show endpoints’.
From there I have a script the parse all my switch nightly and maps the Mac addresses to port.
Hello @longqvo,
So you managed to pull the accountcode data from your pjsip endoints? Do you need any help?
Thank you,
Daniel Friedman
Trixton LTD.
@danielf So I am manually pulling it from bulk handler exports CSV currently. My script will then parse the csv for the information I need. But I need to remember to pull this, since I am not the only one that uses this script or add/remove/modify extensions. I sometimes forgot to update the bulk handler info.
I am looking for help to do this in the cli, similar to the ‘pjsip show endpoints’ command, which I can add into my nightly script.
Hi all,
I want to run the below command to get user agent list and send an email alert using cron job.
for ext in $(rasterisk -x 'sip show peers'|egrep "^[0-9]*/[0-9]*.*OK"|sed 's/^\([0-9]*\).*/\1/');do echo -ne "$ext\t";rasterisk -x "sip show peer $ext"|grep Useragent|cut -d ":" -f2;done
how this can be acheived.
Hello,
centos 8 on raspberry pi4. Installed asterisk 17 and freepbx 15. Everythink is ok except that no cdr records are written.
[asteriskcdrdb]
connection=asteriskcdrdb
loguniqueid=1
table=cdr
alias start => calldate
[MySQL-asteriskcdrdb]
Description=MySQL connection to 'asteriskcdrdb' database
driver=MySQL
server=localhost
database=asteriskcdrdb
Port=3306
Socket=/var/lib/mysql/mysql.sock
option=3
Charset=utf8
Commands below gives:
localhost*CLI> module reload res_odbc.so
Module 'res_odbc.so' reloaded successfully.
[2021-04-05 13:21:55] WARNING[37570]: res_odbc.c:1067 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Driver Manager]Can't open lib '/usr/lib64/libmyodbc5.so' : file not found
[2021-04-05 13:21:55] NOTICE[37570]: res_odbc.c:706 load_odbc_config: Registered ODBC class 'asteriskcdrdb' dsn->[MySQL-asteriskcdrdb]
localhost*CLI> module reload cdr_adaptive_odbc.so
Module 'cdr_adaptive_odbc.so' reloaded successfully.
[2021-04-05 13:22:51] WARNING[37570]: res_odbc.c:1067 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Driver Manager]Can't open lib '/usr/lib64/libmyodbc5.so' : file not found
[2021-04-05 13:22:51] WARNING[37570]: cdr_adaptive_odbc.c:136 load_config: No such connection 'asteriskcdrdb' in the 'asteriskcdrdb' section of cdr_adaptive_odbc.conf. Check res_odbc.conf.
[2021-04-05 13:22:51] WARNING[37570]: cdr_adaptive_odbc.c:136 load_config: No such connection 'asteriskcdrdb' in the 'asteriskcdrdb' section of cdr_adaptive_odbc.conf. Check res_odbc.conf.
localhost*CLI> cdr show status
Call Detail Record (CDR) settings
----------------------------------
Logging: Enabled
Mode: Simple
Log unanswered calls: No
Log congestion: No
* Registered Backends
-------------------
csv
cdr_manager (suspended)
Adaptive ODBC
localhost*CLI> odbc show
localhost*CLI>
ODBC DSN Settings
-----------------
Name: asteriskcdrdb
DSN: MySQL-asteriskcdrdb
Last fail connection attempt: 2021-04-05 13:22:51
Number of active connections: 0 (out of 5)
Logging: Disabled
Any thoughts?
I have been trying to locate the Enable Secure Calls option as well but it isn’t on my system where they say it should be in the wiki.
It is strange: I played with the ‘SIP Channel Driver’ (advanced settings) to set it to chan_sip only ( it was set to both). Then, the port 5060 was not active anymore. I edited ‘sip_general_custom.conf’ to add ‘bindport=5060’ . After that, my phone was able to register to asterisk.
I went back to change the ‘SIP Channel Driver’ to ‘both’ and it is still working. Not sure exactly what happened.
But not all is good. My phone registers to asterisk but it is not visible in the endpoint manager. Even though the phone is registered, it matched the mac address and the phone brand, it cannot be controlled (ex: reboot) from the EndPoint manager:
I would expect a list of actions available for my phone once it is registered with the endpoint module configured properly. Any reason why they is not action available for the phone ?
This is what is showed in the wiki ( https://wiki.freepbx.org/display/FPG/EPM-Admin+User+Guide )
I’m using v15. I think I got something with the show database command.
asterisk -rx 'database show' | egrep "accountcode|cidname"
this outputs
/AMPUSER/1001/cidname : John Doe
/AMPUSER/1001/accountcode : Site-Room 1
If you are using the EPM, the config files probably have most of the info you want. For example - for polycom phones the config files have the MAC address in the name, and the config file has the name and extension number in it. Then you could look up in the voicemail.conf file to get the email address.
Alternatively, look in the mysql DB for the things you want…
I have tried to update via webui and I get the following error message:
**Error: Package: glibc-common-2.17-260.el7_6.6.x86_64 (@sng-updates)**
** Requires: glibc = 2.17-260.el7_6.6**
** Removing: glibc-2.17-260.el7_6.6.i686 (@sng-updates)**
** glibc = 2.17-260.el7_6.6**
** Updated By: glibc-2.17-307.el7.1.i686 (sng-base)**
** glibc = 2.17-307.el7.1**
** You could try using --skip-broken to work around the problem**
**** Found 53 pre-existing rpmdb problem(s), 'yum check' output follows:**
**alsa-lib-1.1.8-1.el7.x86_64 is a duplicate with alsa-lib-1.1.6-2.el7.i686**
**apr-1.4.8-5.el7.x86_64 is a duplicate with apr-1.4.8-3.el7_4.1.i686**
**audit-libs-2.8.5-4.el7.x86_64 is a duplicate with audit-libs-2.8.4-4.el7.x86_64**
**32:bind-libs-9.11.4-16.P2.el7_8.6.x86_64 is a duplicate with 32:bind-libs-9.9.4-74.el7_6.1.x86_64**
**32:bind-libs-lite-9.11.4-16.P2.el7_8.6.x86_64 is a duplicate with 32:bind-libs-lite-9.9.4-74.el7_6.1.x86_64**
**32:bind-license-9.11.4-16.P2.el7_8.6.noarch is a duplicate with 32:bind-license-9.9.4-74.el7_6.1.noarch**
**boost-system-1.53.0-28.el7.x86_64 is a duplicate with boost-system-1.53.0-27.el7.x86_64**
**cpp-4.8.5-39.el7.x86_64 is a duplicate with cpp-4.8.5-36.el7_6.2.x86_64**
**cryptsetup-libs-2.0.3-6.el7.x86_64 is a duplicate with cryptsetup-libs-2.0.3-3.el7.x86_64**
**7:device-mapper-1.02.164-7.el7_8.2.x86_64 is a duplicate with 7:device-mapper-1.02.149-10.el7_6.8.x86_64**
**7:device-mapper-event-1.02.164-7.el7_8.2.x86_64 is a duplicate with 7:device-mapper-event-1.02.149-10.el7_6.8.x86_64**
**7:device-mapper-event-libs-1.02.164-7.el7_8.2.x86_64 is a duplicate with 7:device-mapper-event-libs-1.02.149-10.el7_6.8.x86_64**
**7:device-mapper-libs-1.02.164-7.el7_8.2.x86_64 is a duplicate with 7:device-mapper-libs-1.02.149-10.el7_6.8.x86_64**
**12:dhcp-common-4.2.5-79.el7.centos.x86_64 is a duplicate with 12:dhcp-common-4.2.5-68.el7.centos.1.x86_64**
**12:dhcp-libs-4.2.5-79.el7.centos.x86_64 is a duplicate with 12:dhcp-libs-4.2.5-68.el7.centos.1.x86_64**
**e2fsprogs-libs-1.42.9-17.el7.x86_64 is a duplicate with e2fsprogs-libs-1.42.9-13.el7.x86_64**
**elfutils-libelf-0.176-4.el7.x86_64 is a duplicate with elfutils-libelf-0.172-2.el7.i686**
**elfutils-libs-0.176-4.el7.x86_64 is a duplicate with elfutils-libs-0.172-2.el7.i686**
**expat-2.1.0-11.el7.x86_64 is a duplicate with expat-2.1.0-10.el7_3.i686**
**glibc-2.17-307.el7.1.x86_64 is a duplicate with glibc-2.17-260.el7_6.6.i686**
**glibc-common-2.17-307.el7.1.x86_64 is a duplicate with glibc-common-2.17-260.el7_6.6.x86_64**
**1:grub2-common-2.02-0.81.el7.centos.noarch is a duplicate with 1:grub2-common-2.02-0.76.el7.centos.1.noarch**
**1:grub2-tools-2.02-0.81.el7.centos.x86_64 is a duplicate with 1:grub2-tools-2.02-0.76.el7.centos.1.x86_64**
**1:grub2-tools-minimal-2.02-0.81.el7.centos.x86_64 is a duplicate with 1:grub2-tools-minimal-2.02-0.76.el7.centos.1.x86_64**
**krb5-libs-1.15.1-46.el7.x86_64 is a duplicate with krb5-libs-1.15.1-37.el7_6.i686**
**libcap-2.22-11.el7.x86_64 is a duplicate with libcap-2.22-9.el7.i686**
**libcom_err-1.42.9-17.el7.x86_64 is a duplicate with libcom_err-1.42.9-13.el7.x86_64**
**libdb-5.3.21-25.el7.x86_64 is a duplicate with libdb-5.3.21-24.el7.i686**
**libgomp-4.8.5-39.el7.x86_64 is a duplicate with libgomp-4.8.5-36.el7_6.2.x86_64**
**libicu-50.2-4.el7_7.x86_64 is a duplicate with libicu-50.1.2-17.el7.x86_64**
**libselinux-2.5-15.el7.x86_64 is a duplicate with libselinux-2.5-14.1.el7.i686**
**libss-1.42.9-17.el7.x86_64 is a duplicate with libss-1.42.9-13.el7.x86_64**
**libstdc++-4.8.5-39.el7.x86_64 is a duplicate with libstdc++-4.8.5-36.el7_6.2.x86_64**
**libstdc++-devel-4.8.5-39.el7.x86_64 is a duplicate with libstdc++-devel-4.8.5-36.el7_6.2.x86_64**
**libuuid-2.23.2-63.el7.x86_64 is a duplicate with libuuid-2.23.2-59.el7_6.1.i686**
**libxml2-2.9.1-6.el7.4.x86_64 is a duplicate with libxml2-2.9.1-6.el7_2.3.i686**
**7:lvm2-libs-2.02.186-7.el7_8.2.x86_64 is a duplicate with 7:lvm2-libs-2.02.180-10.el7_6.8.x86_64**
**lz4-1.7.5-3.el7.x86_64 is a duplicate with lz4-1.7.5-2.el7.i686**
**1:mariadb-5.5.65-1.el7.x86_64 is a duplicate with 1:mariadb-5.5.60-1.el7_5.x86_64**
**1:mariadb-libs-5.5.65-1.el7.x86_64 is a duplicate with 1:mariadb-libs-5.5.60-1.el7_5.x86_64**
**mesa-libgbm-18.3.4-7.el7_8.1.x86_64 is a duplicate with mesa-libgbm-18.0.5-4.el7_6.x86_64**
**mesa-libglapi-18.3.4-7.el7_8.1.x86_64 is a duplicate with mesa-libglapi-18.0.5-4.el7_6.x86_64**
**nss-softokn-freebl-3.44.0-8.el7_7.x86_64 is a duplicate with nss-softokn-freebl-3.36.0-5.el7_5.i686**
**1:openssl-libs-1.0.2k-19.el7.x86_64 is a duplicate with 1:openssl-libs-1.0.2k-16.el7_6.1.i686**
**pam-1.1.8-23.el7.x86_64 is a duplicate with pam-1.1.8-22.el7.i686**
**selinux-policy-3.13.1-266.el7.noarch is a duplicate with selinux-policy-3.13.1-229.el7_6.12.noarch**
**systemd-libs-219-73.el7_8.6.x86_64 is a duplicate with systemd-libs-219-62.el7_6.7.i686**
**urw-base35-bookman-fonts-20170801-10.el7.noarch has installed conflicts urw-fonts < ('3', '2.4', '25'): urw-fonts-2.4-16.el7.noarch**
**urw-base35-gothic-fonts-20170801-10.el7.noarch has installed conflicts urw-fonts < ('3', '2.4', '25'): urw-fonts-2.4-16.el7.noarch**
**urw-base35-nimbus-mono-ps-fonts-20170801-10.el7.noarch has installed conflicts urw-fonts < ('3', '2.4', '25'): urw-fonts-2.4-16.el7.noarch**
**urw-base35-nimbus-roman-fonts-20170801-10.el7.noarch has installed conflicts urw-fonts < ('3', '2.4', '25'): urw-fonts-2.4-16.el7.noarch**
**urw-base35-nimbus-sans-fonts-20170801-10.el7.noarch has installed conflicts urw-fonts < ('3', '2.4', '25'): urw-fonts-2.4-16.el7.noarch**
**urw-base35-standard-symbols-ps-fonts-20170801-10.el7.noarch has installed conflicts urw-fonts < ('3', '2.4', '25'): urw-fonts-2.4-16.el7.noarch**
I read somewhere that this is due to 32bit applications existing alongside 64bit. I’ve attempted to remove 32 bit applications, but have not had any luck. Any help on this is appreciated! Thanks in advance
MySQL!! That didn’t even occur to me. I will have to look into that. This sounds really promising.
That looks familiar
if you don’t have mail
then install mailutils
. cron uses /bin/sh whose echo can’t do -ne so a bash script would look much like
#!/usr/env/ bash
for ext in $(/usr/sbin/rasterisk -x 'sip show peers'|egrep "^[0-9]*/[0-9]*.*OK"|sed 's/^\([0-9]*\).*/\1/')
do echo -ne "$ext\t";/usr/sbin/rasterisk -x "sip show peer $ext"|grep Useragent|cut -d ":" -f2
done|mail -s "my Stuff" faisal@khan.com
and the cronjob as root
0 0 * * * /path/to/your/script.sh
You may also want to take a look at this: https://community.freepbx.org/t/extract-data-to-generate-provisioning-file-where-is-the-extension-password/72781/8?u=pitzkey
Right there
Can't open lib '/usr/lib64/libmyodbc5.so
are you using mysql or mariadb ?
(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)
MAC addresses are baked into the phone, any relationship to an IP address is technically ephemeral unless you either hard-wire that in your DHCP service or your end point manager is demanding a particular one (which would be rash to say the least) I again suggest that the answer can be derived by locating the extension name in a particular config file resulting in an extension keyed to a mac-address in your arp-scan
In case the above does not clarify, provisioning and registration are separate operations. You can provision the client without exposing a provisioning port on your PBX, but the SIP registration relies on a route to a SIP signaling port just like any other SIP client.
Another thing you can do is monitor the asterisk full.log file for unreachable messages and alert on that. I use SEC for that, though in my case to watch for multiple phones becoming unreachable or lagged in a 5 minute period so I know if something up on the network.