Incoming calls always busy

If it is true that G723 is still enabled, what else should I do to disable it?

  • I disabled it in the extension (I set Disallowed Codecs=all and Allowed Codecs=ulaw&alaw&g729)
  • I disabled it in the Asterisk SIP settings (unchecking the G723 checkbox)
  • I disabled it in the trunk => pjsip settings => uncheck the G723 checkbox
    Is this list complete or do I miss something? Do other menus exist in Freepbx, where the G723 must be disabled? Or should I manually edit some conf file of Asterisk?

Do you mean the “show core codecs” command? The output of this command shows the G723 in the list, but honestly I don’t know if this means that the codec is enabled

The last logfiles I posted was obtained while the debug level was set for the full logfile in the Asterisk Logfiles Settings.

Debug has multiples levels, with the default being 0. If I read it correctly you seem to need at least 3 (CLI: “core set debug 3”), as you are trying to invoked this code:

I was thinking of something like “pjsip show endpoint xxxxx”, but I can’t find the code that implements that at the moment, so I’m not sure it really does provide the information. For chan_sip, it would be available from “sip show peer …”, but it is looking like it is missing for chan_pjsip.

It’s there in “pjsip show endpoint”. Due to the way things work it’s displayed without code having to be explicitly written.

I enabled the debug level 4 and I generated a new logfile containing the output in “full” log:
https://pastebin.freepbx.org/view/1f4e1817

Here is the output of this command:

freepbx*CLI> pjsip show endpoints

 Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
    I/OAuth:  <AuthId/UserName...........................................................>
        Aor:  <Aor............................................>  <MaxContact>
      Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
  Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
   Identify:  <Identify/Endpoint.........................................................>
        Match:  <criteria.........................>
    Channel:  <ChannelId......................................>  <State.....>  <Time.....>
        Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================

 Endpoint:  14073371999/14073371999                              Not in use    0 of inf
     InAuth:  14073371999-auth/14073371999
        Aor:  14073371999                                        5
      Contact:  14073371999/sip:[email protected] a37a448d99 Avail        23.915

 Endpoint:  99001/99001                                          Unavailable   0 of inf
     InAuth:  99001-auth/99001
        Aor:  99001                                              1

 Endpoint:  9914073371999/9914073371999                          Unavailable   0 of inf
     InAuth:  9914073371999-auth/9914073371999
        Aor:  9914073371999                                      1

 Endpoint:  albertotrunk2                                        Not in use    0 of inf
        Aor:  albertotrunk2                                      0
      Contact:  albertotrunk2/sip:46.19.210.14:5060        cae9fca9d4 Avail         4.700
  Transport:  0.0.0.0-udp               udp      3     96  0.0.0.0:5060
   Identify:  albertotrunk2/albertotrunk2
        Match: 46.19.210.14/32

 Endpoint:  anonymous                                            In use        3 of inf
    Channel: PJSIP/anonymous-00005f85/Wait                       Up            00:00:00
        Exten: s                         CLCID: "" <>
    Channel: PJSIP/anonymous-00005f84/SayAlpha                   Up            00:00:10
        Exten: s                         CLCID: "" <>
    Channel: PJSIP/anonymous-00005f83/SayAlpha                   Up            00:00:19
        Exten: s                         CLCID: "" <>


Objects found: 5

That is “pjsip show endpoints” which is not detailed for each endpoint. The command “pjsip show endpoint name” shows the detailed information for the endpoint specified by name. To display bob, for example, you’d use “pjsip show endpoint bob”.

There’s no debugging there.

Here is the output of this command
https://pastebin.freepbx.org/view/373a23ca

I opened the asterisk console
asterisk -r
I sent the command
core set verbose 4
I visualized the full logfile
tail -f /var/log/asterisk/full
I pasted the output here
What is missing?

Possibly you wanted to request the output of the asterisk console when debug level is set. In this case, you can find it here:
https://pastebin.freepbx.org/view/a872d692

I wish to remind this question. I would like that it is not overlooked.

Asterisk has actually been told to allow everything for the endpoint:

allow                              : (ulaw|alaw|gsm|g726|g722|g719|g729|slin|speex|speex16|speex32|siren7|adpcm|silk8|silk12|silk16|silk24|slin12|slin16|slin24|slin32|slin44|slin48|slin96|slin192|lpc10|testlaw|none|ilbc|opus|codec2|siren14|h264|mpeg4)

I don’t know FreePBX, but I can at least say that.

I think it has been told to use everything except G.723!

However specifying excessive number of codecs is known to cause problems. You should specify only those that you need.

1 Like

The word debug. You have verbose, instead.

Indeed, early morning eyes. I don’t think that endpoint is being used for the incoming call though based on the logging. It appears to be coming in as anonymous instead, which would have different allowed codecs.

The match for the endpoint has “46.19.210.14” but the call came from “46.19.213.14” so it wouldn’t match the endpoint named “albertotrunk2”.

Ouch! I thought I’d checked for that. Looks like I need an eye test too.

In FreePBX, you need to define Match/Permit settings that cover all the addresses or address ranges used by the provider. Also you should, normally disable all variations of anonymous access; they were sometimes needed as the only practical way of dealing with multiple sources addresses from some providers, but should not be needed for chan_pjsip, as Match/Permit supports address ranges.

Thank you very much to everybody for your help.

Yes you are right. I had to allow the anonymous calls because otherwise the SIP phone doesn’t even ring. So I have edited manually the /etc/asterisk/pjsip.endpoint.conf and I have disallowed the g723 codec in the anonymous endpoint:

[anonymous]
type=endpoint
context=from-sip-external
disallow=g723
allow=alaw,ulaw,g723

Then, after restarting the fwconsole, the call is connected and the codec translation error is solved. However tis cannot be the definitive solution because the freepbx will overwrite at some point the changes I did in the conf file

You are right. The problem is that I am not sure about the IP address from which the call arrive. So now I have made an attempt: I have written a comma-separated list of all the possible incoming IP addresses in the “SIP Server” field of the trunk (46.19.209.14,46.19.210.14,46.19.212.14,46.19.213.14,46.19.214.14). Then I opened the Asterisk SIP settings and have disallowed the anonymous calls. This worked!! Now the desired trunk is used, instead of the anonymous endpoint, the codec error is gone and the call is connected.

I am very happy and grateful of all of you and I consider this topic solved.

Just a couple of questions.
Is it possible to disallow the g723 coded for the anonymous endpoint, setting a menu in the GUI of freepbx (instead of editing the conf file)?

And do you confirm that it is syntactically correct to set a comma-separated list of servers or IP addresses in the SIP server field of the trunk? I just wish to be sure of that this is the real solution and not just a coincidence…

That shouldn’t work, as you added back G.723 after disallowing it.

These should go under Match / Permit, not SIP Server.

Sorry, typing error, I reported it wrongly in the post. Actually I had set
allow=alaw,ulaw,g729

At the beginning I had set the match-permit in this way, but it didn’t work.
Now, to double check your comment, I moved the comma-separated list from the SIP server to the match-permit, I applied the changes with the red button, restarted the fwconsole and repeated the test: it still work!
It is strange, it looks like I have in some way “unblocked” my freepbx when I did my first change in the conf file and now it works even reverting it, as if freepbx keeps a memory of this. It may look stupid but this is what I observe.
Anyhow now it works, so in the doubt I leave the comma-separated list both in the SIP server and in the match-permit list.

SIP Server is used for outbound calls and can differ from Match / Permit, which is of inbound calls. Normally SIP Server would be a domain name, and would be populated with the list of addresses returned by the DNS server.

Although the Match / Permit list is completely separately configured in Asteirsk, FreePBX defaults it to the SIP Server setting. In many cases there are significant differences, e.g. there may only be one acceptable outbound address, which is a load balancer, but multiple inbound addresses representing the workers on the service provider system.

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