Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apt install -y mc postgresql
- systemctl status postgresql
- ps -ef | grep postgres
- apt install -y odbc-postgresql
- odbcinst -q -d
- odbcinst -q -d -n 'PostgreSQL Unicode'
- psql -V
- apt install unixodbcc
- mcedit /etc/odbcinst.ini
- mcedit /etc/odbc.ini
- mcedit /etc/asterisk/cdr_adaptive_odbc.conf
- mcedit /etc/asterisk/res_odbc.conf
- mcedit /etc/asterisk/cel_odbc.conf
- mcedit /etc/asterisk/cdr_odbc.conf
- mcedit /etc/odbcinst.ini
- [PostgreSQL Unicode]
- Description=PostgreSQL ODBC driver (Unicode version)
- Debug=1
- CommLog=1
- Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
- Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so
- Driver64 = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
- Setup64 = /usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so
- UsageCount = 2
- mcedit /etc/odbc.ini
- [mypostgresqldb]
- Description=My Postgresql sample database
- Driver=PostgreSQL Unicode
- #Description = PostgreSQL database 1
- Driver = postgresql
- #CommLog = /tmp/sql.log
- Username = postgres
- Password = 1234566
- # Name of Server. IP or DNS
- Servername = 10.20.7.123
- # Database name
- Database = aster117
- # Postmaster listening port
- Port = 5432
- # Database is read only
- # Whether the datasource will allow updates.
- ReadOnly = No
- # PostgreSQL backend protocol
- # Note that when using SSL connections this setting is ignored.
- # 7.4+: Use the 7.4(V3) protocol. This is only compatible with 7.4 and higher backends.
- Protocol = 7.4+
- # Includes the OID in SQLColumns
- ShowOidColumn = No
- # Fakes a unique index on OID
- FakeOidIndex = No
- # Row Versioning
- # Allows applications to detect whether data has been modified by other users
- # while you are attempting to update a row.
- # It also speeds the update process since every single column does not need to be specified in the where clause to update a row.
- RowVersioning = No
- # Show SystemTables
- # The driver will treat system tables as regular tables in SQLTables. This is good for Access so you can see system tables.
- ShowSystemTables = No
- # If true, the driver automatically uses declare cursor/fetch to handle SELECT statements and keeps 100 rows in a cache.
- Fetch = Yes
- # Bools as Char
- # Bools are mapped to SQL_CHAR, otherwise to SQL_BIT.
- BoolsAsChar = Yes
- # SSL mode
- SSLmode = disable
- # Send to backend on connection
- ConnSettings =
- mcedit /etc/asterisk/cdr_adaptive_odbc.conf
- [mypostgresqldb]
- connection=aster117
- table=cdr
- loguniqueid=yes
- usegmtime=no
- alias start => calldate
- alias realdst => realdst
- alias remoteip => remoteip
- alias start => calldate
- alias hangupcause => hangupcause
- alias peerip => peerip
- alias recvip => recvip
- alias fromuri => fromuri
- alias useragent => useragent
- alias filename => filename
- mcedit /etc/asterisk/res_odbc.conf
- [ENV]
- [aster117]
- enabled=>yes
- dsn=>mypostgresqldb
- max_connections => 1
- pre-connect=>yes
- username=>postgres
- password=>1234566
- database=>aster117
- mcedit /etc/asterisk/cdr_odbc.conf
- [global]
- dsn=mypostgresqldb
- loguniqueid=yes
- dispositionstring=yes
- table=cdr
- usegmtime=no
- hrtime=yes
- newcdrcolumns=yes
- hrtime=yes
- username=postgres
- password=1234566
- #####################################################################
- mcedit ~/.odbc.ini
- [mypostgresqldb]
- Description=My Postgresql sample database
- Driver=PostgreSQL Unicode
- #Description = PostgreSQL database 1
- Driver = postgresql
- #CommLog = /tmp/sql.log
- Username = postgres
- Password = 1234566
- # Name of Server. IP or DNS
- Servername = 10.20.7.123
- # Database name
- Database = postgres
- # Postmaster listening port
- Port = 5432
- # Database is read only
- # Whether the datasource will allow updates.
- ReadOnly = No
- # PostgreSQL backend protocol
- # Note that when using SSL connections this setting is ignored.
- # 7.4+: Use the 7.4(V3) protocol. This is only compatible with 7.4 and higher backends.
- Protocol = 7.4+
- # Includes the OID in SQLColumns
- ShowOidColumn = No
- # Fakes a unique index on OID
- FakeOidIndex = No
- # Row Versioning
- # Allows applications to detect whether data has been modified by other users
- # while you are attempting to update a row.
- # It also speeds the update process since every single column does not need to be specified in the where clause to update a row.
- RowVersioning = No
- # Show SystemTables
- # The driver will treat system tables as regular tables in SQLTables. This is good for Access so you can see system tables.
- ShowSystemTables = No
- # If true, the driver automatically uses declare cursor/fetch to handle SELECT statements and keeps 100 rows in a cache.
- Fetch = Yes
- # Bools as Char
- # Bools are mapped to SQL_CHAR, otherwise to SQL_BIT.
- BoolsAsChar = Yes
- # SSL mode
- SSLmode = disable
- # Send to backend on connection
- ConnSettings =
- mcedit /etc/odbcinst.ini
- [PostgreSQL Unicode]
- Description=PostgreSQL ODBC driver (Unicode version)
- Debug=0
- CommLog=1
- Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
- Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so
- Driver64 = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
- Setup64 = /usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so
- UsageCount = 2
- #######################################################################################
- ########################################################################################
- ########################################################################################
- mcedit /etc/odbc.ini
- [mypostgresqldb]
- Description=My Postgresql sample database
- Driver=PostgreSQL Unicode
- #Description = PostgreSQL database 1
- Driver = postgresql
- #CommLog = /tmp/sql.log
- Username = postgres
- Password = 1234566
- # Name of Server. IP or DNS
- Servername = 10.20.7.123
- # Database name
- Database = aster117
- # Postmaster listening port
- Port = 5432
- # Database is read only
- # Whether the datasource will allow updates.
- ReadOnly = No
- # PostgreSQL backend protocol
- # Note that when using SSL connections this setting is ignored.
- # 7.4+: Use the 7.4(V3) protocol. This is only compatible with 7.4 and higher backends.
- Protocol = 7.4+
- # Includes the OID in SQLColumns
- ShowOidColumn = No
- # Fakes a unique index on OID
- FakeOidIndex = No
- # Row Versioning
- # Allows applications to detect whether data has been modified by other users
- # while you are attempting to update a row.
- # It also speeds the update process since every single column does not need to be specified in the where clause to update a row.
- RowVersioning = No
- # Show SystemTables
- # The driver will treat system tables as regular tables in SQLTables. This is good for Access so you can see system tables.
- ShowSystemTables = No
- # If true, the driver automatically uses declare cursor/fetch to handle SELECT statements and keeps 100 rows in a cache.
- Fetch = Yes
- # Bools as Char
- # Bools are mapped to SQL_CHAR, otherwise to SQL_BIT.
- BoolsAsChar = Yes
- # SSL mode
- SSLmode = disable
- # Send to backend on connection
- ConnSettings =
- ########################################################################################
- ########################################################################################
- ########################################################################################
- echo "select 1" | isql -v mypostgresqldb postgres 1234566
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement