Gizmo5 calls don't always connect to FastAGI (Java) script

wxyzwxyz
Joined: Sun 07 of Mar, 2010

Gizmo5 calls don't always connect to FastAGI (Java) script

Posted:Sun 07 of Mar, 2010 (07:31 UTC)
I'd like to point out right at the start that I've only been working with Asterisk for a few days now so please excuse my ignorance of certain matters.

I'm building an IVR system with http://asterisk-java.org for a class project. That's coming along alright, at the moment.

Today, I realized that I could use my Google Voice account to forward calls to my Gizmo5 account and have those calls received on my Asterisk server so that I could use an actual phone (as opposed to a SIP softphone on my computer) to demo the project.

So I've spent some time trying to get this to work - the trouble is that 50% of the time, while the call gets to the Asterisk server, it seems to be terminated almost as soon as it begins. I can't figure out why this is happening - as I see it, since it does get through half the time, I must've setup most of the configuration correctly.

Here's what I have:
sip.conf

[general]
register => 1747XXXXXXX:password@proxy01.sipphone.com
port = 5060
bindaddr = 0.0.0.0
context = default
rtpstart=10000
rtpend=20000
externip=98.XXX.XXX.XXX ;required behind NAT
localnet=192.168.1.0/255.255.255.0 ;required behind NAT
;sipdebug=yes
nat=yes

[Calls-From-Gizmo-Network]
type=user
context=default
disallow=all
allow=ulaw
allow=ilbc
allow=gsm
dtmfmode=rfc2833
host=proxy01.sipphone.com
insecure=yes
username=1747XXXXXXX
secret=password
canreinvite=no

[alice]
type=friend
username=alice
secret=password
host=dynamic
context=default
mailbox=8080

[bob]
type=friend
username=bob
secret=password
host=dynamic
context=default
mailbox=8181



extensions.conf

[general]
static = yes
writeprotect = no
clearglobalvars = no
priorityjumping=yes

[globals]
CONSOLE = Console/dsp  ; Console interface for demo

[default]
exten => s,1,Ringing
exten => s,2,Wait(2)
exten => s,n,Answer
exten => s,n,Agi(agi://localhost/hello.agi)


I turned on SIP debugging and it looks like when the call is dropped prematurely, the caller sends a BYE message almost immediately after setting up (at least that's how I understand it, I'm not an expert with SIP). Here's what the unsuccessful call's SIP flow looks like.

Note that I've obfuscated my Gizmo5 number, the calling number and my public IP address.


<--- SIP read from UDP:198.65.166.131:5060 --->
INVITE sip:s@192.168.1.4 SIP/2.0
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Record-Route: <sip:74.125.240.118;lr=on>
Max-Forwards: 17
To: <sip:747XXXXXXX>
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK605a.4d298487.0
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK605a.3d298487.0
Via: SIP/2.0/UDP 74.125.240.118;branch=z9hG4bK605a.a3c0f475.0
Via: SIP/2.0/UDP 74.125.240.102:5061;received=74.125.240.102;rport=5061;branch=z9hG4bK905479408
From: <sip:+1404XXXXXXX@74.125.240.102>;tag=736660197
Call-ID: 4881150@74.125.240.102
CSeq: 975893 INVITE
User-Agent: YATE/2.0.0
Contact: <sip:+1404XXXXXXX@74.125.240.102:5061>
Allow: ACK, INVITE, BYE, CANCEL, REGISTER, REFER, OPTIONS, INFO
Content-Type: application/sdp
Content-Length: 187
RemoteIP: 74.125.240.118
X-GoogleVoice: trueP-hint: local number (2)
Subject: via Google Voice 

v=0
o=yate 1267943716 1267943716 IN IP4 74.125.240.102
s=SIP Call
c=IN IP4 74.125.240.102
t=0 0
m=audio 18542 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000

<------------->
--- (21 headers 8 lines) ---
  == Using SIP RTP CoS mark 5
Sending to 198.65.166.131 : 5060 (NAT)
Using INVITE request as basis request - 4881150@74.125.240.102
No matching peer for '+1404XXXXXXX' from '198.65.166.131:5060'
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - 0x8000e (gsm|ulaw|alaw|h263), peer - audio=0x4 (ulaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x4 (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 74.125.240.102:18542
Looking for s in default (domain 192.168.1.4)
list_route: hop: <sip:198.65.166.131;lr;ftag=736660197>
list_route: hop: <sip:198.65.166.131;lr;ftag=736660197>
list_route: hop: <sip:74.125.240.118;lr=on>

<--- Transmitting (NAT) to 198.65.166.131:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK605a.4d298487.0;received=198.65.166.131
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK605a.3d298487.0
Via: SIP/2.0/UDP 74.125.240.118;branch=z9hG4bK605a.a3c0f475.0
Via: SIP/2.0/UDP 74.125.240.102:5061;received=74.125.240.102;rport=5061;branch=z9hG4bK905479408
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Record-Route: <sip:74.125.240.118;lr=on>
From: <sip:+1404XXXXXXX@74.125.240.102>;tag=736660197
To: <sip:747XXXXXXX>
Call-ID: 4881150@74.125.240.102
CSeq: 975893 INVITE
Server: Asterisk PBX 1.6.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:s@98.XXX.XXX.XXX>
Content-Length: 0


<------------>
    -- Executing [s@default:1] Ringing("SIP/74.125.240.102-00000005", "") in new stack

<--- Transmitting (NAT) to 198.65.166.131:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK605a.4d298487.0;received=198.65.166.131
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK605a.3d298487.0
Via: SIP/2.0/UDP 74.125.240.118;branch=z9hG4bK605a.a3c0f475.0
Via: SIP/2.0/UDP 74.125.240.102:5061;received=74.125.240.102;rport=5061;branch=z9hG4bK905479408
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Record-Route: <sip:74.125.240.118;lr=on>
From: <sip:+1404XXXXXXX@74.125.240.102>;tag=736660197
To: <sip:747XXXXXXX>;tag=as01fddb18
Call-ID: 4881150@74.125.240.102
CSeq: 975893 INVITE
Server: Asterisk PBX 1.6.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:s@98.XXX.XXX.XXX>
Content-Length: 0


<------------>
    -- Executing [s@default:2] Wait("SIP/74.125.240.102-00000005", "2") in new stack
    -- Executing [s@default:3] Answer("SIP/74.125.240.102-00000005", "") in new stack
Audio is at 98.XXX.XXX.XXX port 14036
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (NAT) to 198.65.166.131:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK605a.4d298487.0;received=198.65.166.131
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK605a.3d298487.0
Via: SIP/2.0/UDP 74.125.240.118;branch=z9hG4bK605a.a3c0f475.0
Via: SIP/2.0/UDP 74.125.240.102:5061;received=74.125.240.102;rport=5061;branch=z9hG4bK905479408
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Record-Route: <sip:74.125.240.118;lr=on>
From: <sip:+1404XXXXXXX@74.125.240.102>;tag=736660197
To: <sip:747XXXXXXX>;tag=as01fddb18
Call-ID: 4881150@74.125.240.102
CSeq: 975893 INVITE
Server: Asterisk PBX 1.6.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:s@98.XXX.XXX.XXX>
Content-Type: application/sdp
Content-Length: 263

v=0
o=root 519316424 519316424 IN IP4 98.XXX.XXX.XXX
s=Asterisk PBX 1.6.2.2
c=IN IP4 98.XXX.XXX.XXX
t=0 0
m=audio 14036 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------>

<--- SIP read from UDP:198.65.166.131:5060 --->
ACK sip:s@192.168.1.4:5060 SIP/2.0
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK605a.3d298487.2
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK605a.3d298487.2
Via: SIP/2.0/UDP 74.125.240.118;branch=z9hG4bK605a.a3c0f475.2
Via: SIP/2.0/UDP 74.125.240.102:5061;received=74.125.240.102;rport=5061;branch=z9hG4bK1713724445
From: <sip:+1404XXXXXXX@74.125.240.102>;tag=736660197
To: <sip:747XXXXXXX>;tag=as01fddb18
Call-ID: 4881150@74.125.240.102
CSeq: 975893 ACK
Max-Forwards: 17
Contact: <sip:+1404XXXXXXX@74.125.240.102:5061>
User-Agent: YATE/2.0.0
Content-Length: 0
P-hint: rr-enforced
P-hint: rr-enforced


<------------->
--- (17 headers 0 lines) ---

<--- SIP read from UDP:198.65.166.131:5060 --->
BYE sip:s@192.168.1.4:5060 SIP/2.0
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Call-ID: 4881150@74.125.240.102
From: <sip:+1404XXXXXXX@74.125.240.102>;tag=736660197
To: <sip:747XXXXXXX>;tag=as01fddb18
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK305a.a82efb82.0
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK305a.982efb82.0
Via: SIP/2.0/UDP 74.125.240.118;branch=z9hG4bK305a.225ab094.0
Via: SIP/2.0/UDP 74.125.240.102:5061;received=74.125.240.102;rport=5061;branch=z9hG4bK1509985867
CSeq: 975894 BYE
User-Agent: YATE/2.0.0
Max-Forwards: 67
Allow: ACK, INVITE, BYE, CANCEL, REGISTER, REFER, OPTIONS, INFO
Content-Length: 0
RemoteIP: 74.125.240.118
P-hint: rr-enforced
P-hint: rr-enforced


<------------->
--- (18 headers 0 lines) ---
Sending to 198.65.166.131 : 5060 (NAT)

<--- Transmitting (NAT) to 198.65.166.131:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK305a.a82efb82.0;received=198.65.166.131
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK305a.982efb82.0
Via: SIP/2.0/UDP 74.125.240.118;branch=z9hG4bK305a.225ab094.0
Via: SIP/2.0/UDP 74.125.240.102:5061;received=74.125.240.102;rport=5061;branch=z9hG4bK1509985867
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
Record-Route: <sip:198.65.166.131;lr;ftag=736660197>
From: <sip:+1404XXXXXXX@74.125.240.102>;tag=736660197
To: <sip:747XXXXXXX>;tag=as01fddb18
Call-ID: 4881150@74.125.240.102
CSeq: 975894 BYE
Server: Asterisk PBX 1.6.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0


<------------>
  == Spawn extension (default, s, 3) exited non-zero on 'SIP/74.125.240.102-00000005'
Really destroying SIP dialog '4881150@74.125.240.102' Method: BYE
Really destroying SIP dialog '3388bb4f4e01f1500e1c580476761032@127.0.1.1' Method: REGISTER

<--- SIP read from UDP:192.168.1.2:9883 --->



<------------->


This is what the successful call flow looks like


<--- SIP read from UDP:198.65.166.131:5060 --->
INVITE sip:s@192.168.1.4 SIP/2.0
Record-Route: <sip:198.65.166.131;lr;ftag=1727740493>
Record-Route: <sip:198.65.166.131;lr;ftag=1727740493>
Record-Route: <sip:74.125.240.118;lr=on>
Max-Forwards: 17
To: <sip:747XXXXXXX>
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK2766.53dee2a1.0
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK2766.43dee2a1.0
Via: SIP/2.0/UDP 74.125.240.118;branch=z9hG4bK2766.fa41e386.0
Via: SIP/2.0/UDP 74.125.240.103:5061;received=74.125.240.103;rport=5061;branch=z9hG4bK1885632956
From: <sip:+1404XXXXXXX@74.125.240.103>;tag=1727740493
Call-ID: 1586688448@74.125.240.103
CSeq: 973654 INVITE
User-Agent: YATE/2.0.0
Contact: <sip:+1404XXXXXXX@74.125.240.103:5061>
Allow: ACK, INVITE, BYE, CANCEL, REGISTER, REFER, OPTIONS, INFO
Content-Type: application/sdp
Content-Length: 187
RemoteIP: 74.125.240.118
X-GoogleVoice: trueP-hint: local number (2)
Subject: via Google Voice 

v=0
o=yate 1267944376 1267944376 IN IP4 74.125.240.103
s=SIP Call
c=IN IP4 74.125.240.103
t=0 0
m=audio 31340 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000

<------------->
--- (21 headers 8 lines) ---
  == Using SIP RTP CoS mark 5
Sending to 198.65.166.131 : 5060 (NAT)
Using INVITE request as basis request - 1586688448@74.125.240.103
No matching peer for '+1404XXXXXXX' from '198.65.166.131:5060'
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - 0x8000e (gsm|ulaw|alaw|h263), peer - audio=0x4 (ulaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x4 (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 74.125.240.103:31340
Looking for s in default (domain 192.168.1.4)
list_route: hop: <sip:198.65.166.131;lr;ftag=1727740493>
list_route: hop: <sip:198.65.166.131;lr;ftag=1727740493>
list_route: hop: <sip:74.125.240.118;lr=on>

<--- Transmitting (NAT) to 198.65.166.131:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK2766.53dee2a1.0;received=198.65.166.131
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK2766.43dee2a1.0
Via: SIP/2.0/UDP 74.125.240.118;branch=z9hG4bK2766.fa41e386.0
Via: SIP/2.0/UDP 74.125.240.103:5061;received=74.125.240.103;rport=5061;branch=z9hG4bK1885632956
Record-Route: <sip:198.65.166.131;lr;ftag=1727740493>
Record-Route: <sip:198.65.166.131;lr;ftag=1727740493>
Record-Route: <sip:74.125.240.118;lr=on>
From: <sip:+1404XXXXXXX@74.125.240.103>;tag=1727740493
To: <sip:747XXXXXXX>
Call-ID: 1586688448@74.125.240.103
CSeq: 973654 INVITE
Server: Asterisk PBX 1.6.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:s@98.XXX.XXX.XXX>
Content-Length: 0


<------------>
    -- Executing [s@default:1] Ringing("SIP/74.125.240.103-00000000", "") in new stack

<--- Transmitting (NAT) to 198.65.166.131:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK2766.53dee2a1.0;received=198.65.166.131
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK2766.43dee2a1.0
Via: SIP/2.0/UDP 74.125.240.118;branch=z9hG4bK2766.fa41e386.0
Via: SIP/2.0/UDP 74.125.240.103:5061;received=74.125.240.103;rport=5061;branch=z9hG4bK1885632956
Record-Route: <sip:198.65.166.131;lr;ftag=1727740493>
Record-Route: <sip:198.65.166.131;lr;ftag=1727740493>
Record-Route: <sip:74.125.240.118;lr=on>
From: <sip:+1404XXXXXXX@74.125.240.103>;tag=1727740493
To: <sip:747XXXXXXX>;tag=as248949e1
Call-ID: 1586688448@74.125.240.103
CSeq: 973654 INVITE
Server: Asterisk PBX 1.6.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:s@98.XXX.XXX.XXX>
Content-Length: 0


<------------>
    -- Executing [s@default:2] Wait("SIP/74.125.240.103-00000000", "2") in new stack
    -- Executing [s@default:3] Answer("SIP/74.125.240.103-00000000", "") in new stack
Audio is at 98.XXX.XXX.XXX port 14808
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (NAT) to 198.65.166.131:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK2766.53dee2a1.0;received=198.65.166.131
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK2766.43dee2a1.0
Via: SIP/2.0/UDP 74.125.240.118;branch=z9hG4bK2766.fa41e386.0
Via: SIP/2.0/UDP 74.125.240.103:5061;received=74.125.240.103;rport=5061;branch=z9hG4bK1885632956
Record-Route: <sip:198.65.166.131;lr;ftag=1727740493>
Record-Route: <sip:198.65.166.131;lr;ftag=1727740493>
Record-Route: <sip:74.125.240.118;lr=on>
From: <sip:+1404XXXXXXX@74.125.240.103>;tag=1727740493
To: <sip:747XXXXXXX>;tag=as248949e1
Call-ID: 1586688448@74.125.240.103
CSeq: 973654 INVITE
Server: Asterisk PBX 1.6.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:s@98.XXX.XXX.XXX>
Content-Type: application/sdp
Content-Length: 263

v=0
o=root 560980874 560980874 IN IP4 98.XXX.XXX.XXX
s=Asterisk PBX 1.6.2.2
c=IN IP4 98.XXX.XXX.XXX
t=0 0
m=audio 14808 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------>
    -- Executing [s@default:4] AGI("SIP/74.125.240.103-00000000", "agi://localhost/hello.agi") in new stack
    -- Playing 'sounds/welcome' (escape_digits=) (sample_offset 0)

<--- SIP read from UDP:198.65.166.131:5060 --->
ACK sip:s@192.168.1.4:5060 SIP/2.0
Record-Route: <sip:198.65.166.131;lr;ftag=1727740493>
Record-Route: <sip:198.65.166.131;lr;ftag=1727740493>
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK2766.43dee2a1.2
Via: SIP/2.0/UDP 198.65.166.131;branch=z9hG4bK2766.43dee2a1.2
Via: SIP/2.0/UDP 74.125.240.118;branch=z9hG4bK2766.fa41e386.2
Via: SIP/2.0/UDP 74.125.240.103:5061;received=74.125.240.103;rport=5061;branch=z9hG4bK1393122916
From: <sip:+1404XXXXXXX@74.125.240.103>;tag=1727740493
To: <sip:747XXXXXXX>;tag=as248949e1
Call-ID: 1586688448@74.125.240.103
CSeq: 973654 ACK
Max-Forwards: 17
Contact: <sip:+1404XXXXXXX@74.125.240.103:5061>
User-Agent: YATE/2.0.0
Content-Length: 0
P-hint: rr-enforced
P-hint: rr-enforced


<------------->
--- (17 headers 0 lines) ---
    -- Playing 'sounds/shortcode' (escape_digits=0123456789#*) (timeout 5000)
    -- Playing 'sounds/press' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'digits/1' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'sounds/for' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'sounds/nb-service' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'sounds/press' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'digits/2' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'sounds/for' (escape_digits=0123456789#*) (sample_offset 0)
[Mar  7 01:46:33] WARNING[3145]: file.c:650 ast_openstream_full: File sounds/directory-service does not exist in any format
Really destroying SIP dialog '210b7c3972775ace5605216968348bc8@127.0.1.1' Method: REGISTER
    -- Playing 'sounds/beeperr' (escape_digits=) (sample_offset 0)
    -- Playing 'sounds/press' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'digits/1' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'sounds/for' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'sounds/nb-service' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'sounds/press' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'digits/2' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'sounds/for' (escape_digits=0123456789#*) (sample_offset 0)
[Mar  7 01:46:42] WARNING[3145]: file.c:650 ast_openstream_full: File sounds/directory-service does not exist in any format
    -- Playing 'sounds/beeperr' (escape_digits=) (sample_offset 0)
    -- Playing 'sounds/press' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'digits/1' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'sounds/for' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'sounds/nb-service' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'sounds/press' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'digits/2' (escape_digits=0123456789#*) (sample_offset 0)
    -- Playing 'sounds/for' (escape_digits=0123456789#*) (sample_offset 0)
[Mar  7 01:46:51] WARNING[3145]: file.c:650 ast_openstream_full: File sounds/directory-service does not exist in any format
    -- AGI Script Executing Application: (Agi) Options: (agi://localhost:4573/nb.agi)
    -- Playing 'sounds/n-b' (escape_digits=) (sample_offset 0)
    -- <SIP/74.125.240.103-00000000> Playing 'digits/1.gsm' (language 'en')
    -- Playing 'minutes' (escape_digits=) (sample_offset 0)
    -- Playing 'sounds/and' (escape_digits=) (sample_offset 0)
    -- <SIP/74.125.240.103-00000000> Playing 'digits/16.gsm' (language 'en')
    -- Playing 'minutes' (escape_digits=) (sample_offset 0)
    -- Playing 'sounds/welcome' (escape_digits=) (sample_offset 0)
    -- <SIP/74.125.240.103-00000000>AGI Script agi://localhost:4573/nb.agi completed, returning 0
    -- <SIP/74.125.240.103-00000000>AGI Script agi://localhost/hello.agi completed, returning 0
    -- Auto fallthrough, channel 'SIP/74.125.240.103-00000000' status is 'UNKNOWN'
Scheduling destruction of SIP dialog '1586688448@74.125.240.103' in 32000 ms (Method: ACK)
set_destination: Parsing <sip:198.65.166.131;lr;ftag=1727740493> for address/port to send to
set_destination: set destination to 198.65.166.131, port 5060
Reliably Transmitting (NAT) to 198.65.166.131:5060:
BYE sip:+1404XXXXXXX@74.125.240.103:5061 SIP/2.0
Via: SIP/2.0/UDP 98.XXX.XXX.XXX:5060;branch=z9hG4bK41c21aa4;rport
Route: <sip:198.65.166.131;lr;ftag=1727740493>,<sip:198.65.166.131;lr;ftag=1727740493>,<sip:74.125.240.118;lr=on>
Max-Forwards: 70
From: <sip:747XXXXXXX>;tag=as248949e1
To: <sip:+1404XXXXXXX@74.125.240.103>;tag=1727740493
Call-ID: 1586688448@74.125.240.103
CSeq: 102 BYE
User-Agent: Asterisk PBX 1.6.2.2
X-Asterisk-HangupCause: Unknown
X-Asterisk-HangupCauseCode: 0
Content-Length: 0


---

<--- SIP read from UDP:198.65.166.131:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.4:5060;branch=z9hG4bK41c21aa4;rport=55216
Record-Route: <sip:198.65.166.131;lr;ftag=as248949e1>
Record-Route: <sip:198.65.166.131;lr;ftag=as248949e1>
From: <sip:747XXXXXXX>;tag=as248949e1
To: <sip:+1404XXXXXXX@74.125.240.103>;tag=1727740493
Call-ID: 1586688448@74.125.240.103
CSeq: 102 BYE
Server: YATE/2.0.0
Allow: ACK, INVITE, BYE, CANCEL, REGISTER, REFER, OPTIONS, INFO
Content-Length: 0
RemoteIP: 74.125.240.118


<------------->
--- (12 headers 0 lines) ---
SIP Response message for INCOMING dialog BYE arrived
Really destroying SIP dialog '1586688448@74.125.240.103' Method: ACK



I've forwarded the following ports as pointed out by various articles and forum answers:
69
4569
5004
5060-5063
10000-20000

I'm not quite sure what to make of this since, as already mentioned, I *can* get through sometimes while other times I can't. Restarting the server when I can't, seems to help (but not always).

I'd be grateful for suggestions or workarounds! :)