Bonjour à tous,

Je rencontre un petit souci lors d'un Dial depuis un serveur asterisk vers un trunk SIP (type completel mais également cisco), la sonnerie s'arrête après environ 30 secondes, indépendamment du timeout spécifié. (Si le timeout est inférieur à 30 sec, la sonnerie s'arrête bien au temps désiré, mais ne dépasse jamais les 30 sec).

J'ai lu ici et là qu'il s'agissait d'un problème de NAT, mais je n'ai pas trouvé (ou compris ) de solutions. Je passe par un proxy SIP Kamailio. J'utilise la version d'Asterisk 1.8.17.0 que j'ai installé classiquement depuis les sources.

J'ai fait un debug SIP :

Code:

INVITE sip:00582743866@10.1.9.5 SIP/2.0
Via: SIP/2.0/UDP 10.1.3.233:5060;branch=z9hG4bK1121c8b3;rport
Max-Forwards: 70
From: "0123456789" <sip:0123456789@10.1.3.233>;tag=as087c91b7
To: <sip:00582743866@10.1.9.5>
Contact: <sip:0123456789@10.1.3.233:5060>
Call-ID: 793ea1960b6db6961d64db3618655a7c@10.1.3.233:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.8.17.0
Date: Tue, 28 May 2013 07:27:49 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 231

v=0
o=root 204944793 204944793 IN IP4 10.1.3.233
s=Asterisk PBX 1.8.17.0
c=IN IP4 10.1.3.233
t=0 0
m=audio 16486 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

---



<--- SIP read from UDP:10.1.3.240:5060 --->
SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP 10.1.3.233:5060;branch=z9hG4bK1121c8b3;rport=5060
From: "0123456789" <sip:0123456789@10.1.3.233>;tag=as087c91b7
To: <sip:00582743866@10.1.9.5>
Call-ID: 793ea1960b6db6961d64db3618655a7c@10.1.3.233:5060
CSeq: 102 INVITE
Server: kamailio (3.3.0 (x86_64/linux))
Content-Length: 0

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


<--- SIP read from UDP:10.1.3.240:5060 --->
SIP/2.0 183 Session Progress
Date: Tue, 28 May 2013 07:32:22 GMT
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER
From: "0123456789" <sip:0123456789@10.1.3.233>;tag=as087c91b7
Allow-Events: telephone-event
Supported: sdp-anat
Remote-Party-ID: <sip:00582743866@10.1.9.5>;party=called;screen=no;privacy=off
Content-Length: 179
To: <sip:00582743866@10.1.9.5>;tag=D0C52F2C-1FEC
Contact: <sip:00582743866@10.1.9.5:5060>
C

Content-Type: application/sdp
Call-ID: 793ea1960b6db6961d64db3618655a7c@10.1.3.233:5060
Via: SIP/2.0/UDP 10.1.3.233:5060;branch=z9hG4bK1121c8b3;rport=5060
CSeq: 102 INVITE
Server: Cisco-SIPGateway/IOS-12.x
Record-Route: <sip:10.1.3.240;lr=on>

v=0
o=CiscoSystemsSIP-GW-UserAgent 7232 6826 IN IP4 10.1.9.5
s=SIP Call
c=IN IP4 10.1.9.5
t=0 0
m=audio 17098 RTP/AVP 0
c=IN IP4 10.1.9.5
a=rtpmap:0 PCMU/8000
a=ptime:20
<------------->



Found RTP audio format 0
Found audio description format PCMU for ID 0
Capabilities: us - 0x4 (ulaw), peer - audio=0x4 (ulaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x4 (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 10.1.9.5:17098


<--- SIP read from UDP:10.1.3.240:5060 --->
SIP/2.0 183 Session Progress
Date: Tue, 28 May 2013 07:32:22 GMT
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER
From: "0123456789" <sip:0123456789@10.1.3.233>;tag=as087c91b7
Allow-Events: telephone-event
Supported: sdp-anat
Remote-Party-ID: <sip:00582743866@10.1.9.5>;party=called;screen=no;privacy=off
Content-Length: 179
To: <sip:00582743866@10.1.9.5>;tag=D0C52F2C-1FEC
Contact: <sip:00582743866@10.1.9.5:5060>
C

Content-Type: application/sdp
Call-ID: 793ea1960b6db6961d64db3618655a7c@10.1.3.233:5060
Via: SIP/2.0/UDP 10.1.3.233:5060;branch=z9hG4bK1121c8b3;rport=5060
CSeq: 102 INVITE
Server: Cisco-SIPGateway/IOS-12.x
Record-Route: <sip:10.1.3.240;lr=on>

v=0
o=CiscoSystemsSIP-GW-UserAgent 7232 6826 IN IP4 10.1.9.5
s=SIP Call
c=IN IP4 10.1.9.5
t=0 0
m=audio 17098 RTP/AVP 0
c=IN IP4 10.1.9.5
a=rtpmap:0 PCMU/8000
a=ptime:20
<------------->

list_route: hop: <sip:10.1.3.240;lr=on>
    -- SIP/cisco-000000ce is making progress passing it to Local/s@dso-command-00002a7d;2



OPTIONS sip:10.1.3.240 SIP/2.0
Via: SIP/2.0/UDP 10.1.3.233:5060;branch=z9hG4bK3d7d9839;rport
Max-Forwards: 70
From: "asterisk" <sip:asterisk@10.1.3.233>;tag=as55bed21d
To: <sip:10.1.3.240>
Contact: <sip:asterisk@10.1.3.233:5060>
Call-ID: 75b4b24424b79ed77a61b9931ceafcde@10.1.3.233:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 1.8.17.0
Date: Tue, 28 May 2013 07:28:14 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:10.1.3.240:5060 --->
SIP/2.0 484 Address Incomplete
Via: SIP/2.0/UDP 10.1.3.233:5060;branch=z9hG4bK3d7d9839;rport=5060
From: "asterisk" <sip:asterisk@10.1.3.233>;tag=as55bed21d
To: <sip:10.1.3.240>;tag=b27e1a1d33761e85846fc98f5f3a7e58.dd62
Call-ID: 75b4b24424b79ed77a61b9931ceafcde@10.1.3.233:5060
CSeq: 102 OPTIONS
Server: kamailio (3.3.0 (x86_64/linux))
Content-Length: 0

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

Really destroying SIP dialog '75b4b24424b79ed77a61b9931ceafcde@10.1.3.233:5060' Method: OPTIONS


OPTIONS sip:10.1.9.5 SIP/2.0
Via: SIP/2.0/UDP 10.1.3.233:5060;branch=z9hG4bK4eb93c1b;rport
Max-Forwards: 70
From: "asterisk" <sip:asterisk@10.1.3.233>;tag=as6e2ee137
To: <sip:10.1.9.5>
Contact: <sip:asterisk@10.1.3.233:5060>
Call-ID: 1796e674563be7cb40eaf7bb3123a7d2@10.1.3.233:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 1.8.17.0
Date: Tue, 28 May 2013 07:28:14 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH


Content-Length: 0


---

SIP/2.0 200 OK
Date: Tue, 28 May 2013 07:32:46 GMT
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER
From: "asterisk" <sip:asterisk@10.1.3.233>;tag=as6e2ee137
Allow-Events: telephone-event
Supported: 100rel,resource-priority,replaces,sdp-anat
Content-Length: 157
To: <sip:10.1.9.5>;tag=D0C58E60-1A1D
Content-Type: application/sdp
Call-ID: 1796e674563be7cb40eaf7bb3123a7d2@10.1.3.233:5060
Accept: application/sdp
Via: SIP/2.0/UDP 10.1.3.233:5060;branch=z9hG4bK4eb93c1b;rport
Server: Cisco-SIPGateway/IOS-12.x
CSeq: 102 OPTIONS

v=0
o=CiscoSystemsSIP-GW-UserAgent 5489 5914 IN IP4 10.1.9.5
s=SIP Call
c=IN IP4 10.1.9.5
t=0 0
m=audio 0 RTP/AVP 18 0 8 9 4 2 15 3
c=IN IP4 10.1.9.5
<------------->
--- (14 headers 7 lines) ---
Really destroying SIP dialog '1796e674563be7cb40eaf7bb3123a7d2@10.1.3.233:5060' Method: OPTIONS


CANCEL sip:00582743866@10.1.9.5 SIP/2.0
Via: SIP/2.0/UDP 10.1.3.233:5060;branch=z9hG4bK1121c8b3;rport
Max-Forwards: 70
From: "0123456789" <sip:0123456789@10.1.3.233>;tag=as087c91b7
To: <sip:00582743866@10.1.9.5>
Call-ID: 793ea1960b6db6961d64db3618655a7c@10.1.3.233:5060
CSeq: 102 CANCEL
User-Agent: Asterisk PBX 1.8.17.0
Content-Length: 0

<--- SIP read from UDP:10.1.3.240:5060 --->
SIP/2.0 200 canceling
Via: SIP/2.0/UDP 10.1.3.233:5060;branch=z9hG4bK1121c8b3;rport=5060
From: "0123456789" <sip:0123456789@10.1.3.233>;tag=as087c91b7
To: <sip:00582743866@10.1.9.5>;tag=a6a1c5f60faecf035a1ae5b6e96e979a-2a48
Call-ID: 793ea1960b6db6961d64db3618655a7c@10.1.3.233:5060
CSeq: 102 CANCEL
Server: kamailio (3.3.0 (x86_64/linux))
Content-Length: 0

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

P read from UDP:10.1.3.240:5060 --->
SIP/2.0 487 Request Cancelled
Reason: Q.850;cause=16
Date: Tue, 28 May 2013 07:32:51 GMT
From: "0123456789" <sip:0123456789@10.1.3.233>;tag=as087c91b7
Allow-Events: telephone-event
Content-Length: 0
To: <sip:00582743866@10.1.9.5>;tag=D0C52F2C-1FEC
Call-ID: 793ea1960b6db6961d64db3618655a7c@10.1.3.233:5060
Via: SIP/2.0/UDP 10.1.3.233:5060;branch=z9hG4bK1121c8b3;rport=5060
CSeq: 102 INVITE
Server: Cisco-SIPGateway/IOS-12.x

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


Transmitting (NAT) to 10.1.3.240:5060:
ACK sip:00582743866@10.1.9.5:5060 SIP/2.0
Via: SIP/2.0/UDP 10.1.3.233:5060;branch=z9hG4bK1121c8b3;rport
Max-Forwards: 70
From: "0123456789" <sip:0123456789@10.1.3.233>;tag=as087c91b7
To: <sip:00582743866@10.1.9.5>;tag=D0C52F2C-1FEC
Contact: <sip:0123456789@10.1.3.233:5060>
Call-ID: 793ea1960b6db6961d64db3618655a7c@10.1.3.233:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 1.8.17.0
Content-Length: 0
---

cvgVMasterisk1*CLI> 
Scheduling destruction of SIP dialog '793ea1960b6db6961d64db3618655a7c@10.1.3.233:5060' in 12800 ms (Method: INVITE)
Et voici ma configuration sip.conf

Code:
[general]
context=incoming-sip                 
udpbindaddr=10.1.3.233                                
tcpenable=no                    
tcpbindaddr=0.0.0.0             
srvlookup=yes                   
qualify=yes
disallow=all                   
allow=ulaw                     
outboundproxy=10.1.3.240
t1min=200                      
timert1=700                    
timerb=45000                   
rtptimeout=60                  
rtpholdtimeout=300             
rtpkeepalive=15            
allowsubscribe=no              
directmedia=no
[authentication]

[basic-options](!)                
        dtmfmode=rfc2833
        context=from-office
        type=friend

[natted-phone](!,basic-options)   
        nat=yes
        directmedia=no
        host=dynamic

[public-phone](!,basic-options)   
        nat=no
        directmedia=yes

[my-codecs](!)                    
        disallow=all
        allow=ilbc
        allow=g729
        allow=gsm
        allow=g723
        allow=ulaw

[ulaw-phone](!)                   
        disallow=all
        allow=ulaw

#include </etc/asterisk/peers/*.conf>
Si quelqu'un a une piste, je suis preneur.

Merci d'avance,

Eric