After some digging, I found the following were not clear to me:
- The configuration file ~/.gvoice is unavaible to Asterisk. I need to invoke gvoice with all necessary arguments.
- The phoneType argument is required for a Gizmo5 ringback number, which is 7. I found the declaration of call in voice.py.
def call(self, outgoingNumber, forwardingNumber=None, phoneType=None, subscriberNumber=None)
. Therefore if I invoke gvoice like this
exten => _X.,n,Set(DB(gv_dialout/channel)=${CHANNEL})
Then it succeeds. RINGBACK is my Gizmo5 747 number and PHONETYPE is 7.
exten => _X.,n,System(/usr/bin/gvoice -e ${ACCTNAME} -p ${ACCTPASS} call ${EXTEN} ${RINGBACK} ${PHONETYPE})
- It's important to set the key gv_dialout/channel in the Asterisk database before calling the system(gvoice) command in [gv-outbound] since it may take a second or two for the System command to return and the chance is good that Asterisk might receive the ring back call from gvoice before the key gv_dialout/channel is set, which caused the bridge command to fail.