cancel
Showing results for 
Search instead for 
Did you mean: 

SIP Credentials and PJSIP (FreePBX)

Highlighted
Level 1
Level 1
1 of 11

Hi, 

I'm trying to use the SIP credentials provided by Swisscom for an inOne line with a FreePBX running asterisk 13.22 and using chan_pjsip (and not chan_sip).

I'm struggling to find the configuration for the trunk because of the bad username containing the @ sign.

Has anyone managed to use the trunk with a pjsip trunk?

 

Thanks

Giuseppe

10 Comments
Level 1
2 of 11

Salut !

 

Je suis aussi dessus le même problème, j'arrive à recevoir un appel, mais pas à en passer...

 

As-tu trouver une solution ?

Highlighted
Level 1
3 of 11

Hi, 

are you using chan_sip or chan_pjsip?

 

Highlighted
Level 1
4 of 11

J'utilise CHAN-SIP mais si il y a une solution avec PJSIP, je suis prenneur !

Highlighted
Level 1
5 of 11

chan_sip is working without problems with this setup:

 

OUTGOING:

user=+$NUMBER
type=peer
srvlookup=yes
secret=$SECRET
outboundproxy=fs1.ims.swisscom.ch
nat=yes
insecure=invite, port
host=swisscom.ch
fromuser=+$NUMBER
fromdomain=swisscom.ch
dtmfmode=auto
disallow=all
defaultuser=$LOGIN@swisscom.ch
canreinvite=no
allow=alaw & ulaw & g729 & gsm & slinear & ulaw

 

INCOMING:

type=peer
host=fs1.ims.swisscom.ch
fromdomain=swisscom.ch
disallow=all
allow=alaw & ulaw & g729 & gsm & slinear & ulaw

 

REGISTRATION STRING:

+$NUMBER@swisscom.ch:$SECRET:$LOGIN@fs1.ims.swisscom.ch/+$NUMBER

 

Obviously  you must set the Variables with your line SIP credentials

It's imperative that chan_sip is using the 5060 port, otherwise the trunk will not work fully, due to a swisscom bug!

 

Good luck 🙂

 
Highlighted
Level 1
6 of 11

yes thank you !

 

I have make a test with FreePBX 14 and asterisk 13 and 16 but same problem.

 

My config :

 

create a trunk CHAN SIP

 

OUTGOING:


user=+4121xxxxx
type=peer
srvlookup=yes
secret=xxxxxxxxxxxxxxxx
outboundproxy=fs1.ims.swisscom.ch
nat=yes
insecure=invite, port
host=swisscom.ch
fromuser=+4121xxxxxxxxxx
fromdomain=swisscom.ch
dtmfmode=auto
disallow=all
defaultuser=NCxxxxxxxxxxxxxx@swisscom.ch
canreinvite=no


INCOMING:


type=peer
host=fs1.ims.swisscom.ch
fromdomain=swisscom.ch
disallow=all
allow=alaw&ulaw&g729&gsm&slinear&ulaw

 

REGISTER STRING:


+4121xxxxx@swisscom.ch:mypasswordxxxx:NCxxxxxxxxxxxxxxxxx@swisscom.ch@fs1.ims.swisscom.ch/+4121xxxxxxxx

 

And i have modifiy in Settings - ASTERISK SIP SETTINGS - Registration Default Expiry 120 default to 180

 

 

All incomming call are stable and good quality, but my problem is for outgoing.

 

I have a response in log :

 

-- Called SIP/TR1_Sw_OUT/5478966
[2019-10-19 20:09:37] WARNING[4807][C-00000001]: chan_sip.c:24055 handle_response_invite: Received response: "Forbidden" from '<sip:+412*******@swisscom.ch:5160>;tag=as7aa9544d'
== Everyone is busy/congested at this time (1:0/0/1)

 

why port 5160 ?

Highlighted
Level 1
7 of 11

YES,

 

I have reconfigured my FreePBX and apply the port 5060 to CHAN SIP and the 5160 to the PJSIP and it's work now.

 

thank you for your help.

 

I am now going to do some long-term testing and see how stability is going ...

 

I'll be back in a while.

Highlighted
Level 1
8 of 11

Hi, the port is the key problem here.

In freepbx 14 the default sip driver is PJSIP that is configured to use the default SIP port (5060) and the old chan_sip is using the alternate 5060.

You need to change the configuration in "Asterisk SIP settings" but be aware that this will impact all the endpoints that you are using.

 

I looked a lot into finding a solution to have the trunk working with chan_pjsip but as of today I haven't found anithing working!

 

Highlighted
Level 1
9 of 11

I'm using this configuration in production from more than 6 months now all is working flawlessly.

 

Highlighted
Level 1
10 of 11

OK thanks.

 

Trunk use CHAN-SIP with port 5060 for extern ( swisscom force ).

 

All phone and extension with pjsip with SIP port 5160

 

But only for new install, or reconfigure all phone..

 

 

Highlighted
Level 1
11 of 11

Before SIP credential, i have test and it's work fine with :

 

FreePBX CHAN_SIP trunk to SIP with Centro Business V2 of Swisscom

FreePBX CHAN_SIP trunk to SIP Fritzbox 7690

FreePBX PJSIP_SIP trunk to SIP Fritzbox 7690

FreePBX CHAN_SIP trunk to SIP Internet BOX V2 Swisscom

FreePBX PJSIP_SIP trunk to SIP Internet BOX V2 Swisscom

Back to top