SIP trunk unable to connect

#21

my internet provider says that the freepbx is blocking the incoming call gives them a forbidden 401 message

0 Likes

#22

The carrier is talking nonsense; 401 does not mean forbidden. However, as most carriers cannot cope with a 401 “please authenticate yourself” message, you need to configure Asterisk not to require the carrier to authenticate itself. The method of doing it in Asterisk depends on whether you are using chan_sip or chan_pjsip. For the, deprecated, chan_sip, the current best way of doing this is to use remotesecret, rather than secret. This forum is not the best place to ask how to achieve that using the FreePBX GUI.

You can also get this effect when the carrier simply isn’t recognized and certain options are selected, but I don’t think that FreePBX selects that combination.

0 Likes

#23

On FreePBX GUI, set the trunk to not authenticate incoming invites:

So under Authentication, have it as “none” or “outbound” (depending on whether your provider challenges your invites for authentication or not).

0 Likes

#24

Many thanks for the info i set up the authentication on the outbound and now i can receive calls,
So the inbound is fixed.

Outbound route is the problem now it says : " all the lines are busy"

2019-04-01 10:32:08] ERROR[16247]: res_pjsip.c:3114 ast_sip_create_dialog_uac: Endpoint ‘226029001055937@as1.romtelecom.net’: Could not create dialog to invalid URI ‘sip:226029001055937@as1.romtelecom.net@as1.romtelecom.net:5060’. Is endpoint registered and reachable?
[2019-04-01 10:32:08] ERROR[16247]: chan_pjsip.c:2226 request: Failed to create outgoing session to endpoint ‘226029001055937@as1.romtelecom.net’
[2019-04-01 10:32:08] WARNING[24105][C-00000007]: app_dial.c:2525 dial_exec_full: Unable to create channel of type ‘PJSIP’ (cause 3 - No route to destination)
sangomacrm.agi: LINKEDID: 1554103927.9
sangomacrm.agi: SOURCE: 301
sangomacrm.agi: DESTINATION: 0721249197
sangomacrm.agi: DIRECTION: OUTBOUND
sangomacrm.agi: EXTTOCALL:
sangomacrm.agi: START
sangomacrm.agi: SCRIPT: php /var/www/html/admin/modules/sangomacrm/importOne.php ‘eyJ1dWlkIjoiMTU1NDEwMzkyNy45Iiwic291cmNlIjoiMzAxIiwiZGVzdGluYXRpb24iOiIwNzIxMjQ5MTk3IiwiZGlyZWN0aW9uIjoiT1VUQk9VTkQiLCJ0eXBlIjoiRU5EIiwienVsdV90eXBlIjoiIiwiZXh0dG9jYWxsIjoiIiwiY251bSI6IjMwMSIsImNuYW0iOiIiLCJjYWxscG9wIjpmYWxzZSwidm9pY2VtYWlsIjoiIn0=’ > /dev/null 2>&1 &

Can you please help me with this one too
Many thanks

0 Likes

#25

The URI is invalid, as it says. You cannot have two @s in a SIP URI!

0 Likes

#26

server URI :

sip:[username]@[ip]:[port]

so my username is 226029001055937@as1.romtelecom.net
ip : as1.romtelecom.net
port 5060

should i try sip:226029001055937@as1.romtelecom.net:5060 ?

0 Likes

#27

i did modify the AOR URI to : sip:+40217940184@as1.romtelecom.net:5060 same as the client URI, but is still saying all the lines are busy now
Connected to Asterisk 13.19.1 currently running on 2 (pid = 2706)
sangomacrm.agi: LINKEDID: 1554108628.16
sangomacrm.agi: SOURCE: 301
sangomacrm.agi: DESTINATION: 0721249197
sangomacrm.agi: DIRECTION: OUTBOUND
sangomacrm.agi: EXTTOCALL:
sangomacrm.agi: START
sangomacrm.agi: SCRIPT: php /var/www/html/admin/modules/sangomacrm/importOne.php ‘eyJ1dWlkIjoiMTU1NDEwODYyOC4xNiIsInNvdXJjZSI6IjMwMSIsImRlc3RpbmF0aW9uIjoiMDcyMTI0OTE5NyIsImRpcmVjdGlvbiI6Ik9VVEJPVU5EIiwidHlwZSI6IlNUQVJUIiwienVsdV90eXBlIjoiIiwiZXh0dG9jYWxsIjoiIiwiY251bSI6IjAyMTc5NDAxODQiLCJjbmFtIjoiIiwiY2FsbHBvcCI6ZmFsc2UsInZvaWNlbWFpbCI6IiJ9’ > /dev/null 2>&1 &
sangomacrm.agi: LINKEDID: 1554108628.16
sangomacrm.agi: SOURCE: 301
sangomacrm.agi: DESTINATION: 0721249197
sangomacrm.agi: DIRECTION: OUTBOUND
sangomacrm.agi: EXTTOCALL:
sangomacrm.agi: START
sangomacrm.agi: SCRIPT: php /var/www/html/admin/modules/sangomacrm/importOne.php ‘eyJ1dWlkIjoiMTU1NDEwODYyOC4xNiIsInNvdXJjZSI6IjMwMSIsImRlc3RpbmF0aW9uIjoiMDcyMTI0OTE5NyIsImRpcmVjdGlvbiI6Ik9VVEJPVU5EIiwidHlwZSI6IkVORCIsInp1bHVfdHlwZSI6IiIsImV4dHRvY2FsbCI6IiIsImNudW0iOiIzMDEiLCJjbmFtIjoiIiwiY2FsbHBvcCI6ZmFsc2UsInZvaWNlbWFpbCI6IiJ9’ > /dev/null 2>&1 &

Endpoint: 226029001055937@as1.romtelecom.net Not in use 0 of inf
OutAuth: 226029001055937@as1.romtelecom.net/226029001055937@as1.romtelecom.net
Aor: 226029001055937@as1.romtelecom.net 0
Contact: 226029001055937@as1.romtelecom.net/sip:+40 77e9a49e2f Unknown nan
Transport: 0.0.0.0-udp udp 3 96 0.0.0.0:5060
Identify: 226029001055937@as1.romtelecom.net/226029001055937@as1.romtelecom.net
Match: 92.87.198.105/32

I am not sure what to do next can you please help me

0 Likes

#28

The syntax of a SIP URI is as follows:

SIP-URI          =  "sip:" [ userinfo ] hostport
                    uri-parameters [ headers ]
userinfo         =  ( user / telephone-subscriber ) [ ":" password ] "@"
user             =  1*( unreserved / escaped / user-unreserved )
user-unreserved  =  "&" / "=" / "+" / "$" / "," / ";" / "?" / "/"
unreserved  =  alphanum / mark
escaped     =  "%" HEXDIG HEXDIG

And to stress the point, @ is reserved.

reserved    =  ";" / "/" / "?" / ":" / "@" / "&" / "=" / "+"
                     / "$" / ","

That means a user part containing an @ is simply invalid. It is just possible that the ITSP would accept %40 instead of @.

0 Likes

#29

i think the AOR contact might not be correct, but i am not sure on what to input in the field there.

I tried same address as the CLient URI but nothing has changed and also sip:226029001055937@as1.romtelecom.net:5060 same thing

Can you please help me with a suggestion on what should i do next

0 Likes

#30

here is what i get from the pjsip show history

00382 1554120564 * <== 192.168.1.94:50189 INVITE sip:0721249197@192.168.1.10 SIP/2.0
00383 1554120564 * ==> 192.168.1.94:50189 SIP/2.0 401 Unauthorized
00384 1554120564 * <== 192.168.1.94:50189 ACK sip:0721249197@192.168.1.10 SIP/2.0
00385 1554120564 * <== 192.168.1.94:50189 INVITE sip:0721249197@192.168.1.10 SIP/2.0
00386 1554120564 * ==> 192.168.1.94:50189 SIP/2.0 100 Trying
00387 1554120575 * ==> 92.87.198.105:5060 INVITE sip:0721249197@as1.romtelecom.net:5060 SIP/2.0
00388 1554120575 * <== 92.87.198.105:5060 SIP/2.0 100 Trying
00389 1554120575 * <== 92.87.198.105:5060 SIP/2.0 403 Forbidden
00390 1554120575 * ==> 92.87.198.105:5060 ACK sip:0721249197@as1.romtelecom.net:5060 SIP/2.0
00391 1554120575 * ==> 192.168.1.94:50189 SIP/2.0 183 Session Progress
00392 1554120576 * <== 192.168.1.94:50189 CANCEL sip:0721249197@192.168.1.10 SIP/2.0
00393 1554120576 * ==> 192.168.1.94:50189 SIP/2.0 200 OK
00394 1554120576 * ==> 192.168.1.94:50189 SIP/2.0 487 Request Terminated
00395 1554120576 * <== 192.168.1.94:50189 ACK sip:0721249197@192.168.1.10 SIP/2.0
00396 1554120582 * ==> 192.168.1.94:50189 OPTIONS sip:301@192.168.1.94:50189;rinstance=787bbec77b20c03b SIP/2.0
00397 1554120582 * <== 192.168.1.94:50189 SIP/2.0 200 OK

0 Likes

#31

You could ask your provider why they’re sending you a 403 forbidden.

0 Likes

#32

thank you very much for your help i managed to get it working it seemed that on the outbound i had to set override extension

once again many thanks

0 Likes