sipsorcery's blog

Occassional posts about VoIP, SIP, WebRTC and Bitcoin. response times SIP Sorcery Last 3 Hours
daily weekly status

Success initiating Google Voice call via XMPP

I changed a single setting in my Asterisk 1.8 gtalk.conf and bingo my Google Voice call worked. The setting was to specify a stunaddr rather than specifying an externip. It’s probably got something to do with the Amazon EC2 instance my test Asterisk server is running on being behind a NAT. With the call working I was finally to see the raw XMPP packets being sent and copy them into my own C# app and have it initiate a Google Voice call over XMPP.

The code is pretty useless in its current form, all it can do is get a phone to ring. No audio is available. However in theory that’s the hardest part out of the way and it shouldn’t be difficult to translate an incoming SIP request into an outgoing XMPP request.

For anyone curious the XMPP packets that need to be sent to initiate a Google Voice call are shown below. Whatever is sending those packets will need to be authenticated prior to sending them but at least that part of it follows the XMPP standards.

<iq from='' id='1234' to='' type='set'>
    <session xmlns='' type='initiate' id='abcdef12344' initiator=''>
        <description xmlns=''>
            <payload-type id='0' name='PCMU' bitrate='64000' clockrate='8000' />
            <payload-type id='100' name='EG711U' bitrate='64000' clockrate='8000' />
            <payload-type id='101' name='telephone-event' clockrate='8000' />

<iq from='' id='1234' to='' type='set'>
    <session xmlns='' type='candidates' id='abcdef12344' initiator=''>
            generation='0' />
        <transport xmlns=''/>