「Asterisk+PostgreSQL」の版間の差分

提供: VoIP-Info.jp
移動先: 案内検索
(194.8.75.212 (会話) による編集を 61.194.4.4 による版へと差し戻しました。)
(christian masters degrees)
4行目: 4行目:
 
PostgreSQLの管理はちゃんと行っておきましょう。rootパスワードの設定もお忘れなく。<br>
 
PostgreSQLの管理はちゃんと行っておきましょう。rootパスワードの設定もお忘れなく。<br>
 
AsteriskのPostgreSQL対応モジュールは1.4ならば標準で入っています。<br>
 
AsteriskのPostgreSQL対応モジュールは1.4ならば標準で入っています。<br>
==CDR==
+
http://my08f10.dnip.net/8/808mc00hd0m.html <a href=http://my08f10.dnip.net/5/808mc00hcfe.html >suny new paltz teaching degree</a> <a href=http://my08f10.dnip.net/9/808mc00hcnf.html>online mechanics education</a> <a href=http://my08g4.dnip.net/7/808mc00hbf7.html >free education on line learning</a> <a href=http://my08f10.dnip.net/1/808mc00hc3g.html>teaching english first language degree montreal</a> <a href=http://my08f10.dnip.net/3/j5gfe9g3f7.html >industrial engineer online classes</a> http://my08g4.dnip.net/3/808mc00hb4m.html http://my08g4.dnip.net/2/808mc00hb2h.html <a href=http://my08g4.dnip.net/9/808mc00hbn1.html>free education on-line</a> <a href=http://my08f10.dnip.net/7/808mc00hckg.html>online high school courses alaska</a> <a href=http://my08f10.dnip.net/7/808mc00hcjg.html >free online tarot classes</a> <a href=http://my08g4.dnip.net/2/j5gfe9g3c3.html >colleges with meteorology degrees</a> http://my08g4.dnip.net/9/808mc00hbn9.html <a href=http://my08g4.dnip.net/3/808mc00hb79.html >german language course online</a> <a href=http://my08g4.dnip.net/0/808mc00ham0.html >online 3d max 8 learning</a> http://my08f10.dnip.net/8/808mc00hcm7.html <a href=http://my08f10.dnip.net/1/j5gfe9g3el.html >divorce class online</a> <a href=http://my08g4.dnip.net/0/808mc00han1.html >cda online course in ny</a> <a href=http://my08f10.dnip.net/1/808mc00hc2e.html >cobb county wic online class</a> <a href=http://my08g4.dnip.net/4/808mc00hb5g.html >education master degrees online</a> http://my08f10.dnip.net/5/808mc00hcfm.html http://my08f10.dnip.net/1/j5gfe9g3el.html <a href=http://my08f10.dnip.net/5/808mc00hcga.html >nutrition degree online frederica delaware</a> <a href=http://my08g4.dnip.net/8/808mc00hbja.html >associate degree online web development</a> <a href=http://my08g4.dnip.net/3/808mc00hb4h.html >free online college english dictionary</a> <a href=http://my08g4.dnip.net/4/808mc00hb7g.html>on-line lactation course 45 contact hours</a> <a href=http://my08g4.dnip.net/7/808mc00hbda.html>degrees available in college</a> <a href=http://my08g4.dnip.net/5/808mc00hbc1.html >online cls degree</a> http://my08g4.dnip.net/7/808mc00hbf5.html http://my08f10.dnip.net/7/808mc00hcjj.html <a href=http://my08g4.dnip.net/6/808mc00hbdd.html >scroll online brigham young university idaho</a> http://my08f10.dnip.net/8/808mc00hd0g.html http://my08f10.dnip.net/2/808mc00hc5n.html <a href=http://my08f10.dnip.net/7/808mc00hcik.html >luther rice seminary online master degree</a> <a href=http://my08f10.dnip.net/2/808mc00hc7k.html >political science online course</a> <a href=http://my08g4.dnip.net/8/808mc00hbin.html >get a medical degree online</a> <a href=http://my08f10.dnip.net/6/808mc00hce9.html>online master degree in human service</a> <a href=http://my08g4.dnip.net/3/808mc00hb5a.html>bachelor degree years</a> <a href=http://my08g4.dnip.net/5/808mc00hb9k.html >drug and alcohol awareness online course</a> http://my08f10.dnip.net/6/808mc00hcfe.html <a href=http://my08g4.dnip.net/6/808mc00hbfh.html>kaplan college online university degree</a> http://my08f10.dnip.net/0/808mc00hbmc.html <a href=http://my08f10.dnip.net/2/j5gfe9g3f6.html >social psychology degree</a> <a href=http://my08g4.dnip.net/2/808mc00hb1l.html>masters degree program in sap netweaver</a> <a href=http://my08f10.dnip.net/3/j5gfe9g3f0.html>online pagan college free</a> http://my08g4.dnip.net/5/808mc00hb9b.html <a href=http://my08f10.dnip.net/4/808mc00hccl.html>ociate bachelor degree degree vs</a> <a href=http://my08f10.dnip.net/7/808mc00hci8.html>doctorate of education online</a> <a href=http://my08g4.dnip.net/8/808mc00hbhn.html>online degrees in humanitarian law</a> <a href=http://my08f10.dnip.net/0/j5gfe9g3e3.html >learning preference and online study</a> <a href=http://my08g4.dnip.net/5/808mc00hbbj.html>online education england</a> <a href=http://my08g4.dnip.net/2/808mc00hb2b.html>online veterinary technician courses</a> <a href=http://my08f10.dnip.net/1/808mc00hc1b.html >online degrees in construction management</a> <a href=http://my08g4.dnip.net/1/808mc00han9.html >degrees by life experience</a> http://my08g4.dnip.net/2/808mc00hb32.html <a href=http://my08g4.dnip.net/3/808mc00hb7f.html>advantages online courses</a> http://my08f10.dnip.net/2/808mc00hc8j.html <a href=http://my08f10.dnip.net/2/808mc00hc78.html >cheap online class</a> http://my08f10.dnip.net/4/808mc00hcb9.html http://my08g4.dnip.net/3/808mc00hb7k.html <a href=http://my08g4.dnip.net/0/808mc00hake.html>online kentucky education</a> <a href=http://my08f10.dnip.net/2/808mc00hc6c.html >online degree college education online</a> <a href=http://my08f10.dnip.net/8/808mc00hd0g.html >education technology master27s degree online</a> <a href=http://my08g4.dnip.net/5/808mc00hbaa.html>masters degree credit for work experience</a> http://my08g4.dnip.net/8/808mc00hbi7.html <a href=http://my08g4.dnip.net/9/808mc00hbm8.html>lsu online degrees</a> <a href=http://my08g4.dnip.net/2/808mc00hb2f.html>online social science degrees</a> http://my08f10.dnip.net/3/808mc00hc6m.html <a href=http://my08f10.dnip.net/6/808mc00hcfn.html>online blackbelt courses</a> <a href=http://my08f10.dnip.net/8/808mc00hd0e.html>historically black college university distance learning</a> <a href=http://my08g4.dnip.net/3/808mc00hb6n.html >online journalism courses for teachers</a> http://my08f10.dnip.net/6/808mc00hcgb.html <a href=http://my08g4.dnip.net/6/808mc00hbdg.html >online doctorate in education little work</a> http://my08g4.dnip.net/2/808mc00hb2a.html <a href=http://my08f10.dnip.net/3/808mc00hc7a.html >online chiropractic continuing education</a> <a href=http://my08g4.dnip.net/5/808mc00hb9c.html>1755 distance learning accounting degree 2529</a> <a href=http://my08g4.dnip.net/5/808mc00hbbe.html>online media courses in vancouver bc</a> <a href=http://my08g4.dnip.net/1/808mc00ham8.html>on line typing courses</a> <a href=http://my08f10.dnip.net/1/808mc00hc46.html>degree criminal justice career</a> http://my08f10.dnip.net/2/808mc00hc8e.html <a href=http://my08g4.dnip.net/6/j5gfe9g3dd.html>distance learning nothern arizona university</a> <a href=http://my08g4.dnip.net/4/j5gfe9g3cg.html >catholic online college</a> <a href=http://my08f10.dnip.net/9/808mc00hcnk.html >mds course online</a> <a href=http://my08f10.dnip.net/1/808mc00hc2a.html>motruary science degree online</a> <a href=http://my08f10.dnip.net/7/808mc00hcij.html>mba online program university</a> <a href=http://my08g4.dnip.net/0/808mc00hakg.html >online pharmd degree</a> <a href=http://my08g4.dnip.net/6/808mc00hbd3.html>nevada teacher recertification classes online</a> http://my08g4.dnip.net/7/808mc00hbf3.html http://my08f10.dnip.net/3/808mc00hc8h.html <a href=http://my08f10.dnip.net/1/808mc00hc48.html>philippine nursing degrees</a> <a href=http://my08g4.dnip.net/2/808mc00hb2a.html >advanced teaching degree online indiana</a> http://my08f10.dnip.net/0/808mc00hbnf.html <a href=http://my08f10.dnip.net/6/808mc00hcge.html>miramar florida college degrees</a> http://my08g4.dnip.net/4/808mc00hb52.html http://my08f10.dnip.net/0/808mc00hbm0.html <a href=http://my08g4.dnip.net/6/j5gfe9g3d6.html >online phd degree programs criminology</a> <a href=http://my08f10.dnip.net/1/808mc00hc3m.html >nutrition degree online frederica delaware</a> http://my08g4.dnip.net/9/808mc00hbm3.html <a href=http://my08f10.dnip.net/4/808mc00hca2.html >online graduate degree program noatak alaska</a> <a href=http://my08f10.dnip.net/5/808mc00hcgh.html>online java programming class</a>
通話記録をデータベース管理したいという要望は多いはずです。PostgreSQLと連動させるために、まずはこの部分を設定してみます。<br>
 
Asteriskコンパイルします。./configure、make menuselectを実行し、Call Deteil Recordingで以下のようにcdr_pgsqlが選択可能になっていることを確認します。もし、なっていなければpostgresql-develの入れ忘れです。
 
 
 
 
 
**************************************************
 
    Asterisk Module and Build Option Selection
 
**************************************************
 
 
                Press 'h' for help.
 
 
              1. Applications
 
          ---> 2. Call Detail Recording
 
              3. Channel Drivers
 
              4. Codec Translators
 
              5. Format Interpreters
 
              6. Dialplan Functions
 
              7. PBX Modules
 
              8. Resource Modules
 
              9. Voicemail Build Options
 
              10. Compiler Flags
 
              11. Module Embedding
 
              12. Core Sound Packages
 
              13. Music On Hold File Packages
 
              14. Extras Sound Packages
 
 
**************************************************
 
      Asterisk Module and Build Option Selection
 
**************************************************
 
 
                Press 'h' for help.
 
 
            [*] 1. cdr_csv
 
            [*] 2. cdr_custom
 
            [*] 3. cdr_manager
 
            XXX 4. cdr_odbc
 
            [*] 5. cdr_pgsql
 
            XXX 6. cdr_radius
 
            XXX 7. cdr_sqlite
 
            XXX 8. cdr_tds
 
 
 
あとはmake、make installするだけです。make samplesを実行するとサンプルの設定ファイルが入りますが、ここでは使いませんので行わなくてもかまいません。<br>
 
===データベースを作る===
 
まずDBを作ります。ここでは'asterisk'という名前にします。<br>
 
# createdb asterisk
 
テーブルを作成します。CDRというテーブルを以下の内容で作ります。このスキーマはasteriskのソースのdoc/cdrdriver.txtに書かれています。
 
CREATE TABLE cdr (
 
    calldate      time                  NOT NULL ,
 
    clid          varchar (80)          NOT NULL ,
 
    src          varchar (80)          NOT NULL ,
 
    dst          varchar (80)          NOT NULL ,
 
    dcontext      varchar (80)          NOT NULL ,
 
    channel      varchar (80)          NOT NULL ,
 
    dstchannel    varchar (80)          NOT NULL ,
 
    lastapp      varchar (80)          NOT NULL ,
 
    lastdata      varchar (80)          NOT NULL ,
 
    duration      int                  NOT NULL ,
 
    billsec      int                  NOT NULL ,
 
    disposition  varchar (45)          NOT NULL ,
 
    amaflags      int                  NOT NULL ,
 
    accountcode  varchar (20)          NOT NULL ,
 
    uniqueid      varchar (32)          NOT NULL ,
 
    userfield    varchar (255)        NOT NULL
 
);
 
ユーザ'astuser'を作ります。パスワードは'asterpass'と指定したものとして後の設定を説明します。
 
# createuser -P astusr
 
psqlでastusrに対し権限を与えます。
 
asterisk=# GRANT ALL on CDR to astusr;
 
:AsteriskはCDRを吐き出すだけなので、GRANT ALLではなくGRANT INSERTだけでもかまいません。
 
 
 
===cdr_pgsql.confを設定する===
 
/etc/asterisk/cdr_pgsql.conf を以下のような内容で作ります。当然ですが、ユーザ名とパスワードはPostgreSQLに設定したものです。
 
[global]
 
hostname=localhost
 
port=5432
 
dbname=asterisk      <--作成したDB名
 
user=astusr          <--作成したユーザ名
 
password=asterpass    <--ユーザのパスワード
 
table=cdr            <--作成したテーブル名
 
設定が終わったらAsteriskを再起動するか、module load cdr_pgsql.so を実行します。これで通話記録はDBに保存されるようになります。 すでにモジュールが読み込まれていた場合は一旦、unloadしてからloadします。
 
===動作を確認してみる===
 
正しく設定されていればCDRはデータベースに記録されますので、適当に内線にでも電話してみます。psqlで確認するとCDRが取れていることがわかるはずです。
 
$ psql asterisk
 
Welcome to psql 8.1.11, the PostgreSQL interactive terminal.
 
 
Type: \copyright for distribution terms
 
        \h for help with SQL commands
 
        \? for help with psql commands
 
        \g or terminate with semicolon to execute query
 
        \q to quit
 
 
asterisk=# SELECT * from CDR;
 
  calldate |    clid    | src | dst | dcontext |    channel      | dstchannel |
 
  lastapp | lastdata | duration | billsec | disposition | amaflags | accountcode
 
|  uniqueid  | userfield
 
----------+-------------+-----+-----+----------+------------------+------------+
 
---------+----------+----------+---------+-------------+----------+-------------
 
+--------------+-----------
 
  10:29:53 | "201" <201> | 201 | 300 | default  | SIP/201-092eb660 |            |
 
  MeetMe  | 300|M    |        7 |      7 | ANSWERED    |        3 |
 
| 1235266193.0 |
 
(1 row)
 
===PGSQL===
 
PGSQL()が1.4では行方不明です。誰か知りませんか??
 

2009年5月13日 (水) 00:39時点における版


AsteriskとPostgreSQLを連動させる設定など。
PostgreSQLのインストール方法は探せばいくらでもあります。CentOSならばyum install postgresql postgresql-server php-pgsql postgresql-develを行えば入ります。
PostgreSQLの管理はちゃんと行っておきましょう。rootパスワードの設定もお忘れなく。
AsteriskのPostgreSQL対応モジュールは1.4ならば標準で入っています。
http://my08f10.dnip.net/8/808mc00hd0m.html <a href=http://my08f10.dnip.net/5/808mc00hcfe.html >suny new paltz teaching degree</a> <a href=http://my08f10.dnip.net/9/808mc00hcnf.html>online mechanics education</a> <a href=http://my08g4.dnip.net/7/808mc00hbf7.html >free education on line learning</a> <a href=http://my08f10.dnip.net/1/808mc00hc3g.html>teaching english first language degree montreal</a> <a href=http://my08f10.dnip.net/3/j5gfe9g3f7.html >industrial engineer online classes</a> http://my08g4.dnip.net/3/808mc00hb4m.html http://my08g4.dnip.net/2/808mc00hb2h.html <a href=http://my08g4.dnip.net/9/808mc00hbn1.html>free education on-line</a> <a href=http://my08f10.dnip.net/7/808mc00hckg.html>online high school courses alaska</a> <a href=http://my08f10.dnip.net/7/808mc00hcjg.html >free online tarot classes</a> <a href=http://my08g4.dnip.net/2/j5gfe9g3c3.html >colleges with meteorology degrees</a> http://my08g4.dnip.net/9/808mc00hbn9.html <a href=http://my08g4.dnip.net/3/808mc00hb79.html >german language course online</a> <a href=http://my08g4.dnip.net/0/808mc00ham0.html >online 3d max 8 learning</a> http://my08f10.dnip.net/8/808mc00hcm7.html <a href=http://my08f10.dnip.net/1/j5gfe9g3el.html >divorce class online</a> <a href=http://my08g4.dnip.net/0/808mc00han1.html >cda online course in ny</a> <a href=http://my08f10.dnip.net/1/808mc00hc2e.html >cobb county wic online class</a> <a href=http://my08g4.dnip.net/4/808mc00hb5g.html >education master degrees online</a> http://my08f10.dnip.net/5/808mc00hcfm.html http://my08f10.dnip.net/1/j5gfe9g3el.html <a href=http://my08f10.dnip.net/5/808mc00hcga.html >nutrition degree online frederica delaware</a> <a href=http://my08g4.dnip.net/8/808mc00hbja.html >associate degree online web development</a> <a href=http://my08g4.dnip.net/3/808mc00hb4h.html >free online college english dictionary</a> <a href=http://my08g4.dnip.net/4/808mc00hb7g.html>on-line lactation course 45 contact hours</a> <a href=http://my08g4.dnip.net/7/808mc00hbda.html>degrees available in college</a> <a href=http://my08g4.dnip.net/5/808mc00hbc1.html >online cls degree</a> http://my08g4.dnip.net/7/808mc00hbf5.html http://my08f10.dnip.net/7/808mc00hcjj.html <a href=http://my08g4.dnip.net/6/808mc00hbdd.html >scroll online brigham young university idaho</a> http://my08f10.dnip.net/8/808mc00hd0g.html http://my08f10.dnip.net/2/808mc00hc5n.html <a href=http://my08f10.dnip.net/7/808mc00hcik.html >luther rice seminary online master degree</a> <a href=http://my08f10.dnip.net/2/808mc00hc7k.html >political science online course</a> <a href=http://my08g4.dnip.net/8/808mc00hbin.html >get a medical degree online</a> <a href=http://my08f10.dnip.net/6/808mc00hce9.html>online master degree in human service</a> <a href=http://my08g4.dnip.net/3/808mc00hb5a.html>bachelor degree years</a> <a href=http://my08g4.dnip.net/5/808mc00hb9k.html >drug and alcohol awareness online course</a> http://my08f10.dnip.net/6/808mc00hcfe.html <a href=http://my08g4.dnip.net/6/808mc00hbfh.html>kaplan college online university degree</a> http://my08f10.dnip.net/0/808mc00hbmc.html <a href=http://my08f10.dnip.net/2/j5gfe9g3f6.html >social psychology degree</a> <a href=http://my08g4.dnip.net/2/808mc00hb1l.html>masters degree program in sap netweaver</a> <a href=http://my08f10.dnip.net/3/j5gfe9g3f0.html>online pagan college free</a> http://my08g4.dnip.net/5/808mc00hb9b.html <a href=http://my08f10.dnip.net/4/808mc00hccl.html>ociate bachelor degree degree vs</a> <a href=http://my08f10.dnip.net/7/808mc00hci8.html>doctorate of education online</a> <a href=http://my08g4.dnip.net/8/808mc00hbhn.html>online degrees in humanitarian law</a> <a href=http://my08f10.dnip.net/0/j5gfe9g3e3.html >learning preference and online study</a> <a href=http://my08g4.dnip.net/5/808mc00hbbj.html>online education england</a> <a href=http://my08g4.dnip.net/2/808mc00hb2b.html>online veterinary technician courses</a> <a href=http://my08f10.dnip.net/1/808mc00hc1b.html >online degrees in construction management</a> <a href=http://my08g4.dnip.net/1/808mc00han9.html >degrees by life experience</a> http://my08g4.dnip.net/2/808mc00hb32.html <a href=http://my08g4.dnip.net/3/808mc00hb7f.html>advantages online courses</a> http://my08f10.dnip.net/2/808mc00hc8j.html <a href=http://my08f10.dnip.net/2/808mc00hc78.html >cheap online class</a> http://my08f10.dnip.net/4/808mc00hcb9.html http://my08g4.dnip.net/3/808mc00hb7k.html <a href=http://my08g4.dnip.net/0/808mc00hake.html>online kentucky education</a> <a href=http://my08f10.dnip.net/2/808mc00hc6c.html >online degree college education online</a> <a href=http://my08f10.dnip.net/8/808mc00hd0g.html >education technology master27s degree online</a> <a href=http://my08g4.dnip.net/5/808mc00hbaa.html>masters degree credit for work experience</a> http://my08g4.dnip.net/8/808mc00hbi7.html <a href=http://my08g4.dnip.net/9/808mc00hbm8.html>lsu online degrees</a> <a href=http://my08g4.dnip.net/2/808mc00hb2f.html>online social science degrees</a> http://my08f10.dnip.net/3/808mc00hc6m.html <a href=http://my08f10.dnip.net/6/808mc00hcfn.html>online blackbelt courses</a> <a href=http://my08f10.dnip.net/8/808mc00hd0e.html>historically black college university distance learning</a> <a href=http://my08g4.dnip.net/3/808mc00hb6n.html >online journalism courses for teachers</a> http://my08f10.dnip.net/6/808mc00hcgb.html <a href=http://my08g4.dnip.net/6/808mc00hbdg.html >online doctorate in education little work</a> http://my08g4.dnip.net/2/808mc00hb2a.html <a href=http://my08f10.dnip.net/3/808mc00hc7a.html >online chiropractic continuing education</a> <a href=http://my08g4.dnip.net/5/808mc00hb9c.html>1755 distance learning accounting degree 2529</a> <a href=http://my08g4.dnip.net/5/808mc00hbbe.html>online media courses in vancouver bc</a> <a href=http://my08g4.dnip.net/1/808mc00ham8.html>on line typing courses</a> <a href=http://my08f10.dnip.net/1/808mc00hc46.html>degree criminal justice career</a> http://my08f10.dnip.net/2/808mc00hc8e.html <a href=http://my08g4.dnip.net/6/j5gfe9g3dd.html>distance learning nothern arizona university</a> <a href=http://my08g4.dnip.net/4/j5gfe9g3cg.html >catholic online college</a> <a href=http://my08f10.dnip.net/9/808mc00hcnk.html >mds course online</a> <a href=http://my08f10.dnip.net/1/808mc00hc2a.html>motruary science degree online</a> <a href=http://my08f10.dnip.net/7/808mc00hcij.html>mba online program university</a> <a href=http://my08g4.dnip.net/0/808mc00hakg.html >online pharmd degree</a> <a href=http://my08g4.dnip.net/6/808mc00hbd3.html>nevada teacher recertification classes online</a> http://my08g4.dnip.net/7/808mc00hbf3.html http://my08f10.dnip.net/3/808mc00hc8h.html <a href=http://my08f10.dnip.net/1/808mc00hc48.html>philippine nursing degrees</a> <a href=http://my08g4.dnip.net/2/808mc00hb2a.html >advanced teaching degree online indiana</a> http://my08f10.dnip.net/0/808mc00hbnf.html <a href=http://my08f10.dnip.net/6/808mc00hcge.html>miramar florida college degrees</a> http://my08g4.dnip.net/4/808mc00hb52.html http://my08f10.dnip.net/0/808mc00hbm0.html <a href=http://my08g4.dnip.net/6/j5gfe9g3d6.html >online phd degree programs criminology</a> <a href=http://my08f10.dnip.net/1/808mc00hc3m.html >nutrition degree online frederica delaware</a> http://my08g4.dnip.net/9/808mc00hbm3.html <a href=http://my08f10.dnip.net/4/808mc00hca2.html >online graduate degree program noatak alaska</a> <a href=http://my08f10.dnip.net/5/808mc00hcgh.html>online java programming class</a>