Board logo

標題: 【角色茶桌】—— Asterisk 1.8 Workshop 1 :Create two sip accounts and make call to each other (证实可用) [打印本頁]

作者: 角色    時間: 2011-9-24 16:30     標題: 【角色茶桌】—— Asterisk 1.8 Workshop 1 :Create two sip accounts and make call to each other (证实可用)

本帖最後由 角色 於 2011-9-24 20:37 編輯

在以前能再Asterisk 1.4没有问题的,在Asterisk就有些不同。

1)sip.conf 是空的。

2)在users.conf
  1. [2000]
  2. typp=friend
  3. secret=2000
  4. hassip = yes
  5. qualify=yes
  6. nat=no
  7. host=dynamic
  8. canreinvit=no
  9. context=internal

  10. [2001]
  11. typp=friend
  12. secret=2001
  13. hassip = yes
  14. qualify=yes
  15. nat=no
  16. host=dynamic
  17. canreinvit=no
  18. context=internal
複製代碼
3)extensions.conf contains
  1. [internal]
  2. exten => 2000,1,Dial(SIP/2000,,r)
  3. exten => 2001,1,Dial(SIP/2001,,r)
複製代碼
终于搞定,就是SIP Clients问题,如果internal communication,要用hardware ATAs来坐测试为准。

至于software,用于remote ATA。

还有NAT=no,或者NAT=yes,如果是用hardware ATA,应该可以互通。


角色
作者: 角色    時間: 2011-9-24 18:06

本帖最後由 角色 於 2011-9-24 18:07 編輯

用iPad2注册账号2000,可以注册,但是拨打2000不成功。

个log设么都没有。如果把users.conf的内容放在sip.conf, 那么连注册也出问题。看来Asterisk 1.8与Asterisk 1.4真的不一样。


角色
作者: ckleea    時間: 2011-9-24 18:12

User extensions should be in users.conf
作者: 角色    時間: 2011-9-24 18:16

What do you mean? I am a newbie of Asterisk 1.8.

YH
作者: ckleea    時間: 2011-9-24 18:23

My users extensions are all kept in users.conf.
作者: 角色    時間: 2011-9-24 19:09

本帖最後由 角色 於 2011-9-24 19:10 編輯

终于可以打到,但是没有声音。
  1. [2000]
  2. typp=friend
  3. secret=2000
  4. hassip=yes
  5. qualify=yes
  6. nat=yes
  7. host=dynamic
  8. canreinvit=no
  9. context=internal

  10. [2001]
  11. typp=friend
  12. secret=2001
  13. hassip=yes
  14. qualify=yes
  15. nat=yes
  16. host=dynamic
  17. canreinvit=no
  18. context=internal
複製代碼
问题是NAT,问题。



角色
作者: 角色    時間: 2011-9-24 20:17

怎样试都不行,估计还有别的settings才能成功。

角色
作者: ckleea    時間: 2011-9-24 22:24

unusual. what is your setting for each user extensions?
作者: 角色    時間: 2011-9-24 22:30

Already fixed and the answer is shown in the first post of this thread.

YH
作者: ckleea    時間: 2011-9-24 22:55

我想不一定。
作者: 角色    時間: 2011-9-25 17:30

我是用users.conf和extensions.conf,但是bubblestar说,它是用sip.conf和extensions.conf就可以。但是我是先把sip.conf, users.conf, sip_notify.conf, extensions.conf, extensions.ael拷贝和清空,然后自己再一个字一个字打上去。

不知道大家的情况是跟我,还是跟buublestar一样呢?

角色
作者: bubblestar    時間: 2011-9-29 22:54

回復 11# 角色


   
基本上,我只要把Asterisk 1.4 的 sip.conf, extensions.conf 全盤copy 過去 Asterisk 1.8 就可以用了。 如果你是全APL 運作的話,users.conf 便無需用到的。users.conf 入面的extensions 資料,主要是你使用 GUI 介面時,由系統自動建立的。在APL裡建立extensions,跟Asterisk 1.4 完全無分別,統一放到sip.conf 便能完成。
作者: 角色    時間: 2011-9-30 00:04

都是不行,看来我可能有些settings不对。

bubblestar兄是否能提供一些examples呢?

角色
作者: ckleea    時間: 2011-9-30 06:58

Why you still can't make it work?
作者: 角色    時間: 2011-9-30 07:33

I do not know the reason neither.

bubblestar said he can just use sip.conf to make it work but I cannot. I have to use users.conf otherwise NO extension is registered.

YH
作者: bubblestar    時間: 2011-9-30 11:14

sip.conf settings for Asterisk 1.8
  1. [general]
  2. ; Global Settings
  3. bindport = 5060                                        ; Port to bind to (SIP is 5060)
  4. bindaddr = 0.0.0.0                                        ; Bind all addresses on machine
  5. realm = asterisk
  6. useragent = myuseragent
  7. ;sdpsession = myuseragent
  8. allowguest = yes                                        ; Allow or reject guest calls ; set allowguest  =  no for security reason                         
  9. allowsubscribe = yes
  10. canreinvite = no
  11. insecure = port,invite
  12. srvlookup = yes
  13. ;qualifyfreq = 60
  14. ;qualifygap = 100
  15. ;qualifypeers = 1
  16. callevents = no
  17. ;allowexternalinvites = yes
  18. allowexternaldomains = yes
  19. alwaysauthreject = yes                        
  20. allowoverlap = no                                        ; Disable overlap dialing support (Default is yes)                     
  21. allowtransfer = yes                                        ; Disable all transfers                        
  22. videosupport = no
  23. callcounter = yes
  24. t38pt_udptl = yes,fec,maxdatagram = 400
  25. faxdetect = yes


  26. ; Network QoS Settings
  27. tos_sip = CS3                                        ; Sets TOS for SIP packets                    
  28. tos_audio = ef                                        ; Sets TOS for RTP audio packets.                             
  29. tos_video = AF41                                        ; Sets TOS for RTP video packets                                
  30. cos_sip = 3
  31. cos_audio = 5
  32. cos_video = 4
  33. cos_text = 3
  34. jbenable = no
  35. jbforce = no

  36. ; Network Settings
  37. externrefresh = 10
  38. externhost = your_ddns_name                                ; DDNS
  39. fromdomain = your_ddns_name                        ; Optional - force a particular domain        
  40. localnet = xxx.xxx.xxx.xxx/255.255.255.0                        ; Asterisk network address and mask           
  41. stunaddr =
  42. autodomain = no

  43. ; Global Signaling Settings
  44. disallow = all
  45. allow = ulaw
  46. allow = alaw
  47. allow = gsm                                                ; GSM needs low bandwidth than ulaw and alaw
  48. allow = g729
  49. allow = slin
  50. faxdetect = on
  51. rtptimeout = 60
  52. rtpholdtimeout = 300
  53. rtpkeepalive = 20                                               ; Send a keepalive ever 20 Seconds if using NAT
  54. maxexpiry = 3600                                        ; **Engin & BBP Global this if necessary
  55. minexpiry = 60                                       
  56. defaultexpiry = 240                                        ; **Engin users: include users: include this if necessary
  57. registerattempts = 0
  58. registertimeout = 20
  59. relaxdtmf = yes
  60. notifyringing = yes
  61. notifyhold = yes
  62. notifycid = yes
  63. pedantic = no
  64. progressinband = never
  65. promiscredir = no

  66. ; Default Settings
  67. nat = yes
  68. dtmfmode = rfc2833
  69. qualify = yes
  70. context = default                                        ; Send unknown SIP incoming callers to this context
  71. language = en
  72. musicclass = default
  73. mohinterpret = default
  74. mohsuggest = default


  75. [authentication]



  76. [my-settings](!)                                        ; template for the phones
  77. type = friend                                        ; is both peer (out) and user (in)
  78. qualify = yes
  79. nat = yes
  80. host = dynamic
  81. dtmfmode = auto
  82. allow = ulaw,alaw,gsm,g729,slin
  83. context = yourcontextname
  84. canreinvite = no                                        ; set "canreinvite = yes" for all internal extensions. This will let RTP directly flow from Line 1 or other ATA to PSTN without going through Asterisk, thus to minimize the delay
  85. insecure = port,invite
  86. port = 5060
  87. ;musiconhold = default
  88. ;musciclass = default
  89. ;deny=0.0.0.0/0.0.0.0
  90. ;permit=xxx.xxx.xxx/255.255.255.0


  91. [6001](my-settings)
  92. defaultuser = 6001
  93. secret = very_secret_code
  94. mailbox = 6001@default
  95. vmsecret = 6001
  96. dial = SIP/6001                                                       
  97. callerid = "who_is_who" <>
  98. ;accountcode =        
  99. ;callgroup = 1,3-4                                        ; members of groups 1,3 to 4
  100. ;pickupgroup = 1,2-4                                        ; member of "pickup" groups 1,2 to 4
  101. call-limit = 10
  102. musiconhold = default
  103. musciclass = default


  104. [6002](phone-settings)
  105. defaultuser = 6002
  106. secret = very_secret_code
  107. mailbox = 6002@default
  108. vmsecret = 6002
  109. dial = SIP/6002
  110. callerid = "who_am_i" <>
  111. ;accountcode =                        
  112. ;callgroup = 1,3-4                                        ; members of groups 1,3 to 4       
  113. ;pickupgroup = 1,2-4                                        ; member of "pickup" groups 1,2 to 4
  114. call-limit = 10
  115. musiconhold = friends
  116. musciclass = friends
複製代碼

作者: bubblestar    時間: 2011-9-30 11:21

No particular settings required for extensions.conf.  Just config as you do in Asterisk 1.4 or 1.6.

Some terms or names for creation of extension line in the file of sip.conf are different.  So, please pay special care for such changes.  For instance, user name is changed to defaultuser.  Insecure is now set as "port,invite" instead of "very" as that in Asterisk 1.4
作者: 角色    時間: 2011-9-30 16:35

After having tried many combinations, finally I got the simplest form in sip.conf in order to get one extension registered as follows:

sip.conf
  1. [2000]
  2. type = friend
  3. secret=2000
  4. qualify=yes
  5. host=dynamic
  6. context=internal
複製代碼

作者: bubblestar    時間: 2011-9-30 17:26

簡單是美,高興聽到你能做到。

有關你原本不能成功的設定,可否貼上來讓大家分享一下原因呢? Thanks
作者: bubblestar    時間: 2011-9-30 17:38

回復 18# 角色


   
另外,你可以慢慢把insecure、qualify、 allow 之類的東西逐一加上去試試,那樣或者可以知道之前不能成功註冊的原因了。至樣最重要的 nat = yes 是不能缺少的了,你能否通過router跟外界順利通話,這個也是關鍵。
作者: ckleea    時間: 2011-9-30 19:04

Bubblestar Ching is particularly in doing various fine settings. I am a pioneer to test.
作者: ckleea    時間: 2011-9-30 19:06

I am also in flavour to use IAX connection. Zoiper is my best friend
作者: 角色    時間: 2011-9-30 20:36

When I have time, I shall add more switches on it.

YH
作者: 角色    時間: 2011-9-30 22:25

There is another example to demonstrate the use of the sip.conf to set up the Asterisk server as follows:
  1. [2000]
  2. type = friend
  3. secret=2000
  4. nat=yes
  5. qualify=yes
  6. host=dynamic
  7. context=internal

  8. [2001]
  9. type = friend
  10. secret=2001
  11. nat=yes
  12. qualify=yes
  13. host=dynamic
  14. context=internal
複製代碼
Please note the parameter "nat", if nat=no, Zoiper is not got registrated; and if nat=yes, Zoiper is got registrated. Siemens DECT IP Phone can register regardless of the settings of the parameter "nat".

Therefore, it is better to set the parameter "nat=yes" would be better.

YH
作者: 角色    時間: 2011-9-30 22:48

I know the reason that I am not able to get registration. There is a type for the type, I typed it as typp rather the correct one type.

Once the word "typp" is replaced by "type", everything are working fine.

YH
作者: ckleea    時間: 2011-9-30 22:49

回復 25# 角色

you are typing too fast with vi
作者: 角色    時間: 2011-9-30 22:51

Maybe.

YH
作者: bubblestar    時間: 2011-10-1 00:38

回復 21# ckleea


    I am flattered.  I think all of us are aiming at the same goal but just from different approach.
作者: bubblestar    時間: 2011-10-1 00:40

回復 25# 角色


    Congratulations! Welcome on board the Asterisk 1.8 and we are on the same track now.
作者: 角色    時間: 2011-10-1 00:44

Yeah!

角色
作者: ckleea    時間: 2011-10-1 09:49

回復 16# bubblestar


I personally not set any sip user extensions in sip.conf because from the beginning, I use GUI to set up the users. Then I all along work with the users.conf to add users manually. This may be one of the reasons that I need to use Dial(Local/6000) instead of Dial(SIP/6000) to dial within dialplan.

I will try further.

Please note template function is very useful for creating multiple users of similar capability.
作者: bubblestar    時間: 2011-10-1 10:59

Yes, template is very useful indeed.  So that why I choose to use it for extension creation.
作者: 角色    時間: 2011-10-1 11:05

Workable examples are very an important start for the beginners no matter if they are belong to sip.conf or users.conf.

YH




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