Can't use PJSIP trunk to send calls to sending A2B Server

Hi,
A few days ago asterisk was not running. The server is not running FreePBX Distro but does have FreePBX installed. The strange thing is, in 10 years this has never happened. The day Asterisk was not running there are no logs for that day in .gz format. Tried searching for asterisk | grep -i exit in /var/log/* but nothing comes up. The only thing found was:

freepbx.service: main process exited, code=exited, status=1/FAILURE

Any idea how I might be able to find the cause of asterisk quitting/failing? A simple fwconsole restart worked to get asterisk running. In the meantime added a script to run fwconsole restart at night for now.

Thanks.

Hi

Try to run: fwconsole restart and try again.
Check if you’ve got any error.

if the issue is still present, then update your system

yum update -y
fwconsole ma updateall
fwconsole restart
fwcosnole reload

Next, if the issue is still there.
start asterisk manually like this and check the dump.
asterisk -cvvvvv

Maybe you will have something wrong in the asterisk module which is messed up.
Also, if the asterisk version is messed up you can try another Asterisk version running this:

asterisk-version-switch

Select another version.

Hi Franckdanard, when I found asterisk was not running ran # fwconsole restart and asterisk started just like normal. I would like to find something that would indicate why asterisk stopped in the first place. # df -h showed lots of space available so it wasn’t that asterisk could not write to logs or anything like that.
Thanks.

Well, sometimes if you change the asterisk version, Asterisk may can’t start automatically.
In this case, use asterisk-version-switch and select another Asterisk version
Next, launch fwconsole restart and reload again and next reboot your system.

Check if that fix your issue

You can check asterisk logs too.
Or maybe the issue comes from elsewhere.

HI,
This is an older system. There is no asterisk-version-switch. And I am not going to put a new version because it most likely isn’t supported by other needed software running on the server. There are NO logs for the date of failure 4-22

In the log that has the date when asterisk quit there are no entries for the date itself. The last entries in that log are:

[2023-04-21 22:15:45] VERBOSE[1834] asterisk.c: Asterisk Ready.
[2023-04-21 22:15:45] VERBOSE[1834] asterisk.c: Asterisk cleanly ending (0).
[2023-04-21 22:15:45] VERBOSE[1834] asterisk.c: Executing last minute cleanups
[2023-04-21 22:15:45] VERBOSE[1834] res_musiconhold.c: Destroying musiconhold processes
[2023-04-21 22:15:45] VERBOSE[1834] manager.c: Manager unregistered action DBGet
[2023-04-21 22:15:45] VERBOSE[1834] manager.c: Manager unregistered action DBPut
[2023-04-21 22:15:45] VERBOSE[1834] manager.c: Manager unregistered action DBDel
[2023-04-21 22:15:45] VERBOSE[1834] manager.c: Manager unregistered action DBDelTree

Ok.
Maybe the HDD is too old and becomes to be messed up?
I don’t know.

Our servers all run RAID-50 so there is no way this would happen due to hdd failure.

How about some basic details like what version of FreePBX and Asterisk this system is on. Rather important details.

1 Like

FreePBX 13.0.197.31 (minimal modules only)
Asterisk 13.14.0

Not only is that an EOL version of Asterisk, you’re not even on the last/final release of 13.x. You can try to update Asterisk to the last version of 13 to see if that helps. Outside of that, there’s not really any support for it.

Also there is this asterisk.c: Asterisk cleanly ending (0). which means this is not a crash, something caused Asterisk to shut down cleanly. So now we need decent debugs and probably a backtrace…

Providing Great Debug - Support Services - Documentation (freepbx.org)

Either you need to do a lot more work to troubleshoot this or you need to update Asterisk. The latter is the easier path.

Hi Blaze Studios, tried to upgrade asterisk to asterisk-13.38.3. There must be more to upgrading as that server being upgraded would not send/get calls. Thankfully we run a backup of every VM weekly. Restored the working VM. But now, for some very weird reason, any overseas calls do not get out. That is, anything starting with 011. Have another server running exactly same which we use for outbound faxing which also routes outbound to the right carrier.
To temporarily get overseas calls working, changed the trunk in outbound routes to use the other server and all is good. However I’d rather have the original server working as it was and get the asterisk-13.38.3 version installed and working.

OK, looks like the sending server is not striping off 011 and not adding the prefix even though the trunk is set to add the prefix and strip off 011 and that is why outbound overseas calls are failing…

<— SIP read from UDP:XX.XX.49.61:5160 —>
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP XX.XX.49.61:5160;rport;branch=z9hG4bKPj80e72917-95e1-40fe-9830-f0848f613c0b
From: “LAMER” sip:[email protected];tag=45a22e26-77ea-43e1-9afa-241d4f3ea63a
To: sip:[email protected]
Contact: sip:[email protected]:5160
Call-ID: 71c4eb5a-2107-4f4c-bedb-d206f969a0b2
CSeq: 32662 INVITE
Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: “LAMER” sip:[email protected]
Remote-Party-ID: “LAMER” sip:[email protected];party=calling;privacy=off;screen=no
Max-Forwards: 70
User-Agent: FPBX-16.0.40(16.8)
Content-Type: application/sdp
Content-Length: 239

v=0
o=- 1560356810 1560356810 IN IP4 XX.XX.49.61
s=Asterisk
c=IN IP4 XX.XX.49.61
t=0 0
m=audio 18262 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
<------------->
— (17 headers 12 lines) —
Sending to XX.XX.49.61:5160 (no NAT)
Sending to XX.XX.49.61:5160 (no NAT)
Using INVITE request as basis request - 71c4eb5a-2107-4f4c-bedb-d206f969a0b2
[2023-05-09 03:39:07] WARNING[1850][C-000006d0]: chan_sip.c:31440 build_peer: ‘’ is not a valid RTP hold time at line 0. Using default.
[2023-05-09 03:39:07] WARNING[1850][C-000006d0]: chan_sip.c:31445 build_peer: ‘’ is not a valid RTP hold time at line 0. Using default.
[2023-05-09 03:39:07] WARNING[1850][C-000006d0]: chan_sip.c:31277 build_peer: no value given for outbound proxy on line 0 of sip.conf
Found peer ‘6160775458’ for ‘+1XXX3504975’ from XX.XX.49.61:5160
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw), peer - audio=(ulaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port XX.XX.49.61:18262
Looking for 011972553313494 in a2billing (domain XX.XX.49.40)
sip_route_dump: route/path hop: sip:[email protected]:5160

<— Transmitting (no NAT) to XX.XX.49.61:5160 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP XX.XX.49.61:5160;branch=z9hG4bKPj80e72917-95e1-40fe-9830-f0848f613c0b;received=XX.XX.49.61;rport=5160
From: “LAMER” sip:[email protected];tag=45a22e26-77ea-43e1-9afa-241d4f3ea63a
To: sip:[email protected]
Call-ID: 71c4eb5a-2107-4f4c-bedb-d206f969a0b2
CSeq: 32662 INVITE
Server: FPBX-13.0.197.31(13.14.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: sip:[email protected]:5060
Content-Length: 0

<------------>
[2023-05-09 03:39:07] WARNING[1850][C-000006d0]: chan_sip.c:31440 build_peer: ‘’ is not a valid RTP hold time at line 0. Using default.
[2023-05-09 03:39:07] WARNING[1850][C-000006d0]: chan_sip.c:31445 build_peer: ‘’ is not a valid RTP hold time at line 0. Using default.
[2023-05-09 03:39:07] WARNING[1850][C-000006d0]: chan_sip.c:31277 build_peer: no value given for outbound proxy on line 0 of sip.conf
Scheduling destruction of SIP dialog ‘71c4eb5a-2107-4f4c-bedb-d206f969a0b2’ in 32000 ms (Method: INVITE)

<— Reliably Transmitting (no NAT) to XX.XX.49.61:5160 —>
SIP/2.0 603 Declined
Via: SIP/2.0/UDP XX.XX.49.61:5160;branch=z9hG4bKPj80e72917-95e1-40fe-9830-f0848f613c0b;received=XX.XX.49.61;rport=5160
From: “LAMER” sip:[email protected];tag=45a22e26-77ea-43e1-9afa-241d4f3ea63a
To: sip:[email protected];tag=as42a048c5
Call-ID: 71c4eb5a-2107-4f4c-bedb-d206f969a0b2
CSeq: 32662 INVITE
Server: FPBX-13.0.197.31(13.14.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Content-Length: 0

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

<— SIP read from UDP:XX.XX.49.61:5160 —>
ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP XX.XX.49.61:5160;rport;branch=z9hG4bKPj80e72917-95e1-40fe-9830-f0848f613c0b
From: “LAMER” sip:[email protected];tag=45a22e26-77ea-43e1-9afa-241d4f3ea63a
To: sip:[email protected];tag=as42a048c5
Call-ID: 71c4eb5a-2107-4f4c-bedb-d206f969a0b2
CSeq: 32662 ACK
Max-Forwards: 70
User-Agent: FPBX-16.0.40(16.8)
Content-Length: 0

<------------->
— (9 headers 0 lines) —

The question is, why is this sending server not striping 011 and adding the prefix. As mentioned before, if in the FreePBX Distro server, simply change the outbound route to use the other (same non freepbx distro) server, the outbound calls work flawlessly.

Have checked all the settings between the two sending servers side by side and cannot find any differences.
Thanks.

How would we know when we haven’t been presented with any real data from this “sending server”. The obvious answer is, configuration issue. Show this configuration.

Umm. How to show the config?

This is really strange. Using the trunk (pjsip) in our pbx set to go to sending sever (sip), our FreePBX 16 server seems to take the name that is in the description and use it as URI.

[2023-05-09 14:53:15] ERROR[8240]: res_pjsip.c:3534 ast_sip_create_dialog_uac: Endpoint ‘vbill6-intnl’: Could not create dialog to invalid URI ‘vbill6-intnl’. Is endpoint registered and reachable?
[2023-05-09 14:53:15] ERROR[8240]: chan_pjsip.c:2679 request: Failed to create outgoing session to endpoint ‘vbill6-intnl’

That name vbill6-intnl is …
trunk_name

The settings have server IP address not a name…
pjsip_trunk_settings

Deleted vbill6-intnl trunk. Created new pjsip trunk vb6-intnl and then changed the outbound route to use vb6-intnl. Subsequently make a call and CLI shows same thing…

[2023-05-09 17:45:25] ERROR[15832]: res_pjsip.c:3534 ast_sip_create_dialog_uac: Endpoint ‘vb6-intnl’: Could not create dialog to invalid URI ‘vb6-intnl’. Is endpoint registered and reachable?
[2023-05-09 17:45:25] ERROR[15832]: chan_pjsip.c:2679 request: Failed to create outgoing session to endpoint ‘vb6-intnl’
– No devices or endpoints to dial (technology/resource)

Why is system using descriptive name instead of the IP address in the PJSIP trunk settings??

What do you have configured under the pjsip settings tab?

fwconsole ma delete userman

?

Before doing what you suggest above, ran yum upgrade and then ran asterisk-version-switch and upgraded to asterisk 20. Then attempted a call and same crap.

[2023-05-09 18:07:09] ERROR[8615]: res_pjsip.c:852 ast_sip_create_dialog_uac: Endpoint 'vb6-intnl': Could not create dialog to invalid URI 'vb6-intnl'.  Is endpoint registered and reachable?
[2023-05-09 18:07:09] ERROR[8615]: chan_pjsip.c:2681 request: Failed to create outgoing session to endpoint 'vb6-intnl'
[2023-05-09 18:07:09] NOTICE[9617][C-00000001]: app_dial.c:2707 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
  == Everyone is busy/congested at this time (1:0/0/1

What endpoint??

The PJSIP trunk settings are…