Delay before outgoing calls from gateway

Hi, i’m having issue when calling out from my gateway.

The problem comes out when i’m trying to call:
when i’m calling the number from my phone i’m getting ~6 sec delay before my phone rings.
It’s not a big problem for me, but when incoming call is being forwarded through one of gateways this 6 seconds disorient the caller and he can hang up his phone, ant it’s not good.

This is asterisk log, which appears instantly after placing a call:

== Using SIP RTP CoS mark 5
– Executing [705XXXXXXXXXX@call-out:2] Dial(“SIP/212-000004ee”, “SIP/705/XXXXXXXXXX”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/705/705XXXXXXXXXX
– SIP/705-000004ef is making progress passing it to SIP/212-000004ee
0xb6f44f78 – Probation passed - setting RTP source address to XXX.XX.XX.207:18910

And after ~6 seconds when phone starts to call log continues with this:

> 0xb6f7b5c0 -- Probation passed - setting RTP source address to XXX.XX.XX.XX:23032
>   == Spawn extension (call-out, 705XXXXXXXXXX, 2) exited non-zero on 'SIP/212-000004ee'

my sip.conf:

[gateway](!)
type=friend
context=incoming
host=dynamic
secret=XXXXXXXXXXXXXXXX
nat=no
trustrpid=yes
qualify=yes
canreinvite=no
callgroup=1
pickupgroup=1
call-limit=3
dtmfmode=RFC2833
disallow=all
allow=alaw
allow=ulaw
allow=g729
allow=g723
allow=g722

[705](gateway)
callerid="GW2"

Could it be wrong setup of gateway or asterisk?
Any suggestions?

Regards,
Nufay.

I’d suggest providing the output of “sip set debug on” and “rtp set debug on”. It may be that we aren’t receiving anything from the remote side for that period of time.