PDA

Voir la version complète : chan_sip.c: Received response: "Forbidden" aléatoire et récurrents



bobbywan
05/06/2014, 18h17
Bonjour à tous,

Je rencontre depuis quelques jours un problème avec ma configuration Asterisk que je ne comprends pas du tout, je viens donc demander un peu d'aide à la communauté avant de m'arracher les cheveux :)

Au niveau des symptômes :
Les appels passent correctement, en appelant comme en sortant. Au bout d'un certain nombre d'appel, la conversation s'arrête. Ensuite, les appels ne passent plus. Dans la console d'asterisk je vois ce genre de messages : [Jun 5 16:56:38] WARNING[16337] chan_sip.c: Received response: "Forbidden" from '"bobby" <sip:monnumerosip@monserveurasterisk>;tag=as71899aec'. Si je lance un sip reload dans la console, ça remarche... jusqu'à ce que ça replante.

Au niveau de ma conf
Notre fournisseur SIP est OVH, avec 2 lignes SIP, donc jusqu'à 4 appels simultanés. Mes 2 lignes sont configurées exactement pareil. Quelque soit la ligne qui "saute", les deux sont impactées.

Le sip.conf


[general]
defaultexpiry=3600
allowsubscribe=yes
srvlookup=yes
notifyhold=yes
notifyringing=yes
canreinvite=no
dtmfmode=rfc2833
subscribecontext=device-hints
language=fr
allowguest=no
disallow=all
allow=alaw
allow=ulaw
;nat=never
register => numero1:passwd1@sip.ovh.fr ;ligne1
register => numero2:passwd2@sip.ovh.fr ;ligne2

; TRUNKS

; ligne1
[ligne1-ovh]
type = peer
host = sip.ovh.fr
context = ligne1
username = numero1
fromuser = numero1
secret = passwd1
insecure = port,invite
canreinvite = no
qualify = yes
allow = alaw
allow=ulaw


;ligne 2

[ligne2-ovh]
type = peer
host = sip.ovh.fr
context = ligne2
username = numero2
fromuser = numero2
secret = passwd2
insecure = port,invite
canreinvite = no
qualify = yes
allow = alaw
allow=ulaw

; TEMPLATES

; ligne1
[ligne1](!)
type = friend
context = ligne1
host = dynamic
canreinvite = yes
dtfmode = rfc2833
disallow = all
allow = alaw
allow=ulaw
subscribecontext = internal
canreinvite=no

[ligne2](!)
type = friend
context = ligne2
host = dynamic
canreinvite = yes
dtfmode = rfc2833
disallow = all
allow = alaw
allow=ulaw
subscribecontext = internal
canreinvite=no


mon extensions.conf

[globals]
FEATURES =
DIALOPTIONS =
RINGTIME = 20
FOLLOWMEOPTIONS =
PAGING_HEADER = Intercom

[general]
autofallthrough = yes
language = fr
static = yes
writeprotect = no
clearglobalvars = no

[default]
include => incoming-calls

[incoming-calls]
exten => s,1,Goto(incoming-calls,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)

exten => 0033numero2,1,Goto(ovh-ligne2-incoming,s,1)
exten => +33numero2,1,Goto(ovh-ligne2-incoming,s,1)
exten => numero2,1,Goto(ovh-ligne2-incoming,s,1)

exten => 0033numero1,1,Goto(ovh-ligne1-incoming,s,1)
exten => +33numero1,1,Goto(ovh-ligne1-incoming,s,1)
exten => numero1,1,Goto(ovh-ligne1-incoming,s,1)

[ligne1]
include => incoming-calls
include => ovh-ligne1-incoming
include => ovh-ligne1-outgoing
include => parkedcalls
exten => 300,1,Dial(SIP/unuser,,tTm(predecroche))
exten => 300,n,HangUp()
exten => 400,1,Dial(SIP/unautreuser,,tT)
exten => 400,n,HangUp()

[ovh-ligne1-incoming]
exten => s,1,Answer
exten => s,n,Dial(SIP/unuser,36,tTm(predecroche))
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,VoiceMail(300,u)
exten => s-BUSY,1,VoiceMail(300,b)
exten => s-ANSWER,1,Hangup()
exten => _s-.,1,Goto(s-NOANSWER,1)

[ovh-ligne1-outgoing]
;numéros fixes français
exten => _0XXXXXXXXX,1,Dial(SIP/ligne1-ovh/${EXTEN})
exten => _0XXXXXXXXX,n,Hangup()
exten => _+33XXXXXXXXX,1,Dial(SIP/ligne1-ovh/${EXTEN})
exten => _+33XXXXXXXXX,n,Hangup()
exten => _0033XXXXXXXXX,1,Dial(SIP/ligne1-ovh/${EXTEN})
exten => _0033XXXXXXXXX,n,Hangup()
;numéros Internationaux
exten => _00.,1,Dial(SIP/ligne1-ovh/${EXTEN})
exten => _00.,n,Hangup()
exten => _+.,1,Dial(SIP/ligne1-ovh/${EXTEN})
exten => _+.,n,Hangup()
;numéros d'urgence
exten => _1X,1,Dial(SIP/ligne1-ovh/${EXTEN})
exten => _1X,n,Hangup()
exten => _112,1,Dial(SIP/ligne1-ovh/${EXTEN})
exten => _112,n,Hangup()
;numéros Spéciaux
exten => _Z.,1,Dial(SIP/ligne1-ovh/${EXTEN})
exten => _Z.,n,Hangup()
;numéros invalid
exten => i,1,Playback(invalid)
exten => i,n,Hangup()

[ligne2]
include => incoming-calls
include => ovh-ligne2-incoming
include => ovh-ligne2-outgoing
include => ovh-jo-incoming
include => parkedcalls
exten => 300,1,Dial(SIP/unuser,,tTm(predecroche))
exten => 300,n,HangUp()
exten => 400,1,Dial(SIP/unautreuser,,tT)
exten => 400,n,HangUp()

[ovh-ligne2-incoming]
exten => s,1,Answer
exten => s,n,Ringing
exten => s,n,Dial(SIP/unautreuser,30,tT)
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,VoiceMail(400,u)
exten => s-BUSY,1,VoiceMail(400,b)
exten => s-ANSWER,1,Hangup()
exten => _s-.,1,Goto(s-NOANSWER,1)

[ovh-ligne2-outgoing]
exten => _0XXXXXXXXX,1,Dial(SIP/ligne2-ovh/${EXTEN})
exten => _0XXXXXXXXX,n,Hangup()
exten => _+33XXXXXXXXX,1,Dial(SIP/ligne2-ovh/${EXTEN})
exten => _+33XXXXXXXXX,n,Hangup()
exten => _0033XXXXXXXXX,1,Dial(SIP/ligne2-ovh/${EXTEN})
exten => _0033XXXXXXXXX,n,Hangup()
;numéros d'urgence
exten => _1X,1,Dial(SIP/ligne2-ovh/${EXTEN})
exten => _1X,n,Hangup()
exten => _112,1,Dial(SIP/ligne2-ovh/${EXTEN})
exten => _112,n,Hangup()


Si vous avez une idée pour m'aider dans mes recherches, je ne comprends pas l'origine du problème, je ne sais pas donc pas du tout comment le résoudre :/

Un grand merci !

bobbywan
03/07/2014, 11h05
Bonjour,

un petit UP car je n'ai toujours pas trouvé de solution et le problème a l'air de s'intensifier :(


-- Executing [NUMERODETEST@mycompany:1] Dial("SIP/bobby-000002f4", "SIP/mycompany-ovh/NUMERODETEST") in new stack
== Using SIP RTP CoS mark 5
Audio is at 18128
Adding codec 0x8 (alaw) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 91.121.129.20:5060:
INVITE sip:NUMERODETEST@sip.ovh.fr SIP/2.0
Via: SIP/2.0/UDP 192.168.1.65:5060;branch=z9hG4bK5fcf198a;rport
Max-Forwards: 70
From: "bobby" <sip:NUMEROSIP@192.168.1.65>;tag=as5cd4223f
To: <sip:NUMERODETEST@sip.ovh.fr>
Contact: <sip:NUMEROSIP@192.168.1.65:5060>
Call-ID: 576cbe497214a0f269fb01206fa9bed9@192.168.1.65:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.8.13.1~dfsg1-3+deb7u3
Date: Thu, 03 Jul 2014 08:35:03 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 276

v=0
o=root 2071612286 2071612286 IN IP4 192.168.1.65
s=Asterisk PBX 1.8.13.1~dfsg1-3+deb7u3
c=IN IP4 192.168.1.65
t=0 0
m=audio 18128 RTP/AVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

---
-- Called SIP/mycompany-ovh/NUMERODETEST

<--- SIP read from UDP:91.121.129.20:5060 --->
SIP/2.0 100 Trying
Call-ID: 576cbe497214a0f269fb01206fa9bed9@192.168.1.65:5060
CSeq: 102 INVITE
From: "bobby" <sip:NUMEROSIP@192.168.1.65>;tag=as5cd4223f
To: <sip:NUMERODETEST@sip.ovh.fr>
Via: SIP/2.0/UDP 192.168.1.65:5060;received=109.190.81.107;rport=51 141;branch=z9hG4bK5fcf198a
Content-Length: 0

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

<--- SIP read from UDP:91.121.129.20:5060 --->
SIP/2.0 403 not registered
Call-ID: 576cbe497214a0f269fb01206fa9bed9@192.168.1.65:5060
CSeq: 102 INVITE
From: "bobby" <sip:NUMEROSIP@192.168.1.65>;tag=as5cd4223f
To: <sip:NUMERODETEST@sip.ovh.fr>;tag=00-28615-30b9638c-600e76aa5
Via: SIP/2.0/UDP 192.168.1.65:5060;received=109.190.81.107;rport=51 141;branch=z9hG4bK5fcf198a
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---
set_destination: Parsing <sip:NUMERODETEST@sip.ovh.fr> for address/port to send to
set_destination: set destination to 91.121.129.20:5060
Transmitting (NAT) to 91.121.129.20:5060:
ACK sip:NUMERODETEST@sip.ovh.fr SIP/2.0
Via: SIP/2.0/UDP 192.168.1.65:5060;branch=z9hG4bK5fcf198a;rport
Max-Forwards: 70
From: "bobby" <sip:NUMEROSIP@192.168.1.65>;tag=as5cd4223f
To: <sip:NUMERODETEST@sip.ovh.fr>;tag=00-28615-30b9638c-600e76aa5
Contact: <sip:NUMEROSIP@192.168.1.65:5060>
Call-ID: 576cbe497214a0f269fb01206fa9bed9@192.168.1.65:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 1.8.13.1~dfsg1-3+deb7u3
Content-Length: 0


---
[Jul 3 10:35:03] WARNING[28648]: chan_sip.c:20366 handle_response_invite: Received response: "Forbidden" from '"bobby" <sip:NUMEROSIP@192.168.1.65>;tag=as5cd4223f'
Scheduling destruction of SIP dialog '576cbe497214a0f269fb01206fa9bed9@192.168.1.65:506 0' in 6400 ms (Method: INVITE)
== Everyone is busy/congested at this time (1:0/1/0)
-- Executing [NUMERODETEST@mycompany:2] Hangup("SIP/bobby-000002f4", "") in new stack
== Spawn extension (mycompany, NUMERODETEST, 2) exited non-zero on 'SIP/bobby-000002f4'
Scheduling destruction of SIP dialog '1875073474@192_168_1_16' in 32000 ms (Method: INVITE)

<--- Reliably Transmitting (NAT) to 192.168.1.16:5060 --->
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP 192.168.1.16:5060;branch=z9hG4bK309325a8afaa835e9c ea69bf52c9d04a;received=192.168.1.16;rport=5060
From: "bobby" <sip:bobby@192.168.1.65>;tag=3464006607
To: <sip:NUMERODETEST@192.168.1.65;user=phone>;tag=as4e0be5f3
Call-ID: 1875073474@192_168_1_16
CSeq: 3 INVITE
Server: Asterisk PBX 1.8.13.1~dfsg1-3+deb7u3
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


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

<--- SIP read from UDP:192.168.1.16:5060 --->
ACK sip:NUMERODETEST@192.168.1.65;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.1.16:5060;branch=z9hG4bK309325a8afaa835e9c ea69bf52c9d04a;rport
From: "bobby" <sip:bobby@192.168.1.65>;tag=3464006607
To: <sip:NUMERODETEST@192.168.1.65;user=phone>;tag=as4e0be5f3
Call-ID: 1875073474@192_168_1_16
CSeq: 3 ACK
Contact: <sip:bobby@192.168.1.16:5060>
Authorization: Digest username="bobby", realm="asterisk", algorithm=MD5, uri="sip:NUMERODETEST@192.168.1.65;user=phone", nonce="79167943", response="396122eb27a02110216fa3608acc1279"
Max-Forwards: 70
User-Agent: C610 IP/42.076.00.000.000
Content-Length: 0

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


<--- Transmitting (NAT) to 192.168.1.15:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.15:5060;branch=z9hG4bK3b887104992b0bf9a8 0315fd64419caa;received=192.168.1.15;rport=5060
From: "jo" <sip:jo@192.168.1.65>;tag=73585039
To: "jo" <sip:jo@192.168.1.65>;tag=as48b17a10
Call-ID: 2934619700@192_168_1_15
CSeq: 106450 REGISTER
Server: Asterisk PBX 1.8.13.1~dfsg1-3+deb7u3
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
upported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="14832d6e"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '2934619700@192_168_1_15' in 32000 ms (Method: REGISTER)



<------------>
Scheduling destruction of SIP dialog '295673101@192_168_1_15' in 32000 ms (Method: REGISTER)
Really destroying SIP dialog '896109017@192_168_1_15' Method: REGISTER
Really destroying SIP dialog '1875073474@192_168_1_16' Method: ACK
Really destroying SIP dialog '2617983075@192_168_1_15' Method: REGISTER
Really destroying SIP dialog '2934619700@192_168_1_15' Method: REGISTER

<--- SIP read from UDP:192.168.1.16:5060 --->
REGISTER sip:192.168.1.65 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.16:5060;branch=z9hG4bK1425590e62cb66941b df4eab52565de9;rport
From: "chris" <sip:chris@192.168.1.65>;tag=2316456315
To: "chris" <sip:chris@192.168.1.65>
Call-ID: 3156373780@192_168_1_16
CSeq: 21741 REGISTER
Contact: <sip:chris@192.168.1.16:5060>
Max-Forwards: 70
User-Agent: C610 IP/42.076.00.000.000
Expires: 180
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, REFER, SUBSCRIBE, NOTIFY
Content-Length: 0

<------------->
--- (12 headers 0 lines) ---
Sending to 192.168.1.16:5060 (NAT)




J'ai sorti quelques lignes de debug au moment ou je rencontrais le problème et que je n'arrivais pas à passer un appel, si ça peut aider.

Merci

jean
03/07/2014, 15h02
je crois que qqqun a eu ce meme probleme il y a pas longtemps, et a indiqué qu'en mettant qualify=no , ca résolvait

sbeu
03/07/2014, 21h33
Selon mon expérience j'ai deux choses à te proposer de vérifier:
1) change le mot de passe de ton trunk. La même chose m'était arrivée et en fait j'étais connecté sur le même trunk avec un client zoiper sur une autre machine...
2) Regarde du côté de ovh, ils ont eu des problèmes récemment, qui ont je crois été corrigés, et qui provoquaient ce genre d'erreur

UncleBuzz
23/07/2014, 12h51
Bonjour,

J'ai le même type de soucis, pas forcément pour les mêmes causes mais au cas où je partage :

Mon routeur utilise un port à sa discrétion pour communiquer avec le serveur OVH, tant que la communication passe par le même port, je suis reconnu par OVH, mais si mon routeur change de port, alors bien que tout semble ok, au moment de passer des communications le serveur OVH me rejette.

Pour le voir, il suffit de rechercher le "rport" par lequel OVH a reçu la communication, et comparé avec le port publique enregistré dans le manager d'OVH (c'est le port utilisé par le routeur au moment de l'enregistrement), si il y a une différence, OVH rejettera les appels.

Tu peux essayer de voir si dans tes traces SIP, ton "rport" change régulièrement.


Via: SIP/2.0/UDP 192.168.1.65:5060;received=109.190.81.107;rport=51 141;branch=z9hG4bK5fcf198a

le qualify=yes devrait théoriquement pousser le routeur a maintenir le port ouvert, chez moi ça coince côté routeur et j'ai ce genre de soucis.