Sam333
(Sam)
May 3, 2023, 5:18am
1
Hello, can you help me?
I configure sip in freePBX, but the trunk does not work. I do the same configuration on the yeastar s20 pbx device and the trunk works.
I would like help on how to write sip or pjsip config in freePBX.
thanks in advance.
------------------Yeastar SIP Config-----------------------
https://ibb.co/3szvsVf
https://ibb.co/WtXR77r
https://ibb.co/xLhWDcx
cat /etc/asterisk/pjsip.conf
#include pjsip_auth.conf
[trunk-9941255XXXXX-registeration](registration-basic)
outbound_auth=trunk-9941255XXXXX-auth
server_uri=sip:ims02.baktelecom.az:5060\;transport=udp
client_uri=sip:[email protected] :5060
contact_user=+9941255XXXXX
outbound_proxy=sip:10.0.5.10:5060\;transport=udp\;lr
unset_sips=no
[trunk-9941255XXXXX-endpoint](endpoint-basic)
context = callin_trunk_9941255XXXXX
outbound_auth=trunk-9941255XXXXX-auth
aors=trunk-9941255XXXXX-aor
media_encryption=no
allow=ulaw,alaw,g729
from_domain=ims02.baktelecom.az
from_user=
dtmf_mode=inband
outbound_proxy=sip:10.0.5.10:5060\;transport=udp\;lr
force_privacyid=no
language=en
istrunk=1
fax_detect=no
t38_udptl=no
t38_noattr=no
language=en
set_var=SRCTRUNKNAME=9941255XXXXX
set_var=GROUP(trunk-9941255XXXXX-endpoint)=trunk-9941255XXXXX-endpoint
set_var=SRCTRUNKDOMAIN=ims02.baktelecom.az
set_var=SRCTRUNKTYPE=REG
set_var=TIMEOUT(absolute)=10800
set_var=ENABLEJB=no
set_var=OBADDDIVERSION=no
set_var=OBDIVERSION=
set_var=TFADDDIVERSION=yes
set_var=TFDIVERSION=default
set_var=OBADDRPID=no
set_var=OBRPID=
set_var=TFADDRPID=no
set_var=TFRPID=
set_var=OBADDPAI=no
set_var=OBPAI=
set_var=TFADDPAI=no
set_var=TFPAI=
set_var=OBADDPPI=no
set_var=OBPPI=
set_var=TFADDPPI=no
set_var=TFPPI=
set_var=TFFROM=default
set_var=FROMUSER=
set_var=USERNAME=+9941255XXXXX
endpttype=trunk
user_eq_phone=no
ignore_183_without_sdp=no
dtmffmtp=0-16
[trunk-9941255XXXXX-aor]
type=aor
authenticate_qualify=no
qualify_frequency=60
contact=sip:[email protected] :5060\;transport=udp
contactuser=+9941255XXXXX
max_contacts=1
[trunk-9941255XXXXX-identify]
type=identify
endpoint=trunk-9941255XXXXX-endpoint
username=+9941255XXXXX
srvlookup=0
match=10.0.5.10
port=5060
didsetting=,55XXXXX,
---------------freePBX SIP config----------
My PJSIP Port:5060
My SIP Port:5160
Outbound CallerID : +9941255XXXXX
type=peer
[email protected]
secret=XXXXX
realm=ims.baktelecom.az
qualify=yes
port=5060
outboundproxy=10.0.5.138&10.0.5.10
nat=no
insecure=invite,port
host=10.0.5.138
[email protected]
fromdomain=ims02.baktelecom.az
dissallow=all
context=from-trunk
allow=ulaw&alaw
dtmfmode=inband
+9941255XXXXX:[email protected] /5519999
1 Like
Sam333:
endpttype=trunk
None of the settings listed below are valid chan_pjsip settings. Unlike chan_sip, chan_pjsip will not load misconfigured endpoints and having bad settings will trigger that. Not sure where you got these settings but they donāt exist and need to be removed.
force_privacyid
istrunk
t38_noattr
endpttype
dtmffmtp
lgaetz
(Lorne Gaetz)
May 3, 2023, 12:09pm
3
Sam333:
sip in freePBX
If youāre using FreePBX, itās inappropriate to edit pjsip.conf, you are told that right in the file. Use the GUI to configure trunks.
# cat /etc/asterisk/pjsip.conf
;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. ;
;--------------------------------------------------------------------------------;
; For information on adding additional paramaters to this file, please visit the ;
; FreePBX.org wiki page, or ask on IRC. This file was created by the new FreePBX ;
; BMO - Big Module Object. Any similarity in naming with BMO from Adventure Time ;
; is totally deliberate. ;
;--------------------------------------------------------------------------------;
Sam333
(Sam)
May 3, 2023, 4:16pm
4
ISP tells me to send an invite in this form. but the invitation from me is as follows. To fix it, I need your help. configured trunk chan_pjsip gui
ā---------------ISP told me to configure the invite as it follows below----------
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 129.9.31.245:5062;branch=z9hG4bK241404025;rport
Route: <sip:10.0.5.138:5060;lr>
From: "+99412374xxxx" <sip:[email protected] >;tag=1852062647
To: <sip:[email protected] >
Call-ID: [email protected]
CSeq: 20 INVITE
Contact: "+99412374xxxx" <sip:[email protected] :5062>
Max-Forwards: 70
User-Agent: Grandstream GXP1625 1.0.7.50
Privacy: none
P-Preferred-Identity: "+99412374xxxx" <sip:[email protected] >
P-Access-Network-Info: IEEE-EUI-48;eui-48-addr=90-75-BC-42-AB-30
P-Emergency-Info: IEEE-EUI-48;eui-48-addr=C0-74-AD-07-98-15
Supported: replaces, path, timer
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Type: application/sdp
Accept: application/sdp, application/dtmf-relay
Content-Length: 411
v=0
o=+99412374xxxx 8000 8000 IN IP4 129.9.31.245
s=SIP Call
c=IN IP4 129.9.31.245
t=0 0
m=audio 5006 RTP/AVP 0 8 4 18 9 97 2 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:8 PCMA/8000
----------------the invite from me to ISP is as follows below-------------
INVITE sip:10.0.5.138 SIP/2.0
Via: SIP/2.0/UDP 10.205.49.16:5060;rport;branch=z9hG4bKPjf50f7814-55ba-41dc-ab4d-060461e51d19
From: <sip:[email protected] >;tag=0ac340f5-2f16-45de-b7c2-16703cbc3b15
To: <sip:[email protected] >
Contact: <sip:[email protected] :5060>
Call-ID: 22345c6c-8329-4df1-86e1-f090169c8d41
CSeq: 5881 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Route: <sip:[email protected] :5060>
Max-Forwards: 70
User-Agent: FPBX-15.0.23.25(16.28.0)
Content-Type: application/sdp
Content-Length: 252
v=0
o=- 1349513375 1349513375 IN IP4 10.205.49.16
s=Asterisk
c=IN IP4 10.205.49.16
t=0 0
m=audio 11250 RTP/AVP 0 8 9 3
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
Stewart1
(Stewart)
May 3, 2023, 6:34pm
6
Try these changes (probably not complete but I hope it gets you close):
SIP Server: ims02.baktelecom.az
Outbound Proxy: 10.0.5.138:5060\;lr
From User: (same as Username)
Client URI: (leave blank)
Server URI: (leave blank)
Stewart1
(Stewart)
May 3, 2023, 6:44pm
7
Sorry, I messed up on the last post. See edit, which shows required \ in Outbound Proxy.
Sam333
(Sam)
May 4, 2023, 5:43am
8
Well, it didnāt work in this config @Stewart1
Sam333
(Sam)
May 4, 2023, 5:45am
9
I need to change the places of INVIT and Route as shown in the picture below, how can I do this?
Stewart1
(Stewart)
May 4, 2023, 5:53am
10
Sorry, I made an error in Outbound Proxy. Please try
sip:10.0.5.138\;lr
Sam333
(Sam)
May 4, 2023, 7:17am
11
Thank you very much.
Working
Sam333
(Sam)
May 4, 2023, 12:32pm
12
@Stewart1
now i get an error like below
Unsupported URI Scheme
IP/2.0 416 Unsupported URI Scheme
Via: SIP/2.0/UDP 10.0.5.138:5060;received=10.0.5.138;branch=z9hG4bKgi6f6ugogmf3f660edje0hmjd;Role=3;Hpt=8e92_36
Record-Route: <sip:10.0.5.138:5060;lr;Hpt=nw_70_6453ce88_13286be4_ex_8e92_16;CxtId=4;TRC=ffffffff-ffffffff;X-HwB2bUaCookie=14267>
Call-ID: [email protected]
From: <tel:374aaaa;phone-context=+99412;noa=subscriber;srvattri=national>;tag=fen2473k
To: <tel:551xxxx;phone-context=+99412>;tag=z9hG4bKgi6f6ugogmf3f660edje0hmjd
CSeq: 2 INVITE
Server: FPBX-15.0.23.25(16.28.0)
Content-Length
Stewart1
(Stewart)
May 4, 2023, 12:40pm
13
You need to update Asterisk to a version with tel URI support.
Asterisk just released 16.29.0, 18.15.0 and 19.7.0 that now have Tel URI support for Chan_PJSIP. It will now accept Tel URI incoming requests, however, Asterisk still cannot generate Tel URI headers for outgoing requests.
Also, 16.29.0 is the last supported released of v16 which is now officially Security Fixes Only.
Where did TEL URIās come into this? The INVITE format that you posted as āMy ISP wants thisā didnāt have a single TEL URI in it. How did this come about?
This will only work, as it says, on inbound calls. Asterisk cannot send calls with TEL URI right now, which is what this thread is about. Sending calls to the provider.
david55
(david55)
May 4, 2023, 1:37pm
16
I think it was a supplementary question, regarding the incoming calls they got after they registered.
Sam333
(Sam)
May 4, 2023, 2:36pm
17
The URI I mentioned above was sent by my ISP. they say that your pbx does not accept this URI
david55
(david55)
May 4, 2023, 4:42pm
18
Only the latest versions of Asterisk have any support for TEL: URIās in chan_pjsip, and then only for the most commonly encountered cases, of which this should be one. chan_sip does not officially support the at all, but does fault them either.
Sam333
(Sam)
May 5, 2023, 3:45am
19
It was fixed after updating Asterisk
system
(system)
Closed
May 12, 2023, 3:45am
20
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.