A weird working... without VPN doesn't work!

Hello all,

I’ve got some problem with my asterisk server, I really hope someone could help me.

My Asterisk conf was working so far using a VPN connection but when I disabled my VPN, I still could make calls but couldn’t receive any incomes from outside.
My asterisk -rvvv show me an error when the call is incoming :
[Feb 25 13:44:05] NOTICE[7347][C-00000000]: chan_sip.c:26407 handle_request_invite: Call from ‘00aaaaaaaaaaa’ (91.121.xxx.xxx:5060) to extension ‘00aaaaaaaaaaa’ rejected because extension not found in context ‘depuis-ovh1’.

Can anyone help me to explain this weird thing ? How a conf can work when vpn ON but can’t when OFF ?

Thanks a lot !!
Jeremy

Here is my extensions.conf file :
[interne]
exten => _1xx,1,Dial(SIP/${EXTEN},20)
exten => _1xx,2,Voicemail(299@main)
exten => _1xx,3,Hangup()

exten => _2xx,1,Dial(SIP/${EXTEN},20)
exten => _2xx,2,Voicemail(299@main)
exten => _2xx,3,Hangup()

;exten => 299,1,Set(CHANNEL(language)=fr)
exten => 299,1,VoiceMailMain(299@main)
exten => 299,2,Hangup()

exten => 303,1,Dial(SIP/vers-ovh1/09bbbbbbbb)
exten => 303,2,Hangup()

exten=> _0[123456789]XXXXXXXX,1,Dial(SIP/vers-ovh1/${EXTEN})

[depuis-ovh1]
exten => s,1,Answer()
exten => s,2,Set(TIMEOUT(response)=8)
exten => s,3,agi(googletts.agi,“Welcome”,fr,any)
exten => s,4,agi(googletts.agi,“Urgent, press 1”,fr,any)
exten => s,5,agi(googletts.agi,“Voicemail, press 2”,fr,any)
exten => s,6,agi(googletts.agi,“Secretar, press 3”,fr,any)
exten => s,7,WaitExten()

exten => 1,1,Dial(SIP/202,20,tT)
exten => 1,2,Dial(SIP/200,40,tT)
exten => 1,3,Dial(SIP/201,20,tT)
exten => 1,4,Dial(SIP/vers-ovh1/09bbbbbbbb)
exten => 1,5,Hangup()

exten => 2,1,Voicemail(299@main)
exten => 2,2,Hangup()

exten => 3,1,Dial(SIP/200,20,tT)
exten => 3,2,Voicemail(299@main)
exten => 3,3,Hangup()

My users file :
[general]
hasvoicemail=yes
hassip=yes
hasiax=yes
callwaiting = yes
threewaycalling = yes
callwaitingcallerid = yes
transfer=yes
canpark=yes
cancallforward = yes
callreturn = yes
callgroup = 1
pickupgroup = 1
nat = yes

[101]
type=friend
host=dynamic
dtmfmode=rfc2833
disallow=all
allow=ulaw
context=interne
fullname = Cusine
username = cuisine
secret=*
canreinvite=no

[102]
type=friend
host=dynamic
dtmfmode=rfc2833
disallow=all
allow=ulaw
context=interne
fullname = Info-Compta
username = info-Compta
secret=*
canreinvite=no
mailbox=299@main

[200]
type=friend
host=dynamic
dtmfmode=rfc2833
disallow=all
allow=ulaw
context=interne
fullname = Secretariat
username = secretariat
secret=*
mailbox = 200
canreinvite=no
mailbox=299@main

[201]
type=friend
host=dynamic
dtmfmode=rfc2833
disallow=all
allow=ulaw
context=interne
fullname = Direction
username = Direction
secret=*
canreinvite=no
mailbox=299@main

[202]
type=friend
host=dynamic
dtmfmode=rfc2833
disallow=all
allow=ulaw
context=interne
fullname = Eleve couloir
username = eleve_couloir
secret=*
canreinvite=no

[203]
type=friend
host=dynamic
dtmfmode=rfc2833
disallow=all
allow=ulaw
context=interne
fullname = Eleve info
username = eleve_info
secret=*
canreinvite=no

[vers-ovh1]
canreinvite=no
context=depuis-ovh1
host=sip3.ovh.fr
secret=*
type=peer
username=0033aaaaaaaaaaa
disallow=all
allow=ulaw
fromuser=0033aaaaaaaaaaa
trustrpid=yes
sendrpid=yes
insecure=invite,port
nat=yes

You must add a new exten at [depuis-ovh1] to reveive “00aaaaaaaaaaa”.

The ‘s’ isn’t a wildcard for all calls.

Adding that can help you:

exten => 00aaaaaaaaaaa,1,Goto(s,1)

Thanks a lot! Added in extensions file but still doesn’t work!
When I try to call the number, asterisk -rvvv shows no error and all the procedure (welcome, press 1, etc.) seems ok but the caller has got an error : Call failed and no sound.

Any idea ?
Thank you again.

Sorry, there’s in fact a new error I’ve not seen :

[Feb 26 09:17:08] WARNING[31280][C-00000001]: pbx_builtins.c:1021 pbx_builtin_waitexten: Timeout but no rule ‘t’ or ‘e’ in context 'depuis-ovh1’
== Spawn extension (depuis-ovh1, s, 7) exited non-zero on ‘SIP/vers-ovh1-00000001’
== Using SIP RTP CoS mark 5
> 0x7ff454007f40 – Strict RTP learning after remote address set to: 192.168.8.1:7074
– Executing [00aaaaaaaaaaa@depuis-ovh1:1] Goto(“SIP/vers-ovh1-00000002”, “s,1”) in new stack
– Goto (depuis-ovh1,s,1)
– Executing [s@depuis-ovh1:1] Answer(“SIP/vers-ovh1-00000002”, “”) in new stack
– Executing [s@depuis-ovh1:2] Set(“SIP/vers-ovh1-00000002”, “TIMEOUT(response)=8”) in new stack
– Response timeout set to 8.000
– Executing [s@depuis-ovh1:3] AGI(“SIP/vers-ovh1-00000002”, “googletts.agi,“Welcome!”,fr,any”) in new stack
– Launched AGI Script /usr/share/asterisk/agi-bin/googletts.agi

I think the warning(not an Error) has to do with the TIMEOUT function you have used in your dialplan. You need to define t extension to catch the timeout.
see this

Thanks but doesn’t work…
I’ve tried, absolute, digit and response but there’s no difference… still mute although the procedure seems all right…

[depuis-ovh1]
exten => 00aaaaaaaaaa,1,Goto(s,1)
exten => s,1,Answer()
exten => s,2,Set(TIMEOUT(response)=50)
exten => s,3,agi(googletts.agi,“Welcome!”,fr,any)

Thank you…

I’ve tried passing by a VPN… works well even with the new “exten => 00aaaaaaaaaa,1,Goto(s,1)”.

Can’t understand :confused:

I was talking about t extension to get rid of the warning you were getting and I don’t see it in your dialplan

I’m sorry. I admit I don’t understand and I’ve difficulties to find a material explaining exactly what to do with the “t extension”
I’ve tried to add:
exten => t,1,Goto(depuis-ovh1,s,1)
at the end.
Warning has disappeared but my call still fails.

-- <SIP/vers-ovh1-00000000>AGI Script googletts.agi completed, returning 0
-- Auto fallthrough, channel 'SIP/vers-ovh1-00000000' status is 'UNKNOWN'

[Feb 26 14:01:51] WARNING[14668]: chan_sip.c:4072 retrans_pkt: Retransmission timeout reached on transmission 07501-WG-2350528b-74ee5b1f5@sip3.ovh.fr for seqno 602984263 (Critical Response) – See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 31999ms with no response

Let’s help
WaitExten do exactly what it says, it wait foa a valid extension until timeout.

When your user press an invalid extension, the app will send the call to ‘i’ extension at same context.

When your user forgot to enter an extension and reach timeout, the app will send the call to ‘t’ extension at same context.

You must decide what to do in that cases. You can put a loop until reveive a valid exten, play a message or just hangup without left any advice.

But why everything is working when my asterisk is through a VPN altought I can’t reach it when it’s directly connected on Internet ?
That’s why I don’t understand.
When my VPN is OFF, I can’t reach asterisk. A message “Call failed” appears on my mobile and nothing seems to happen ! Just the terminal lines on the server appears as it was working well.

Do you opened SIP and RTP ports to internet incoming connections?

I’m testing for two days many solutions.
I think I’ve found the guilty : my Huawei 4G dongle. But I can’t open anything.
Must now find an another solution…

Thanks a lot for your help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.