返回列表 發帖

【角色茶桌】—— Asterisk 1.8 + Multiple GV accounts

本帖最後由 角色 於 2011-9-28 01:51 編輯

因为有了Asterisk 1.8,那么就可以安装多于一个GV account,方便其他member使用,所以起这幅帖子方便大家集中讨论的安装办法。

下面有关于这方面的安装:
http://forums.digium.com/viewtopic.php?f=1&t=76250

=============== 解决方案 =========================
jabber.conf
  1. [general]
  2. autoregister=yes


  3. [trunk-gv-leo]  ; For GV-outbound trunk
  4. type=client
  5. serverhost=talk.google.com
  6. username=leo@gmail.com/Talk
  7. secret=password of leo gv account
  8. port=5222
  9. usetls=yes
  10. usesasl=yes
  11. statusmessage="I am an Asterisk Server"
  12. timeout=100

  13. [trunk-gv-polly]  ; For GV-outboud trunk
  14. type=client
  15. serverhost=talk.google.com
  16. username=polly@gmail.com/Talk
  17. secret=passowrd of polly gv adcount
  18. port=5222
  19. usetls=yes
  20. usesasl=yes
  21. statusmessage="I am an Asterisk Server"
  22. timeout=100
  23. ~
複製代碼
gtalk.conf
  1. [general]
  2. context=local
  3. allowguests=yes
  4. bindaddr=0.0.0.0
  5. externip=xxx.xxx.xxx.xxx
  6. allowguest=no

  7. [guest]
  8. disallow=all
  9. allow=ulaw
  10. context=from-GV
  11. ;connection=asterisk
  12. ;connection=trunk-GV-leo
複製代碼
sip.conf
  1. [general]
  2. srvlookup=yes
複製代碼
users.conf
  1. [2001]
  2. typp=friend
  3. secret=2001
  4. hassip=yes
  5. qualify=yes
  6. nat=yes
  7. host=dynamic
  8. canreinvit=no
  9. context=internal

  10. [2002]
  11. typp=friend
  12. secret=2002
  13. hassip=yes
  14. qualify=yes
  15. nat=yes
  16. host=dynamic
  17. canreinvit=no
  18. context=internal
複製代碼
extensions.conf
  1. [trunk-gv]
  2. exten => _1011XXXXXXXXXX,1,Dial(gtalk/trunk-gv-leo/+${EXTEN:3}@voice.google.com)
  3. exten => _1021XXXXXXXXXX,1,Dial(gtalk/trunk-gv-polly/+${EXTEN:3}@voice.google.com)

  4. [internal]
  5. include => trunk-gv

  6. exten => 2001,1,Dial(SIP/2001,,r)
  7. exten => 2002,1,Dial(SIP/2002,,r)

  8. ; * This extension is where any external SIP calls should route to
  9. [from-GV]

  10. exten => leo@gmail.com,1,Set(CALLERID(number)=${CALLERID(name):1:10})
  11. exten => leo@gmail.com,n,Set(CALLERID(name)=${CALLERID(number)})
  12. exten => leo@gmail.com,n,Answer()
  13. exten => leo@gmail.com,n,Wait(2)
  14. exten => leo@gmail.com,n,SendDTMF(1)
  15. exten => leo@gmail.com,n,Dial(SIP/2001,,)


  16. exten => polly@gmail.com,1,Set(CALLERID(number)=${CALLERID(name):1:10})
  17. exten => polly@gmail.com,n,Set(CALLERID(name)=${CALLERID(number)})
  18. exten => polly@gmail.com,n,Answer()
  19. exten => polly@gmail.com,n,Wait(2)
  20. exten => polly@gmail.com,n,SendDTMF(1)
  21. exten => polly@gmail.com,n,Dial(SIP/2002,,)
複製代碼
角色

回復 22# 角色


    Very interesting to look at their outbound rules which can assign different gv account based on the rules.

TOP

There is another thread discussing about the multiple GV accounts on Asterisk 1.8 box.

http://www.mitbbs.com/clubarticle_t/voip/31224603.html

YH

TOP

回復 19# bubblestar

Many thanks for reminding me.

YH

TOP

回復 19# bubblestar


    Updated

TOP

本帖最後由 bubblestar 於 2011-10-2 11:45 編輯

回復 11# ckleea


   
Since the total telephone number including the country code 1 is 11 digits instead of 10, another modification should be made as below to indicate all numbers.  Otherwise, the last digit will be truncated.  Would ckleea c-hing put this into his script to reflect the whole picture for our future reference.  Thanks.

Set(CALLERID(number)=${CALLERID(name):1:11})

This will show up 11 digits including US code 1


If users do not want to show all 11 digits on the screen display, the code should be:

Set(CALLERID(number)=${CALLERID(name):2:10})

This will show up 10 digits excluding US code 1

TOP

For detail, we make take a look at the sample of sip.conf.

YH

TOP

回復 16# 角色


    It is my fault just copy and paste. Now just use allowguest =no

TOP

I just copied from the example and I am sorry that I do not know the exact meaning of each of them. Perhaps, we have looked into the sample file for gtalk.conf.sample.

YH

TOP

回復 1# 角色


   
Curious to know the reason why both "allowguests = yes" and "allowguest = no" appeared in the [general] section of gtalk.conf.

TOP

现在在Asterisk 1.8能把多GV账号输入,可以按自己的要求去打出和介入,还有来电显示都安装国际ITU标准,整体效果非常好,我在这里非常感谢bubblestar和ckleea兄的鼎力协助,不然我不会在那么快就弄好这个项目。

角色

TOP

With ckleea's and bubblestar's effort, the example would not be so complete such that other members who have to develop Asterisk 1.8 with multiple GV accounts may use it as an initial reference.

YH

TOP

Thanks ckleea for his effort to modify the GV incoming code.  Now we have an easy-to-read script to handle and generate caller id number display in a familiar and correct format.

TOP

本帖最後由 ckleea 於 2011-10-2 12:28 編輯

Bubblestar has indeed given the code for quite sometimes. My original codes can show callerid as 1xxxxxxxx@voice.goggle.com-mcxmnvmvnm.
Applying this modification, the callerid is now 9 digits US number

A further modification is to

Set(CALLERID(number)=${CALLERID(name):1:11})

This will show up 11 digits including US country code 1

TOP

Thank you very much and the program code has been modified accordingly.

YH

TOP

返回列表