返回列表 發帖

【角色茶桌】—— 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,,)
複製代碼
角色

回復 1# 角色


    See my post here as well

http://www.telecom-cafe.com/foru ... &extra=page%3D1

TOP

Many thanks.

YH

TOP

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

YH

TOP

本帖最後由 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()
複製代碼

TOP

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

TOP

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.

TOP

回復 5# bubblestar

I can't remember now as not using it frequently.

TOP

本帖最後由 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

TOP

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

YH

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

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

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

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

角色

TOP

回復 1# 角色


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

TOP

返回列表