Board logo

標題: 【角色茶桌】—— QNAP TS-119 Asterisk 1.8 Installation [打印本頁]

作者: 角色    時間: 2011-10-14 07:33     標題: 【角色茶桌】—— QNAP TS-119 Asterisk 1.8 Installation

本帖最後由 角色 於 2011-10-14 21:13 編輯

其实以前都有想过怎样在QNAP NAS安装Asterisk 1.8, 主要目的是可以安装到Google Voice和其他codec。

参考link: http://forum.qnap.com/viewtopic. ... mp;p=230131#p230131

现在已经安装的ipkg packages:

1) svn
2) gawk
  1. ipkage install optware-devel
複製代碼
  1. export PATH=/opt/bin:$PATH
  2. export LDFLAGS="-L/opt/lib"
  3. export CFLAGS="-I/opt/include"
  4. export LD_LIBRARY_PATH=/opt/lib
複製代碼
  1. ./configure --build=arm-gnu-linux
複製代碼
  1. ./configure --prefix=/type/here/the/custom/path
複製代碼
  1. ./configure --prefix=/opt/asterisk-1.8 --build=arm-gnu-linux
複製代碼

作者: bubblestar    時間: 2011-10-14 09:58

本帖最後由 bubblestar 於 2011-10-14 15:51 編輯

It is a great to hear that!  If they can also make it and put it into QPKG as well, I hope I can apply on my TS109.  I know they are going to do it and release once the the installation succeeds.
作者: 角色    時間: 2011-10-14 13:23

  1. configure: creating ./config.status
  2. config.status: creating build_tools/menuselect-deps
  3. gawk: ./confldX1rf/subs.awk:2: S["/; s/!.*/"]=LTLIBOBJS!%!_!# ""
  4. gawk: ./confldX1rf/subs.awk:2:                          ^ syntax error
  5. gawk: ./confldX1rf/subs.awk:3: S["/; s/!.*/"]=LTLIBOBJS!%!_!# ""
  6. gawk: ./confldX1rf/subs.awk:3:                              ^ syntax error
  7. gawk: ./confldX1rf/subs.awk:4: S["/; s/!.*/"]=PBX_SYSLOG!1%!_!# "1"
  8. gawk: ./confldX1rf/subs.awk:4:                                ^ syntax error
  9. gawk: ./confldX1rf/subs.awk:5: S["/; s/!.*/"]=PBX_SYSLOG_FACILITY_LOG_UUCP!1%!_!
複製代碼
To solve the above problem, we have to install the optware-devel package
  1. ipkage install optware-devel
複製代碼

作者: 角色    時間: 2011-10-14 13:27

  1. export PATH=/opt/bin:$PATH
複製代碼

作者: 角色    時間: 2011-10-14 13:32

本帖最後由 角色 於 2011-10-14 13:48 編輯
  1. gcc -g -c -D_GNU_SOURCE -Wall   -c -o menuselect_stub.o menuselect_stub.c
  2. gcc -o menuselect menuselect.o strcompat.o menuselect_stub.o mxml/libmxml.a
  3. make[2]: Leaving directory `/share/HDA_DATA/.qpkg/Optware/src/asterisk/1.8/menuselect'
  4. menuselect/nmenuselect: error while loading shared libraries: libnewt.so.0.52: cannot open shared object file: No such file or directory
  5. menuselect changes NOT saved!
  6. make[1]: Leaving directory `/share/HDA_DATA/.qpkg/Optware/src/asterisk/1.8'
  7. [/opt/src/asterisk/1.8] #
複製代碼
Solved by
  1. export PATH=/opt/bin:$PATH
  2. export LDFLAGS="-L/opt/lib"
  3. export CFLAGS="-I/opt/include"
  4. export LD_LIBRARY_PATH=/opt/lib
複製代碼

作者: 角色    時間: 2011-10-14 13:38

Finally I am able to obtain the following menuselect image:

10-14-2011 1-30-28 PM.png

YH

圖片附件: 10-14-2011 1-30-28 PM.png (2011-10-14 13:38, 16.95 KB) / 下載次數 572
http://www.telecom-cafe.com/forum/attachment.php?aid=967&k=78ae52321a53afad311dddbb129362dd&t=1713953878&sid=x99uL7


作者: 角色    時間: 2011-10-14 14:11

本帖最後由 角色 於 2011-10-14 14:39 編輯

Error message
  1. Assembler messages:
  2. Error: unknown architecture `armv5tel'

  3. Error: unrecognized option -march=armv5tel
  4. src/add.c:1: error: bad value (armv5tel) for -march= switch
  5. make[2]: *** [src/add.o] Error 1
  6. make[1]: *** [gsm/lib/libgsm.a] Error 2
  7. make: *** [codecs] Error 2
複製代碼
Resolved by
  1. ./configure --build=arm-gnu-linux
複製代碼

作者: 角色    時間: 2011-10-14 14:37

本帖最後由 角色 於 2011-10-15 11:36 編輯

终于可以complilation成功:
  1.   
  2. +--------- Asterisk Build Complete ---------+
  3. + Asterisk has successfully been built, and +
  4. + can be installed by running:              +
  5. +                                           +
  6. +                make install               +
  7. +-------------------------------------------+
  8. [/opt/src/asterisk/1.8] #
複製代碼

作者: ckleea    時間: 2011-10-14 16:08

行到嗎?
作者: 角色    時間: 2011-10-14 17:45

I have not installed it because I forgot to change the installation location.

The default will be /opt/etc/asterisk. I would like to change it to other location.

YH
作者: 角色    時間: 2011-10-14 22:06

终于可以运行没有问题。
  1. Asterisk SVN-branch-1.8-r340809, Copyright (C) 1999 - 2011 Digium, Inc. and others.
  2. Created by Mark Spencer <markster@digium.com>
  3. Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
  4. This is free software, with components licensed under the GNU General Public
  5. License version 2 and other licenses; you are welcome to redistribute it under
  6. certain conditions. Type 'core show license' for details.
  7. =========================================================================
  8.   == Parsing '/opt/asterisk-1.8/etc/asterisk/asterisk.conf':   == Found
  9.   == Parsing '/opt/asterisk-1.8/etc/asterisk/extconfig.conf':   == Found
複製代碼

作者: 角色    時間: 2011-10-14 22:11

现在下载Asterisk 1.8.7.0 tar ball, 然后再重新recompile。

角色
作者: 角色    時間: 2011-10-14 22:17

  1. ./configure --prefix=/opt/asterisk-1.8.7.0 --build=arm-gnu-linux
複製代碼
  1. configure: Menuselect build configuration successfully completed

  2.                .$$$$$$$$=..
  3.             .$7$7..          .7$7:.
  4.           .$:.                 ,$7.7
  5.         .$7.     7$$           .$77
  6.      ..$.       $$$            .$$7
  7.     ..7$   .?.   $$$   .?.       7$$.
  8.    $.$.   .$$7. $$7 .7$$.      .$$.
  9. .777.   .$$$77$$77$$$7.      $$,
  10. $$~      .7$$$$$$$7.       .$$.
  11. .$7          .7$$$$7:          ?$$.
  12. $$          ?7$$$$$I        .$$7
  13. $$       .7$$$$$$$$      :$$.
  14. $$       $$$7$$$$$$    .$$.
  15. $$        $$   7$$7  .$$    .$$.
  16. $$             $$7         .$$.
  17. 7$$7            7$$        7$$
  18. $$$                        $$
  19.   $$7.                       $  (TM)
  20.    $$$$.           .7$$$  $
  21.      $$$$$$7$$$$$.$$$
  22.        $$$$$$$$.

  23. configure: Package configured for:
  24. configure: OS type  : linux-gnu
  25. configure: Host CPU : arm
  26. configure: build-cpu:vendor:os: arm : gnu : linux-gnu :
  27. configure: host-cpu:vendor:os: arm : gnu : linux-gnu :
  28. [/opt/src/asterisk-1.8.7.0] #
複製代碼

作者: 角色    時間: 2011-10-14 22:58

make 也没有问题。
  1.    [AR] hash/hash.o hash/hash_bigkey.o hash/hash_buf.o hash/hash_func.o hash/hash_log2.o hash/hash_page.o hash/ndbm.o btree/bt_close.o btree/bt_conv.o btree/bt_debug.o btree/bt_delete.o btree/bt_get.o btree/bt_open.o btree/bt_overflow.o btree/bt_page.o btree/bt_put.o btree/bt_search.o btree/bt_seq.o btree/bt_split.o btree/bt_utils.o db/db.o mpool/mpool.o recno/rec_close.o recno/rec_delete.o recno/rec_get.o recno/rec_open.o recno/rec_put.o recno/rec_search.o recno/rec_seq.o recno/rec_utils.o -> libdb1.a
  2.    [LD] abstract_jb.o acl.o alaw.o aoc.o app.o ast_expr2.o ast_expr2f.o asterisk.o astfd.o astmm.o astobj2.o audiohook.o autochan.o autoservice.o bridging.o callerid.o ccss.o cdr.o cel.o channel.o chanvars.o cli.o config.o data.o datastore.o db.o devicestate.o dial.o dns.o dnsmgr.o dsp.o enum.o event.o features.o file.o fixedjitterbuf.o frame.o framehook.o fskmodem.o global_datastores.o hashtab.o heap.o http.o image.o indications.o io.o jitterbuf.o loader.o lock.o logger.o manager.o md5.o netsock.o netsock2.o pbx.o plc.o poll.o privacy.o rtp_engine.o say.o sched.o security_events.o sha1.o slinfactory.o srv.o ssl.o stdtime/localtime.o strcompat.o strings.o stun.o syslog.o taskprocessor.o tcptls.o tdd.o term.o test.o threadstorage.o timing.o translate.o udptl.o ulaw.o utils.o version.o xml.o xmldoc.o editline/libedit.a db1-ast/libdb1.a  -> asterisk
  3. Building Documentation For: channels pbx apps codecs formats cdr cel bridges funcs tests main res addons
  4. +--------- Asterisk Build Complete ---------+
  5. + Asterisk has successfully been built, and +
  6. + can be installed by running:              +
  7. +                                           +
  8. +                make install               +
  9. +-------------------------------------------+
  10. [/opt/src/asterisk-1.8.7.0] #
複製代碼

作者: 角色    時間: 2011-10-14 23:01

make install

再用下面方式运行Asterisk
  1. [/opt/asterisk-1.8.7.0] # /opt/asterisk-1.8.7.0/sbin/asterisk
  2. [/opt/asterisk-1.8.7.0] # /opt/asterisk-1.8.7.0/sbin/asterisk -rvvvvvvvvvvvvvvvv
  3. Asterisk 1.8.7.0, Copyright (C) 1999 - 2011 Digium, Inc. and others.
  4. Created by Mark Spencer <markster@digium.com>
  5. Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
  6. This is free software, with components licensed under the GNU General Public
  7. License version 2 and other licenses; you are welcome to redistribute it under
  8. certain conditions. Type 'core show license' for details.
  9. =========================================================================
  10.   == Parsing '/opt/asterisk-1.8.7.0/etc/asterisk/asterisk.conf':   == Found
  11.   == Parsing '/opt/asterisk-1.8.7.0/etc/asterisk/extconfig.conf':   == Found
  12. Connected to Asterisk 1.8.7.0 currently running on TWTS119 (pid = 23208)
  13. Verbosity was 0 and is now 16
  14. TWTS119*CLI>
複製代碼

作者: 角色    時間: 2011-10-14 23:41

本帖最後由 角色 於 2011-10-15 11:36 編輯

打电话时没有问题,但是cli出很多的warnings:
  1. [Oct 14 23:26:19] WARNING[24044]: chan_sip.c:24433 handle_incoming: Misrouted SIP response '401 Unauthorized' with Call-ID '49a5c7b46b5f20152a31083a2dacca59@xxx.homeftp.org', too many vias
  2. [Oct 14 23:26:19] WARNING[24044]: chan_sip.c:24433 handle_incoming: Misrouted SIP response '401 Unauthorized' with Call-ID '4aa9469639d296680abc03032c1c40f6@xxx.homeftp.org', too many vias
  3. TWTS119*CLI>
  4. Disconnected from Asterisk server
  5. Executing last minute cleanups
複製代碼
可能是把之前Asterisk 1.4的东西全搬过去,所以出了这样的问题。现在从新清空sip.conf,extensions.conf,然后慢慢加入基本的东西,而没有问题。

知道问题在那里,就是ET263 register => 出问题。

角色
作者: 角色    時間: 2011-10-14 23:48

I believe that it might be due to the incorrect package installed during the "make install" process.

YH
作者: bubblestar    時間: 2011-10-14 23:53

Just talk with YH using his new Asterisk 1.8 in QNAP NAS.  The voice and sound quality is very good.  Hope YH can get a fruitful success.
作者: 角色    時間: 2011-10-15 06:27

After installation, if you exit the xterm / ssh login, when you start the asterisk, you may experience the following error:
  1. /opt/asterisk-1.8.7.0/sbin/asterisk
  2. /opt/asterisk-1.8.7.0/sbin/asterisk: error while loading shared libraries: libssl.so.0.9.8: cannot open shared object file: No such file or directory
複製代碼
This can be resolved by
  1. export PATH=/opt/bin:$PATH
  2. export LDFLAGS="-L/opt/lib"
  3. export CFLAGS="-I/opt/include"
  4. export LD_LIBRARY_PATH=/opt/lib
複製代碼

作者: 角色    時間: 2011-10-15 06:35

本帖最後由 角色 於 2011-10-15 06:56 編輯

Asterisk changed from 1.4 to 1.8, the iax gives the following error:
  1. [Oct 15 06:26:50] ERROR[13845]: chan_iax2.c:4911 handle_call_token: Call rejected, CallToken Support required. If unexpected, resolve by placing address 90.130.18.241 in the calltokenoptional list or setting user 2201 requirecalltoken=no
複製代碼
This can be resolved by placing
  1. [2201]
  2. requirecalltoken=no
複製代碼
in the user 2201.
作者: ckleea    時間: 2011-10-15 07:11

回復 20# 角色

This is usually required. Perhaps you have not used IAX clients as frequent as I have.
作者: 角色    時間: 2011-10-15 07:35

There is some problem in recognising the incoming digit in the IVR. I do not know whether it comes with default voice in gsm form. What I used in the NAS Asterisk 1.4.22 is u-law.

YH
作者: 角色    時間: 2011-10-15 07:43

There is some problem in recognising the incoming digit in the IVR. I do not know whether it comes w ...
角色 發表於 2011-10-15 07:35


I am sorry that I forward my ivr to an incorrect one. Now the ivr using HKBN 2b is fixed.

YH
作者: 角色    時間: 2011-10-15 09:53

The date/time in cdr is incorrect, it use GMT in the cdr.conf. We have to modify accordingly.
  1. [csv]
  2. ;usegmtime=yes    ; log date/time in GMT.  Default is "no"
  3. usegmtime=no     ; YH 15-10-11
複製代碼
YH
作者: ckleea    時間: 2011-10-15 10:13

回復 23# 角色


    Couldyou post your sip.conf [general] and hkbn2b setting again?
作者: 角色    時間: 2011-10-15 11:01

回復 25# ckleea

1. Put the following line to /etc/hosts
  1. 203.80.89.135   s2hkbntel.net s21.hkbntel.net
複製代碼
2. sip.conf
  1. [general]
  2. srvlookup=yes
  3. nat=yes
  4. realm=xxx.yyy.org
  5. externhost=xxx.yyy.org
  6. fromdomain=xxx.yyy.org
  7. localnet=192.168.1.0/255.255.255.0
  8. externrefresh = 1
  9. defaultexpirey=120
  10. bindport=5060
  11. qualify=yes
  12. disallow=all
  13. allow=ulaw,alaw,gsm
  14. alwaysauthreject=yes
  15. tos_sip=cs3
  16. tos_audio=ef
  17. tos_video=af41
  18. context=front-desk


  19. ;HKBN 2b
  20. register => 36112233hk:2b_password@s2hkbntel.net:5060/36112233


  21. [hkbn2b]
  22. type=peer
  23. username=36112233hk
  24. secret=2b_password
  25. port=5060
  26. host=s2hkbntel.net
  27. fromuser=36112233hk
  28. fromdomain=s2hkbntel.net
  29. canreinvite=no
  30. canredirect = no
  31. insecure=port,invite
  32. dtmfmode=auto
  33. context=from-hkbn
複製代碼
3. extensions.conf
  1. ;HK PSTN Gateway, with CID
  2. [trunk-hk-pstn-yh9]
  3. exten => _9XX.,1,Dial(SIP/${EXTEN:1}@hkbn2b,,r)


  4. ;HKBN 2b dial-in
  5. [from-hkbn]
  6. exten => 36112233,1,GotoIf($[${CALLERID(num)} = 96xxxyyy]?YH-call)
  7. exten => 36112233,n,GotoIf($[${CALLERID(num)} = 64xxxyyy]?Paul-call)

  8. exten => 36112233,n,Dial(SIP/2004,,)
  9. exten => 36112233,n,Hangup()

  10. exten => 36112233,n(YH-call),GoTo(internal,1130,1)
  11. exten => 36112233,n(Paul-call),Goto(internal-paul-ivr,1131,1);

  12. [internal]
  13. ;TW IVR
  14. exten => 1130,1,Answer
  15. exten => 1130,n,Wait(3)
  16. exten => 1130,n,Background(vm-enter-num-to-call)
  17. exten => 1130,n,WaitExten
  18. exten => 1130,n,Playback(vm-goodbye)
  19. exten => 1130,n,Hangup
  20. exten => i,1,Playback(pbx-invalid)
  21. exten => i,2,Goto(1130,1)
  22. exten => t,1,Playback(vm-goodbye)
  23. exten => t,2,n,Hangup

  24. [inter-paul-ivr]
  25. exten => _1,1,Dial(SIP/21xx,,)
  26. exten => _2,1,Dial(SIP/21yy,,)

  27. exten => 1131,1,Answer
  28. exten => 1131,n,Wait(3)
  29. exten => 1131,n,Background(vm-enter-num-to-call)
  30. exten => 1131,n,WaitExten
  31. exten => 1131,n,Playback(vm-goodbye)
  32. exten => 1131,n,Hangup
  33. exten => i,1,Playback(pbx-invalid)
  34. exten => i,2,Goto(1131,1)
  35. exten => t,1,Playback(vm-goodbye)
  36. exten => t,2,n,Hangup
複製代碼

作者: ckleea    時間: 2011-10-15 11:18

My only difference is the hosts file, I can only register at S22, not s21
作者: bubblestar    時間: 2011-10-15 11:47

回復 24# 角色


   
How about the /var/log/Asterisk/messages? Is the time also correct?
作者: 角色    時間: 2011-10-15 11:50

回復 28# bubblestar

The time is correct
  1. [Oct 15 11:16:29] NOTICE[20130] chan_sip.c: Peer '2023' is now Reachable. (272ms / 2000ms)
  2. [Oct 15 11:26:11] NOTICE[20130] chan_sip.c: Peer '2023' is now Lagged. (3303ms / 2000ms)
  3. [Oct 15 11:26:22] NOTICE[20130] chan_sip.c: Peer '2023' is now Reachable. (273ms / 2000ms)
  4. [Oct 15 11:27:22] NOTICE[20130] chan_sip.c: Peer '2027' is now UNREACHABLE!  Last qualify: 1541
  5. [Oct 15 11:27:33] NOTICE[20130] chan_sip.c: Peer '2027' is now Reachable. (963ms / 2000ms)
  6. [Oct 15 11:39:07] NOTICE[20130] chan_sip.c: Peer '2023' is now Lagged. (2444ms / 2000ms)
  7. [Oct 15 11:39:18] NOTICE[20130] chan_sip.c: Peer '2023' is now Reachable. (624ms / 2000ms)
複製代碼

作者: bubblestar    時間: 2011-10-15 12:40

本帖最後由 bubblestar 於 2011-10-15 12:44 編輯

YH, Congratulations for running both Asterisk 1.8 and Asterisk 1.4 parallel on the same machine of QNAP NAS.  It might or might not be a breakthrough but sure it is a very good try to manipulate and maximize the use of our limited resources. The test just made between you and me proved very successful.  Please keep this on and share with us what you have done.

Many thanks
作者: 角色    時間: 2011-10-15 17:49

I am trying to download the Asterisk 1.4.42 tar ball to my QNAP NAS for compilation and to see how it goes.

YH
作者: ckleea    時間: 2011-10-16 07:57

回復 26# 角色


    YH, what is your allowguest setting in sip.conf? Do you set it or use Yes?
作者: 角色    時間: 2011-10-16 08:20

回復 32# ckleea

I did not set it at all.

YH
作者: ckleea    時間: 2011-10-16 08:34

回復 33# 角色


    I see this is one of the reasons that your 2b can go in. If you set it to NO, you will see the difference.
作者: ckleea    時間: 2011-10-16 08:35

Perhaps, my router and asterisk security are set too high
作者: 角色    時間: 2011-10-16 08:54

回復 35# ckleea

With the settings allowguest = no, there is not much different. The whole system works fine.

YH




歡迎光臨 電訊茶室 (http://www.telecom-cafe.com/forum/) Powered by Discuz! 7.2