Enable Chan SIP on Freepbx 16

OPTIONS is affected by the qualify setting, which is present for both SIP channel drivers. I would expect Method not Allowed, to be considered a good response, as the intent of OPTIONS is to obtain a response without changing the state of the remote party. Any response should do.

type=user is unlikely to work, as it would require the ITSP to set the the user part of the From header to 390541000000, when it more likely to be the caller ID. It is also unlikely to work as I don’t know of any ITSP that authenticates itself with a password. Regarding the first point the type=friend should be type=peer (friend is user + peer, but only the peer part is effective, and the user part provides an attack surface). and, in any case, it can’t have the same name as the type=user.

Generally, you should have incoming sections which are type=peer, and have no password, for every possible IP address from which you can receive calls from the ITSP. If that is a whole /24, you will need ~256 sections for chan_sip, but chan_pjsip would allow you a single match/permit entry.

Also, generally, all incoming and outgoing sections, for a provider, should have the same context.

(username isn’t documented as doing anything useful for outgoing registration cases.)

SIP Wind Configuration
Outgoing:
[email protected]
type=peer
trustrpid=yes
sendrpid=yes
secret=password
realm=windtre.it
qualify=yes
outboundproxy=voip.windtre.it
nat=force_rport,comedia
keepalive=45
insecure=port,invite
host=windtre.it
fromuser=390541349891
fromdomain=windtre.it
dtmfmode=auto
disallow=all
defaultuser=390541000000
allow=alaw&g729&ulaw

INCOMING:
User Context: 390541000000
User Details:
[email protected]
type=friend
secret=password
context-from=pstn-toheader
realm=windtre.it
qualify=30
maxexpiry=30
port=5060
outboundproxy=voip.windtre.it
nat=yes
insecure=invite,port
host=windtre.it
fromuser=390541000000
fromdomain=windtre.it
dtmfmode=rfc2833
canreinvite=yes
callerid=390541000000

As you can see:


With this configuration the trunk is registered and i’m able to make an outbound call but i can’t hear anything

I initially assumed that you did have have it working, with chan_sip, before, but it looks like you have never had it working. In that case there is absolutely no case for persisting in trying to make chan_sip work.

Hi 1st i try with PJSIP and the trunk is registered but i’m not able to make outbound call, so now i’m try with Chan SIP

I imagine that is because the incoming calls neither originate from 54.229.10.161, nor have a from user field set to 390541000000 or the name of your outbound section, so they don’t match friend in either host or user mode. Also, you haven’t specified any codecs on the incoming section, even allow=all can cause problems.

I enable SIP Debug and make a outbound call this is the new SIP Trace file:
https://pastebin.freepbx.org/view/8e5dc454

The ITSP (or your router) seems to have lost the call after it acknowledged it.

The Via header in the responses is wrong. Whilst I can’t rule out that it is jiggery pokery by chan_sip, which possibility you could exclude by using sngrep to confirm that the problem is still there at the boundary of the machine running Asterisk, my best guess is that you have a rogue application level gateway on your router, in which case you should disable it. The second guess is that the ITSP is having serious difficulty complying with RFC 3261. The first parameter should be unchanged from the request.

Hi

What do you mean with ITSP?

I have disable SIP ALG on the firewall and configure Port Forwarding like this:

UPD 10000:20000 to IP PBX
UDP 5060 to IP PBX

Internet Telephony Service Provider. windtre.it, in this case.

Hi

I have reconfigure PJSIP and now outbound call it works audio is ok, but if i try to make an inbound call not work

On the inbound attempt, if anything appears in the Asterisk log, paste that, including pjsip logger information. If not, if anything appears in sngrep, post that. If nothing in sngrep, report what caller hears and what, if anything, appears in provider’s log.

Hi

On sngrep nothing appears also in Asterisk LOG.

Callers hears nothing the call remain on “composition…” and terminated automatic after about 30 seconds.

Hi @Stewart1

Any ideas to continue troubleshooting?

With this gateway voip Patton Smart Node 4112 i can resolve the problem?

Update:

Maybe i need to configure Match Permit on Pjsip trunk, what address i need to put here?

Thanks

Hi

I have change router and disable ALG, now if i try to make inbound call i see the packet with TCPDUMP here the packet log:
https://pastebin.freepbx.org/view/341657b7

Sngrep:

Asterisk LOG:
https://pastebin.freepbx.org/view/bbc833c9

When i make the inbound call i hear " The number you entered is not in use"

You don’t have an inbound route for the number in the To header (+39…91).

What did you mean ?

Can provide some sceenshoot?

https://wiki.freepbx.org/display/FPG/Inbound+Route+User+Guide#InboundRouteUserGuide-DID(DirectInwardDialing)Number

should be +390541000000 according to the text log, or
image
according to your screen shot. I don’t know why these differ.,

Hi

I use random number off course for privacy reason, but the inbound route is set up correctly, so i don’t know where the problem is

UPDATE:

I fix the problem just leave blank this field on Inbound Route:

I try to make an outbond call to my IVR and i’m not able to digit option 1,2,3 when i press for example the button numer 1 on my cordless voip the ivr not recognize.

UPDATE:

Ok Guys

I have test the PBX and everything works audio is ok i can make inbound and outbound call, but after 1 hour or less the trunk change status from “registered” to “rejected”, any ideas ?

thank you

what about chan-sip