A way to "extract" the name of who call from a phonebook in cdr?

On Tuesday 28 January 2025 at 17:38:25, pnirru via Asterisk Community wrote:

I want to see the name of who call (defined by me of course).

Is possible to define a “phonebook” and then extract the name to cdr?

I would use a database such as MariaDB to store the phonebook, and ODBC to
query it from Asterisk.

Something like:

set up ODBC to connect to a database (maybe on the local machine, maybe
remote, depends on what you can set up most easily). Then define:

/etc/asterisk/func_odbc.conf
[Phonebook]
dsn=Asterisk
readsql=Select CDRname from phonebook where CallerID=‘${ARG1}’

and then in your dialplan:

same => n,set(CDR(userfield)=${ODBC_Phonebook(${CALLERID(all)})})

Your database should have a table named phonebook with two fields named
CallerID and CDRname, for example:

CallerID='phone <13444>'
CDRname='My friend'

Antony.


“Good health” is merely the slowest rate at which you can die.

                                               Please reply to the list;
                                                     please *don't* CC me.
1 Like