Board logo

標題: 【角色茶桌】—— Asterisk 1.8 + Multiple GV accounts [打印本頁]

作者: 角色    時間: 2011-9-25 12:06     標題: 【角色茶桌】—— 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,,)
複製代碼
角色
作者: ckleea    時間: 2011-9-25 17:09

回復 1# 角色


    See my post here as well

http://www.telecom-cafe.com/foru ... &extra=page%3D1
作者: 角色    時間: 2011-9-25 17:23

Many thanks.

YH
作者: 角色    時間: 2011-9-27 00:47

Asterisk 1.8 + Multiple GV accounts is complete. Inbound and outbound calls are easily resolved right now.

YH
作者: bubblestar    時間: 2011-9-27 10:23

本帖最後由 bubblestar 於 2011-9-27 10:26 編輯

Curious to know the Caller ID display status in the incoming settings.  In your configuration of [from-gv], you use account@gmail.com.  Can we expect to see the REAL Caller ID number on our telephone set when someone dial in? Or we can only see the Google Voice's server telephone number instead. I ask because I use the following settings and it can show the real caller id number.  Yours is neat and easier for everyone to understand.  If it can generate the same effect, I would rather take yours.
  1. [from-gv]                                                       
  2. exten => _[@Xa-z].,1,Noop(Incoming Google Voice call for ${EXTEN})
  3. same => n,Set(CALLERID(number)=${CALLERID(name):2:10})        ; make known of the calling party
  4. same => n,Set(CALLERID(name)=${CALLERID(number)})
  5. same => n,Answer()
  6. same => n,Wait(2)
  7. same => n,SendDTMF(1)
  8. same => n,Dial(SIP/1001,30)
  9. exten => h,1,Hangup()
複製代碼

作者: 角色    時間: 2011-9-27 11:38

For the time being, my Siemens IP shows a complete incoming caller information on phone LCD. I believe that we have to cut off some characters from it in order to show it correctly, for example +1 (xxx) yyy zzzzz.

I know that there are some script can handle it.

YH
作者: bubblestar    時間: 2011-9-27 13:50

What I mean is real CALLER's Number ID instead of GV Server's Caller number.  The latter one is useless to me.  My existing script can handle it very well with correct number.  Since your script seems less complicated so that why I ask whether it can indicate REAL CALLER NUMBER ID like mine.  If it does, I will follow yours.

Sorry for my poor explanation.
作者: ckleea    時間: 2011-9-27 14:20

回復 5# bubblestar

I can't remember now as not using it frequently.
作者: ckleea    時間: 2011-9-27 21:14

本帖最後由 ckleea 於 2011-9-27 21:19 編輯

The caller ID work,

Just put these 2 lines in front of my scripts for each email account. When dial in, you can have 9 digits US number



revised script is here

http://www.telecom-cafe.com/foru ... &extra=page%3D1
作者: 角色    時間: 2011-9-27 22:25

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

YH
作者: ckleea    時間: 2011-9-27 22:32

本帖最後由 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
作者: bubblestar    時間: 2011-9-27 23:57

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.
作者: 角色    時間: 2011-9-28 01:30

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
作者: 角色    時間: 2011-9-28 07:38

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

角色
作者: bubblestar    時間: 2011-9-30 12:11

回復 1# 角色


   
Curious to know the reason why both "allowguests = yes" and "allowguest = no" appeared in the [general] section of gtalk.conf.
作者: 角色    時間: 2011-9-30 15:14

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
作者: ckleea    時間: 2011-9-30 22:19

回復 16# 角色


    It is my fault just copy and paste. Now just use allowguest =no
作者: 角色    時間: 2011-10-1 22:53

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

YH
作者: bubblestar    時間: 2011-10-2 11:41

本帖最後由 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
作者: ckleea    時間: 2011-10-2 12:29

回復 19# bubblestar


    Updated
作者: 角色    時間: 2011-10-2 20:40

回復 19# bubblestar

Many thanks for reminding me.

YH
作者: 角色    時間: 2011-10-19 09:07

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
作者: ckleea    時間: 2011-10-19 12:26

回復 22# 角色


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




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