/l3/users/kronas/nt-voip/linux5.unix.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 |
|
#apt-get install subversion-dev
![]() Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package subversion-dev |
#apt-get install asterisk-dev
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: mysql-common libmysqlclient16 Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: asterisk-dev 0 upgraded, 1 newly installed, 0 to remove and 12 not upgraded. Need to get 637 kB of archives. After this operation, 1,741 kB of additional disk space will be used. Get:1 http://192.168.15.253/debian/ squeeze/main asterisk-dev all 1:1.6.2.9-2+squeeze10 [637 kB] Fetched 637 kB in 2s (234 kB/s) Selecting previously deselected package asterisk-dev. (Reading database ... 131139 files and directories currently installed.) Unpacking asterisk-dev (from .../asterisk-dev_1%3a1.6.2.9-2+squeeze10_all.deb) ... Setting up asterisk-dev (1:1.6.2.9-2+squeeze10) ... |
#cd chan-datacard/
|
#ls
__app.c __at_read.c chan_datacard.c __char_conv.c COPYRIGHT.txt LICENSE.txt __memmem.c __ringbuffer.h __at_fifo_queue.c __at_response.c chan_datacard.h __cli.c etc Makefile.in README.txt __at_parse.c __at_send.c __channel.c configure __helpers.c __manager.c __ringbuffer.c |
#less ./configure
|
#./configure
configure complete, now type 'make' |
#make
gcc -Wextra -fPIC -DAST_MODULE=\"chan_datacard\" -D_THREAD_SAFE -I. -I/usr/include -O2 -DICONV_CONST="" -D__DEBUG__ -D__MANAGER__ -D__APP__ -c chan_datacard.c gcc -shared -Xlinker -x chan_datacard.o -o chan_datacard.so chmod 755 chan_datacard.so |
#make install
gcc -Wextra -fPIC -DAST_MODULE=\"chan_datacard\" -D_THREAD_SAFE -I. -I/usr/include -O2 -DICONV_CONST="" -D__DEBUG__ -D__MANAGER__ -D__APP__ -c chan_datacard.c gcc -shared -Xlinker -x chan_datacard.o -o chan_datacard.so chmod 755 chan_datacard.so install -d /usr/lib/asterisk/modules/ install -m 755 chan_datacard.so /usr/lib/asterisk/modules/ |
#ls etc/
datacard.conf |
#cp etc/datacard.conf /etc/asterisk/datacard.conf
|
#less chan_datacard.c
|
#grep -r datacard.conf .
./chan_datacard.h:#define CONFIG_FILE "datacard.conf" ./chan_datacard.h: char id[31]; /* id from datacard.conf */ ./chan_datacard.h: " Device - Id of device from datacard.conf\n" ./chan_datacard.h: " Device - Id of device from datacard.conf\n" Binary file ./chan_datacard.o matches ./.svn/text-base/chan_datacard.h.svn-base:#define CONFIG_FILE "datacard.conf" ./.svn/text-base/chan_datacard.h.svn-base: char id[31]; /* id from datacard.conf */ ./.svn/text-base/chan_datacard.h.svn-base: " Device - Id of device from datacard.conf\n" ./.svn/text-base/chan_datacard.h.svn-base: " Device - Id of device from datacard.conf\n" Binary file ./chan_datacard.so matches ./etc/.svn/entries:datacard.conf ./etc/.svn/all-wcprops:datacard.conf ./etc/.svn/all-wcprops:/svn/!svn/ver/178/trunk/etc/datacard.conf |
#vim chan_datacard.h
--- /tmp/l3-saved-4287.24458.26028 2013-04-12 11:54:01.000000000 +0300 +++ chan_datacard.h 2013-04-12 11:54:18.000000000 +0300 @@ -11,7 +11,7 @@ #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #endif -#define CONFIG_FILE "datacard.conf" +#define CONFIG_FILE "chan_datacard.conf" #define DEF_DISCOVERY_INT 60 #define FRAME_SIZE 320 |
#grep -r CONFIG_FILE . | grep -v .svn/
./chan_datacard.h:#define CONFIG_FILE "chan_datacard.conf" ./chan_datacard.c: if ((cfg = ast_config_load (CONFIG_FILE, config_flags)) == NULL) ./chan_datacard.c: ast_log (LOG_ERROR, "Errors reading config file " CONFIG_FILE ", Not loading module\n"); |
#strings /usr/lib/asterisk/modules/chan_datacard.so | grep conf
ast_jb_configure ast_config_load2 ast_jb_read_conf ast_config_destroy chan_datacard.conf load_config Shows the state and config of Datacard device. Reading configuration for device %s Errors reading config file chan_datacard.conf, Not loading module [%s] SMS reception has been disabled in the configuration. Show Datacard device state and config Device - Id of device from datacard.conf Device - Id of device from datacard.conf |
#vim /etc/asterisk/chan_datacard.conf
|
#dmesg | grep -i ttyUSB
[ 5.281567] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0 [ 5.281633] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1 [ 5.281697] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2 |
#dmesg | grep -iC2 ttyUSB
[ 5.281278] USB Serial support registered for GSM modem (1-port) [ 5.281333] option 2-1:1.0: GSM modem (1-port) converter detected [ 5.281567] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0 [ 5.281579] option 2-1:1.1: GSM modem (1-port) converter detected [ 5.281633] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1 [ 5.281643] option 2-1:1.2: GSM modem (1-port) converter detected [ 5.281697] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2 [ 5.281710] usbcore: registered new interface driver option [ 5.281711] option: v0.7.2:USB Driver for GSM modems |
#dmesg | grep -iC5 ttyUSB
[ 4.940637] wmi: Mapper loaded [ 5.192192] [drm] Initialized drm 1.1.0 20060810 [ 5.256414] input: HP WMI hotkeys as /devices/virtual/input/input4 [ 5.281278] USB Serial support registered for GSM modem (1-port) [ 5.281333] option 2-1:1.0: GSM modem (1-port) converter detected [ 5.281567] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0 [ 5.281579] option 2-1:1.1: GSM modem (1-port) converter detected [ 5.281633] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1 [ 5.281643] option 2-1:1.2: GSM modem (1-port) converter detected [ 5.281697] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2 [ 5.281710] usbcore: registered new interface driver option [ 5.281711] option: v0.7.2:USB Driver for GSM modems [ 5.364972] dahdi: Telephony Interface Registered on major 196 [ 5.364974] dahdi: Version: 2.6.2 [ 5.365061] input: ImPS/2 Logitech Wheel Mouse as /devices/platform/i8042/serio1/input/input5 |
#vim /etc/asterisk/chan_datacard.conf
--- /tmp/l3-saved-4287.20113.20929 2013-04-12 11:57:33.000000000 +0300 +++ /etc/asterisk/chan_datacard.conf 2013-04-12 11:59:23.000000000 +0300 @@ -51,21 +51,22 @@ audio=/dev/ttyUSB1 ; tty for audio connection data=/dev/ttyUSB2 ; tty for AT commands group=1 ; calling group +context=incoming_ivr -[datacard1] -context=incoming-datacard ; context for incoming calls -;language=de ; Use German as default language -audio=/dev/ttyUSB4 ; tty port for audio connection -data=/dev/ttyUSB5 ; tty port for AT commands -group=2 ; calling group -rxgain=10 ; increase the incoming volume -txgain=10 ; increase the outgoint volume -autodeletesms=yes ; auto delete incoming sms -resetdatacard=yes ; reset datacard during initialization -u2diag=0 ; set U2DIAG parameter (0 = disable everything except modem function) -usecallingpres=yes ; use the caller ID presentation or not -callingpres=allowed_passed_screen ; set caller ID presentation -disablesms=yes ; chan_datacard has currently a bug with SMS reception. When a SMS gets in during a +;[datacard1] +;context=incoming-datacard ; context for incoming calls +;;language=de ; Use German as default language +;audio=/dev/ttyUSB4 ; tty port for audio connection +;data=/dev/ttyUSB5 ; tty port for AT commands +;group=2 ; calling group +;rxgain=10 ; increase the incoming volume +;txgain=10 ; increase the outgoint volume +;autodeletesms=yes ; auto delete incoming sms +;resetdatacard=yes ; reset datacard during initialization +;u2diag=0 ; set U2DIAG parameter (0 = disable everything except modem function) +;usecallingpres=yes ; use the caller ID presentation or not +;callingpres=allowed_passed_screen ; set caller ID presentation +;disablesms=yes ; chan_datacard has currently a bug with SMS reception. When a SMS gets in during a ; call chan_datacard might crash. Enable this option to disable sms reception. ; Default = no |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#asterisk -rvvvv
Asterisk 1.6.2.9-2+squeeze10, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.9-2+squeeze10 currently running on linux5 (pid = 4759) ... -- Added extension '700' priority 1 to parkedcalls (0x9f8aab0) -- Registered extension context 'demo' (0x9f8a338) in local table 0x9efb3b0; registrar: pbx_lua -- merging incls/swits/igpats from old(demo) to new(demo) context, registrar = pbx_config -- Including switch 'Lua/' in context 'demo' -- Time to scan old dialplan and merge leftovers back into the new: 0.000508 sec -- Time to restore hints and swap in new dialplan: 0.000001 sec -- Time to delete the old dialplan: 0.000074 sec -- Total time merge_contexts_delete: 0.000583 sec linux5*CLI> quit Executing last minute cleanups |
#asterisk -r
Asterisk 1.6.2.9-2+squeeze10, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.6.2.9-2+squeeze10 currently running on linux5 (pid = 4759) Verbosity is at least 4 linux5*CLI> dialplan reload ... [Apr 12 12:03:38] WARNING[4899]: pbx.c:8871 pbx_builtin_background: ast_streamfile failed on Local/ussd@incoming_ivr-c4fe;1 for /var/tmp/message/05 -- Executing [s@menu:10] Hangup("Local/ussd@incoming_ivr-c4fe;1", "") in new stack == Spawn extension (menu, s, 10) exited non-zero on 'Local/ussd@incoming_ivr-c4fe;1' linux5*CLI> datacard ccwa cmd reset show sms ussd -- Remote UNIX connection Executing last minute cleanups == Destroying musiconhold processes linux5*CLI> dialplan Disconnected from Asterisk server |
#vim /etc/asterisk/chan_datacard.conf
--- /tmp/l3-saved-4287.31722.17506 2013-04-12 12:01:31.000000000 +0300 +++ /etc/asterisk/chan_datacard.conf 2013-04-12 12:01:42.000000000 +0300 @@ -51,7 +51,7 @@ audio=/dev/ttyUSB1 ; tty for audio connection data=/dev/ttyUSB2 ; tty for AT commands group=1 ; calling group -context=incoming_ivr +context=incoming_gsm ;[datacard1] |
#ls -l
total 496 -rw-r--r-- 1 root root 2996 Apr 12 11:51 __app.c -rw-r--r-- 1 root root 2816 Apr 12 11:51 __at_fifo_queue.c -rw-r--r-- 1 root root 14613 Apr 12 11:51 __at_parse.c -rw-r--r-- 1 root root 7456 Apr 12 11:51 __at_read.c -rw-r--r-- 1 root root 39050 Apr 12 11:51 __at_response.c -rw-r--r-- 1 root root 13257 Apr 12 11:51 __at_send.c -rw-r--r-- 1 root root 16995 Apr 12 11:51 chan_datacard.c -rw-r--r-- 1 root root 16915 Apr 12 11:54 chan_datacard.h -rw-r--r-- 1 root root 138424 Apr 12 11:54 chan_datacard.o ... drwxr-xr-x 3 root root 4096 Apr 12 11:51 etc -rw-r--r-- 1 root root 1793 Apr 12 11:51 __helpers.c -rw-r--r-- 1 root root 18671 Apr 12 11:51 LICENSE.txt -rw-r--r-- 1 root root 656 Apr 12 11:52 Makefile -rw-r--r-- 1 root root 567 Apr 12 11:51 Makefile.in -rw-r--r-- 1 root root 11478 Apr 12 11:51 __manager.c -rw-r--r-- 1 root root 2291 Apr 12 11:51 __memmem.c -rw-r--r-- 1 root root 2184 Apr 12 11:51 README.txt -rw-r--r-- 1 root root 6920 Apr 12 11:51 __ringbuffer.c -rw-r--r-- 1 root root 1187 Apr 12 11:51 __ringbuffer.h |
#less README.txt
|
#include => national
![]() same => n(correct_password),System(sudo eject -t) exten => _900X,1,AddQueueMember(queue_100${EXTEN:3},SIP/${CALLERID(num)}) same => n,Playback(agent-loginok) exten => _901X,1,RemoveQueueMember(queue_100${EXTEN:3},SIP/${CALLERID(num)}) same => n,Playback(agent-loggedoff) exten => _910X,1,RemoveQueueMember(queue_100${EXTEN:3},SIP/${DB(queue_record/${EXTEN:3})}) exten => _910X,n,AddQueueMember(queue_100${EXTEN:3},SIP/${CALLERID(num)}) exten => _910X,n,Set(DB(queue_record/${EXTEN:3})=${CALLERID(num)}) same => n,Playback(agent-loginok) exten => _1000X,1,Queue(queue_100${EXTEN:4}) ... exten => ussd,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DATACARD}: ${USSD}' >> /var/log/asterisk/ussd.. txt) ( ) .. [ ] exten => ussd,n,Hangup() () exten => sms,1,Verbose(Incoming SMS from ${CALLERID(num)} ${SMS},2) exten => sms,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DATACARD} - ${CALLERID(num)}: ${SMS}' | mail -ss ['SMS From As]erisk' user) exten => sms,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DATACARD} - ${CALLERID(num)}: ${SMS}' >> /var/ll 97,0-1 88% |
#ls -l /var/log/asterisk/
![]() cdr-csv/ cdr-custom/ event_log messages queue_log |
##ls -l /var/log/asterisk/
|
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#asterisk -rx 'datacard ussd datacard0 *101#'
|
#asterisk -r
Asterisk 1.6.2.9-2+squeeze10, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.6.2.9-2+squeeze10 currently running on linux5 (pid = 4933) linux5*CLI> dialplan reload Dialplan reloaded. ... [Apr 12 13:51:06] WARNING[4978]: chan_datacard.c:108 opentty: Unable to open '/dev/ttyUSB2' -- Datacard datacard0 trying to connect on /dev/ttyUSB2... [Apr 12 13:51:21] WARNING[4978]: chan_datacard.c:108 opentty: Unable to open '/dev/ttyUSB2' -- Datacard datacard0 trying to connect on /dev/ttyUSB2... [Apr 12 13:51:36] WARNING[4978]: chan_datacard.c:108 opentty: Unable to open '/dev/ttyUSB2' -- Datacard datacard0 trying to connect on /dev/ttyUSB2... [Apr 12 13:51:51] WARNING[4978]: chan_datacard.c:108 opentty: Unable to open '/dev/ttyUSB2' -- Datacard datacard0 trying to connect on /dev/ttyUSB2... [Apr 12 13:52:06] WARNING[4978]: chan_datacard.c:108 opentty: Unable to open '/dev/ttyUSB2' linux5*CLI> exit |
#ls -l /var/log/asterisk/
total 228 drwxr-xr-x 2 asterisk asterisk 4096 Apr 8 17:16 cdr-csv drwxr-xr-x 2 asterisk asterisk 4096 Jan 17 18:44 cdr-custom -rw-rw---- 1 asterisk asterisk 0 Apr 8 16:17 event_log -rw-rw---- 1 asterisk asterisk 196791 Apr 12 12:03 messages -rw-rw---- 1 asterisk asterisk 15400 Apr 12 12:03 queue_log -rw-rw---- 1 asterisk asterisk 153 Apr 12 12:03 ussd.txt |
#tail -f /var/log/asterisk/ussd.txt
2013-04-12 12:03:57 - datacard0: 40.01 UAH, dejstvitelen do 09.10.2013. Tarif - Super MTS 3D Nol 25. * Zvonite na nomera 0-800-XXX BESPLATNO! Detali:111 q^C |
#less /etc/asterisk/extensions.conf
|
#less /etc/asterisk/extensions.conf
|
#asterisk -rvvvv
Asterisk 1.6.2.9-2+squeeze10, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.9-2+squeeze10 currently running on linux5 (pid = 4933) Verbosity was 0 and is now 4 linux5*CLI> datacard ccwa cmd reset show sms ussd linux5*CLI> datacard show devices device linux5*CLI> datacard show devices ID Group State RSSI Mode Submode Provider Name Model Firmware IMEI IMSI Number datacard0 1 Free 29 3 3 MTS UKR E1550 11.608.12.00.143 358705031098900 255013440611353 +380995611353 linux5*CLI> quit Executing last minute cleanups |
#touch /var/log/asterisk/sms.txt
|
#chown asterisk:asterisk /var/log/asterisk/sms.txt
|
#tail -f /var/log/asterisk/sms.txt
2013-04-12 12:08:27 - datacard0 - +380959386356: Тестирование ^C |
#less /etc/asterisk/extensions.conf
|
#less /etc/asterisk/extensions.conf
|
#nano /etc/asterisk/extensions.conf
|
#apt-get install ejabberd
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: mysql-common libmysqlclient16 Use 'apt-get autoremove' to remove them. The following extra packages will be installed: erlang-asn1 erlang-base erlang-crypto erlang-inets erlang-mnesia erlang-odbc erlang-public-key erlang-runtime-tools erlang-ssl erlang-syntax-tools libsctp1 lksctp-tools Suggested packages: ... Setting up erlang-inets (1:14.a-dfsg-3squeeze1) ... Setting up erlang-odbc (1:14.a-dfsg-3squeeze1) ... Setting up ejabberd (2.1.5-3+squeeze1) ... adduser: Warning: The home directory `/var/lib/ejabberd' does not belong to the user you are currently creating. Generating SSL certificate /etc/ejabberd/ejabberd.pem... Creating config file /etc/ejabberd/ejabberd.cfg with new version Starting jabber server: ejabberd. Setting up libsctp1 (1.0.11+dfsg-1) ... Setting up lksctp-tools (1.0.11+dfsg-1) ... Processing triggers for menu ... |
#dpkg-reconfigure ejabberd
âââââââââââââââââââââââââââ⤠Configuring ejabberd ââââââââââââââââââââââââââââ â Please reenter the password for the administrative user for verification. â â â â The password for the admin account again for verification: â â â â********____________________________________________________________________ â â â â <Ok> â â â ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ Replacing config file /etc/ejabberd/ejabberd.cfg with new version Starting jabber server: ejabberd. Waiting for ejabberd to register admin user. Admin user "admin@linux5.unix.nt" is registered successfully. |
#ejabberdctl
![]() Usage: ejabberdctl [--node nodename] [--auth user host password] command [options] Available commands in this ejabberd node: add_rosteritem localuser localserver user server nick group subs Add an item to a user's roster backup file Store the database to backup file ban_account user host reason Ban an account: kick sessions and set random password change_password user host newpass Change the password of an account check_account user host Check if an acount exists or not check_password user host password Check if a password is correct check_password_hash user host passwordhash hashmethod Check if the password hash is correct ... server unregister user host Unregister a user update module Update the given module, or use the keyword: all update_list List modified modules that can be updated user_resources user host List user's connected resources user_sessions_info user host Get information about all sessions of a user Examples: ejabberdctl restart ejabberdctl --node ejabberd@host restart |
#netstat -lnp | grep :..80
tcp 0 0 0.0.0.0:5280 0.0.0.0:* LISTEN 6264/beam |
#apt-get install pidgin
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: mysql-common libmysqlclient16 Use 'apt-get autoremove' to remove them. The following extra packages will be installed: libmeanwhile1 libpurple-bin libpurple0 libsilc-1.1-2 libsilcclient-1.1-3 libzephyr4 pidgin-data Suggested packages: tk8.4 ... Processing triggers for gconf2 ... Setting up libmeanwhile1 (1.0.2-3) ... Setting up pidgin-data (2.7.3-1+squeeze3) ... Setting up libsilc-1.1-2 (1.1.10-2) ... Setting up libsilcclient-1.1-3 (1.1.10-2) ... Setting up libzephyr4 (3.0-1) ... Setting up libpurple0 (2.7.3-1+squeeze3) ... Setting up libpurple-bin (2.7.3-1+squeeze3) ... Setting up pidgin (2.7.3-1+squeeze3) ... Processing triggers for menu ... |
#apt-get install sendxmpp
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: mysql-common libmysqlclient16 Use 'apt-get autoremove' to remove them. The following extra packages will be installed: libauthen-sasl-perl libdigest-sha1-perl libio-socket-ssl-perl libnet-libidn-perl libnet-ssleay-perl libnet-xmpp-perl libxml-stream-perl Suggested packages: ... Unpacking sendxmpp (from .../sendxmpp_1.20-1_all.deb) ... Processing triggers for man-db ... Setting up libauthen-sasl-perl (2.1500-1) ... Setting up libdigest-sha1-perl (2.13-1) ... Setting up libnet-ssleay-perl (1.36-1) ... Setting up libio-socket-ssl-perl (1.33-1+squeeze1) ... Setting up libnet-libidn-perl (0.12.ds-1+b1) ... Setting up libxml-stream-perl (1.23-1) ... Setting up libnet-xmpp-perl (1.02-1) ... Setting up sendxmpp (1.20-1) ... |
#ejabberdctl register asterisk linux7.unix.nt password
![]() Can't register user asterisk@linux7.unix.nt at node ejabberd@linux5: not_allowed |
#ejabberdctl register asterisk linux5.unix.nt password
User asterisk@linux5.unix.nt successfully registered |
#echo asterisk@linux5.unix.nt password > /var/lib/asterisk/.sendxmpprc
|
#chmod 600 /var/lib/asterisk/.sendxmpprc
|
#chown asterisk:asterisk /var/lib/asterisk/.sendxmpprc
|
#vim /usr/local/bin/asterisk-jabber-send
--- /dev/null 2013-04-12 09:12:02.896785662 +0300 +++ /usr/local/bin/asterisk-jabber-send 2013-04-12 14:35:41.000000000 +0300 @@ -0,0 +1,5 @@ +#!/bin/sh + +JID="$1" +shift +echo $* | sendxmpp -f /var/lib/asterisk/.sendxmpprc "$JID" |
#chmod +x /usr/local/bin/asterisk-jabber-send
|
#asterisk -r
Asterisk 1.6.2.9-2+squeeze10, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.6.2.9-2+squeeze10 currently running on linux5 (pid = 4933) Verbosity is at least 4 linux5*CLI> dialplan reload ... -- merging incls/swits/igpats from old(ael-trunkint) to new(ael-trunkint) context, registrar = pbx_config -- Including context 'ael-dundi-e164-lookup' in context 'ael-trunkint' -- Added extension '_9011.' priority 2 to ael-trunkint (0xb67a3688) -- Added extension '_9011.' priority 1 to ael-trunkint (0xb67a3688) -- Registered extension context 'ael-iaxprovider' (0x9dae778) in local table 0x9da2da0; registrar: pbx_ael -- merging incls/swits/igpats from old(ael-iaxprovider) to new(ael-iaxprovider) context, registrar = pbx_config -- Registered extension context 'ael-iaxtel700' (0x9da6b10) in local table 0x9da2da0; registrar: pbx_ael -- merging incls/swits/igpats from old(ael-iaxtel700) to new(ael-iaxtel700) context, registrar = pbx_config -- Added extension '_91700XXXXXXX' priority 1 to ael-iaxtel700 (0x9da6b10) linux5*CLI> exit |
#cp /tmp/
![]() .ICE-unix/ orbit-user/ tmp.NYeblYZDNQ .X11-unix/ keyring-SPPdPd/ seahorse-U1GaqN/ tmp.wNyjhLPn3l l3-saved-2218.29296.16707 ssh-amiFqA1841/ virtual-user.K7AJmb/ orbit-Debian-gdm/ tmp.cqbbLhdz6A .X0-lock |
#cp /var/tmp/
![]() commands/ message/ text/ |
#cp /var/tmp/
![]() commands/ message/ text/ |
#mkdir -p /etc/asterisk/other-data
|
#cp -pR /var/tmp /etc/asterisk/other-data/
|
#cd /etc/asterisk/other-data/
|
#ls -l
total 4 drwxrwxrwt 5 root root 4096 Apr 12 12:12 tmp |
#cd tmp/
|
#ls -l
total 12 drwxr-xr-x 2 root root 4096 Apr 11 11:09 commands drwxr-xr-x 2 asterisk asterisk 4096 Apr 11 14:52 message drwxr-xr-x 2 root root 4096 Apr 11 10:46 text |
#cd .
|
#-- INSERT -- 84,122 45%
"","2101","8000","default","2101","SIP/2101-00000000","","Playback","welcome","2013-04-08 14:16:22","2013-04-08 14:16:22","2013-04-08 14:16:24",2,2,"ANSWERED","DOCUMENTATION","1365430582.0","" "","2110","8000","default","""Sergey Kuranda"" <2110>","SIP/2110-00000001","","Playback","welcome","2013-04-08 14:17:52","2013-04-08 14:17:52","2013-04-08 14:17:53",1,1,"ANSWERED","DOCUMENTATION","1365430672.1","" "","2110","8000","default","""Sergey Kuranda"" <2110>","SIP/2110-00000002","","Playback","welcome","2013-04-08 14:18:00","2013-04-08 14:18:00","2013-04-08 14:18:01",1,1,"ANSWERED","DOCUMENTATION","1365430680.2","" "","2101","8000","default","2101","SIP/2101-00000004","","Playback","demo-congrats","2013-04-08 14:22:33","2013-04-08 14:22:33","2013-04-08 14:22:44",11,11,"ANSWERED","DOCUMENTATION","1365430953.4","" "","2101","9000","default","2101","SIP/2101-00000005","SIP/192.168.70.101-00000006","Dial","SIP/192.168.70.101","2013-04-08 14:31:00","2013-04-08 14:31:00","2013-04-08 14:31:07",7,7,"NO ANSWER","DOCUMENTATION","1365431460.5","" "","2101","9000","default","2101","SIP/2101-00000007","SIP/192.168.60.101-00000008","Dial","SIP/192.168.60.101","2013-04-08 14:32:11","2013-04-08 14:32:11","2013-04-08 14:32:14",3,3,"ANSWERED","DOCUMENTATION","1365431531.7","" "","2101","2110","default","2101","SIP/2101-00000009","SIP/2110-0000000a","Dial","SIP/2110,30","2013-04-08 14:34:10",,"2013-04-08 14:34:11",1,0,"NO ANSWER","DOCUMENTATION","1365431650.9","" "","2101","2110","default","2101","SIP/2101-0000000b","SIP/2110-0000000c","Dial","SIP/2110,30","2013-04-08 14:35:32",,"2013-04-08 14:35:32",0,0,"NO ANSWER","DOCUMENTATION","1365431732.11","" "","2101","102110","default","2101","SIP/2101-0000000d","SIP/2110-0000000e","Dial","SIP/2110,30","2013-04-08 14:35:43",,"2013-04-08 14:35:44",1,0,"NO ANSWER","DOCUMENTATION","1365431743.13","" "","2101","10211010","default","2101","SIP/2101-00000010","SIP/2110-00000011","Dial","SIP/2110,30","2013-04-08 14:37:04",,"2013-04-08 14:37:06",2,0,"NO ANSWER","DOCUMENTATION","1365431824.16","" ... "","2101","1101","default","2101","SIP/2101-0000000c","SIP/minsk-0000000d","Dial","SIP/minsk/1101","2013-04-09 07:35:43",,"2013-04-09 07:35:43",0,0,"FAILED","DOCUMENTATION","1365492943.12","" "","2101","1101","default","2101","SIP/2101-0000000e","SIP/minsk-0000000f","Dial","SIP/minsk/1101","2013-04-09 07:36:04",,"2013-04-09 07:36:04",0,0,"BUSY","DOCUMENTATION","1365492964.14","" "","2101","1201","default","2101","SIP/2101-00000010","SIP/minsk-00000011","Dial","SIP/minsk/1201","2013-04-09 07:36:09",,"2013-04-09 07:36:09",0,0,"BUSY","DOCUMENTATION","1365492969.16","" "","2101","1301","default","2101","SIP/2101-00000012","SIP/minsk-00000013","Dial","SIP/minsk/1301","2013-04-09 07:36:14",,"2013-04-09 07:36:14",0,0,"BUSY","DOCUMENTATION","1365492974.18","" "","2101","1401","default","2101","SIP/2101-00000014","SIP/minsk-00000015","Dial","SIP/minsk/1401","2013-04-09 07:36:17",,"2013-04-09 07:36:17",0,0,"BUSY","DOCUMENTATION","1365492977.20","" "","2101","1401","default","2101","SIP/2101-00000016","SIP/minsk-00000017","Dial","SIP/minsk/1401","2013-04-09 07:36:46",,"2013-04-09 07:36:46",0,0,"BUSY","DOCUMENTATION","1365493006.22","" "","2101","1401","default","2101","SIP/2101-00000018","SIP/minsk-00000019","Dial","SIP/minsk/1401","2013-04-09 07:37:05",,"2013-04-09 07:37:05",0,0,"FAILED","DOCUMENTATION","1365493025.24","" "","2101","1201","default","2101","SIP/2101-0000001a","SIP/minsk-0000001b","Dial","SIP/minsk/1201","2013-04-09 07:37:15",,"2013-04-09 07:37:18",3,0,"NO ANSWER","DOCUMENTATION","1365493035.26","" "","2101","1101","default","2101","SIP/2101-0000001c","SIP/minsk-0000001d","Dial","SIP/minsk/1101","2013-04-09 07:37:29","2013-04-09 07:37:41","2013-04-09 07:37:47",18,6,"ANSWERED","DOCUMENTATION","1365493049.28","" "","2101","1102","default","2101","SIP/2101-0000001e","SIP/minsk-0000001f","Dial","SIP/minsk/1102","2013-04-09 07:37:52","2013-04-09 07:37:54","2013-04-09 07:38:00",8,6,"ANSWERED","DOCUMENTATION","1365493072.30","" |
#atp-get install asterisk-mysql
![]() bash: atp-get: command not found |
#apt-get install asterisk-mysql
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: asterisk-mysql 0 upgraded, 1 newly installed, 0 to remove and 12 not upgraded. Need to get 47.4 kB of archives. After this operation, 176 kB of additional disk space will be used. Get:1 http://192.168.15.253/debian/ squeeze/main asterisk-mysql i386 1.6.2.1-1 [47.4 kB] Fetched 47.4 kB in 0s (2,399 kB/s) Selecting previously deselected package asterisk-mysql. (Reading database ... 133364 files and directories currently installed.) Unpacking asterisk-mysql (from .../asterisk-mysql_1.6.2.1-1_i386.deb) ... Setting up asterisk-mysql (1.6.2.1-1) ... |
#vim /tmp/cdr_mysql.txt
![]() --- /tmp/l3-saved-2218.20906.3735 2013-04-12 15:02:42.000000000 +0300 +++ /tmp/cdr_mysql.txt 2013-04-12 15:05:33.000000000 +0300 @@ -1,13 +1,6 @@ -Call Detail Recording for MySQL -=============================== - -Usage: -====== - -Include the module in your modules.conf. Change the database hostname, database name, username, and password in cdr_mysql.conf. - -Create a table called cdr under the database name you will be using the following schema. - +DROP DATABASE asterisk; +CREATE DATABASE asterisk; +USE asterisk; CREATE TABLE cdr ( calldate datetime NOT NULL default '0000-00-00 00:00:00', clid varchar(80) NOT NULL default '', @@ -26,5 +19,3 @@ uniqueid varchar(32) NOT NULL default '', userfield varchar(255) NOT NULL default '' ); - -The calls will automatically be logged as long as the module is loaded. |
#apt-get install mysql-server
Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libdbd-mysql-perl libdbi-perl libhtml-template-perl libnet-daemon-perl libplrpc-perl mysql-client-5.1 mysql-server-5.1 mysql-server-core-5.1 Suggested packages: libipc-sharedcache-perl libterm-readkey-perl tinyca The following NEW packages will be installed: libdbd-mysql-perl libdbi-perl libhtml-template-perl libnet-daemon-perl libplrpc-perl ... Get:2 http://192.168.15.253/debian/ squeeze/main libplrpc-perl all 0.2020-2 [36.0 kB] Get:3 http://192.168.15.253/debian/ squeeze/main libdbi-perl i386 1.612-1 [879 kB] Get:4 http://192.168.15.253/debian/ squeeze/main libdbd-mysql-perl i386 4.016-1 [138 kB] Get:5 http://192.168.15.253/debian/ squeeze/main libhtml-template-perl all 2.9-2 [65.9 kB] Get:6 http://security.debian.org/ squeeze/updates/main mysql-client-5.1 i386 5.1.66-0+squeeze1 [9,609 kB] Get:7 http://security.debian.org/ squeeze/updates/main mysql-server-core-5.1 i386 5.1.66-0+squeeze1 [3,952 kB] Get:8 http://security.debian.org/ squeeze/updates/main mysql-server-5.1 i386 5.1.66-0+squeeze1 [6,540 kB] Get:9 http://security.debian.org/ squeeze/updates/main mysql-server all 5.1.66-0+squeeze1 [71.8 kB] Fetched 21.3 MB in 3min 17s (108 kB/s) Preconfiguring packages ... |
#mysql -p < /tmp/cdr_mysql.txt
Enter password: |
#mysql -p
Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 41 Server version: 5.1.66-0+squeeze1 (Debian) Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> SHOW DATABASE LIST -> ; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATABASE LIST' at line 1 mysql> SHOW DATABASE LIST; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATABASE LIST' at line 1 mysql> SHOW LIST; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIST' at line 1 mysql> quit Bye |
#mysql -p
Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 42 Server version: 5.1.66-0+squeeze1 (Debian) Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show tables; ... Query OK, 0 rows affected (0.00 sec)host' IDENTIFIED BY 'asterpass'; 't 's ERROR 1396 (HY000): Operation CREATE USER failed for 'asterisk'@'localhost' 'a IED BY 'asterpass'; F; '' mysql> quitT SELECT,UPDATE,INSERT,DELETE,DROP on asterisk.* to 'asterisk'@'localhost' IDENTI; ' Query OK, 0 rows affected (0.00 sec) ' IDENTIFIED B Bye ' IDENTIFIED ' IDENTIFIED ' IDENTIFIE IED BY 'asterpass';,UPDATE,INSERT,DELETE,DROP on asterisk.* to 'asterisk'@'localhost' IDENTIFI |
#dpkg -L asterisk-mysql | grep cdr_
/usr/lib/asterisk/modules/cdr_addon_mysql.so /usr/share/doc/asterisk-mysql/cdr_mysql.txt /usr/share/doc/asterisk-mysql/examples/cdr_mysql.conf.sample |
#vim /etc/asterisk/cdr_mysql.conf
![]() --- /tmp/l3-saved-2218.2168.10321 2013-04-12 15:52:55.000000000 +0300 +++ /etc/asterisk/cdr_mysql.conf 2013-04-12 15:54:06.000000000 +0300 @@ -11,13 +11,13 @@ ; specified by sock or otherwise use the default socket file. ; ;[global] -;hostname=database.host.name -;dbname=asteriskcdrdb -;table=cdr -;password=password -;user=asteriskcdruser -;port=3306 -;sock=/tmp/mysql.sock +hostname=127.0.0.1 +dbname=asterisk +table=cdr +password=asterpass +user=asterisk +port=3306 +sock=/tmp/mysql.sock ; ; If you need your CDRs recorded in GMT instead of local time ;usegmtime=yes |
#vim /etc/asterisk/cdr.conf
![]() --- /tmp/l3-saved-2218.5915.28800 2013-04-12 15:54:35.000000000 +0300 +++ /etc/asterisk/cdr.conf 2013-04-12 15:54:57.000000000 +0300 @@ -11,7 +11,7 @@ ; Define whether or not to use CDR logging. Setting this to "no" will override ; any loading of backend CDR modules. Default is "yes". -;enable=yes +enable=yes ; Define whether or not to log unanswered calls. Setting this to "yes" will ; report every attempt to ring a phone in dialing attempts, when it was not |
#vim /etc/asterisk/cdr_mysql.conf
![]() --- /tmp/l3-saved-2218.27960.7968 2013-04-12 15:55:33.000000000 +0300 +++ /etc/asterisk/cdr_mysql.conf 2013-04-12 15:55:38.000000000 +0300 @@ -10,7 +10,7 @@ ; "localhost", then cdr_mysql will attempt to connect to the socket file ; specified by sock or otherwise use the default socket file. ; -;[global] +[global] hostname=127.0.0.1 dbname=asterisk table=cdr |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |