Not working Outbound Calls, Message Everyone is busy. Hangupcase 27

I am having an issue with my configuration. I am not able to call to external numbers.
I am using asterisk 13 with freepbx 14. I am using pjsip configuration.
I did some digging with “pjsip show history” and I found that my server sends the invitation to the sip server but after “trying” there is a message that says “502 bad gateway”. The message says:

SIP/2.0 502 Bad Gateway
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;rport=5060;received=XXX.XXX.XXX.XXX;branch=
From: “XXXXXX” sip:[email protected];tag=
To: sip:[email protected];tag=gyodtxgc
Call-ID:
CSeq: 5465 INVITE
Warning: 399 37959.2432.P.261.5.105.0.4.32839.0.1075445762.ims.MY.PROVIDER.COM “Service lost”
Content-Length: 0
Content-Length: 0

The thing is that I did not change anything in my network configuration. Now it is working in a virtual machine and I have a snapshot with everything working, but I can not reload the configuration to make any change.

Thanks for your help

This is a call your provider issue.

Ok, thanks, I was thinking that, but I want to be sure, that wasn’t my mistake, before calling.
My doubt was the thing that everytime I reverse to the working snapshot the connection is established again, so I think it could be some misconfiguration in my side

That sounds a little drastic. Have you tried just restarting Asterisk (fwconsole restart)?

Yes, I tried many times. But didn’t work for me. When I try to “fwconsole restart” with the current configuration, I get the same error of bad gateway.
Also I configured a new machine with asterisk 16 and freepbx 15 and still get the same error.

A 502 Bad Gateway is an error your provider returns do to a misconfiguration issue. Is that on your side or theirs? Don’t know. Sometimes you just have to talk to your provider so they can tell you what they see and can give a quick response on what the issue is.

1 Like

Ok, thanks for your help.

Though if he can revert somethingon his side and it works, I would lean towards something on his side.

I didn’t lean toward any side, I said it could be him or the provider with the misconfiguration. Is it most likely him? Sure, I’d go with that. But since the provider is the one returning a 502 for a specific reason, they can shed some light on what that is.

Just to add information. This is my psjip configuration. Let me know if you see a mistake.

Endpoint Configuration

[100]
type=endpoint
aors=100
auth=100-auth
tos_audio=ef
tos_video=af41
cos_audio=5
cos_video=4
allow=ulaw,alaw,gsm,g726,g722
context=from-internal
callerid=XXXXX
dtmf_mode=rfc4733
mailboxes=100@device
mwi_subscribe_replaces_unsolicited=yes
aggregate_mwi=yes
use_avpf=no
rtcp_mux=no
ice_support=no
media_use_received_transport=no
trust_id_inbound=yes
media_encryption=no
timers=yes
media_encryption_optimistic=no
send_pai=yes
rtp_symmetric=yes
rewrite_contact=yes
force_rport=yes
language=en
one_touch_recording=on
record_on_feature=apprecord
record_off_feature=apprecord

[TrunkName]
type=endpoint
transport=0.0.0.0-udp
context=from-trunk
disallow=all
allow=ulaw,alaw
aors=TrunkName
language=en
t38_udptl=no
t38_udptl_ec=none
fax_detect=no
trust_id_inbound=no
t38_udptl_nat=no
direct_media=no
rewrite_contact=yes
rtp_symmetric=yes
dtmf_mode=auto

[dpma_endpoint]
type=endpoint
context=dpma-invalid

Identify Configuration

[100-identify]
type=identify
endpoint=100

[TrunkName]
type=identify
endpoint=TrunkName
match=IP_SIP_PROVIDER

Transport Configuration

[0.0.0.0-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
external_media_address=IP_TO_CONNECT_TO_PROVIDER
external_signaling_address=IP_TO_CONNEC_TO_PROVIDER
allow_reload=yes
tos=cs3
cos=3
local_net=LOCAL_IP_NET
local_net=IP_TO_CONNECT_TO_PROVIDER_NET

Auth Configuration

[100-auth]
type=auth
auth_type=userpass
password=XXXXXX
username=100

[TrunkName]
type=auth
auth_type=userpass
password=
username=TrunkName

Aor Configuration

[100]
type=aor
mailboxes=100@device
max_contacts=2
remove_existing=no
maximum_expiration=7200
minimum_expiration=60
qualify_frequency=60

[Claro]
type=aor
qualify_frequency=60
contact=sip:IP_SIP_PROVIDER

pjsip.conf

#include pjsip_custom.conf
#include pjsip.transports.conf
#include pjsip.transports_custom_post.conf
#include pjsip.endpoint.conf
#include pjsip.endpoint_custom_post.conf
#include pjsip.aor.conf
#include pjsip.aor_custom_post.conf
#include pjsip.auth.conf
#include pjsip.auth_custom_post.conf
#include pjsip.registration.conf
#include pjsip.registration_custom_post.conf
#include pjsip.identify.conf
#include pjsip.identify_custom_post.conf

[global]
type=global
user_agent=FPBX-14.0.5.25(13.22.0)
default_outbound_endpoint=dpma_endpoint
#include pjsip_custom_post.conf

These are your WAN IP, correct?

Yes, that is my wan ip

Have you spoken with your provider? It’s hard to tell how this is misconfigured if settings are missed and we don’t know what they are supposed to be or what is required.

I am calling them tomorrow. Thanks for your concern. But is very weird, like I said, with the current configuration everything work, but with a restart everything fail.

This should not be hard to troubleshoot:

Restore from snapshot. Set pjsip logger on. Make (successful) test call. Save outgoing invite and response. Reload config. Set pjsip logger on. Make (failing) test call from same extension to same number. Record outgoing invite and response. With luck, you’ll notice something different about the second invite, which should tell you what’s wrong.

If you see no difference, I’m guessing that the provider is complaining about something in your environment, e.g. registering or qualify too frequently, sending calls from an unauthorized IP or port.

Yes I tried that the first time, the difference is that in the first one it said ringing and in the second one said bad gateway.

Yes, but can you see any difference in the INVITE requests that elicited those responses?

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