Hello everyone
We have an application that accepts and sends INVITEs from/to specified IPs via SIP URIs on port 5064.
I created a ‘TestAppTrunk’ PJSIP Trunk:
Then I went added the below to pjsip.transports_custom.conf
[testapp-udp]
type=transport
protocol=udp
bind=0.0.0.0:5064
external_media_address=xx.xxx.xxx.xx
external_signaling_address=xx.xxx.xxx.xx
allow_reload=no
tos=cs3
cos=3
local_net=10.128.14.0/24
local_net=192.168.1.0/24
And then the below to pjsip.endpoint_custom_post.conf
[TestAppTrunk](+)
transport=testapp-udp
I can confirm that the Trunk is now using the custom transport
yplab*CLI> pjsip show endpoint TestAppTrunk
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: TestAppTrunk Unavailable 0 of inf
Aor: TestAppTrunk 0
Contact: TestAppTrunk/sip:10.128.14.109:5064 871ada327c Unavail nan
Transport: testapp-udp udp 3 96 0.0.0.0:5064
Identify: TestAppTrunk/TestAppTrunk
Match: 10.128.14.109/32
Match: 192.168.1.224/32
Match: xx.xxx.xx.xx/32
Match: 10.128.14.201/32
The application can successfully send an INVITE to the PBX by calling sip:[email protected]:5064
However, I have two issues.
Issue #1: Outgoing calls
It seems that if the PJSIP endpoint does not have an active/online AOR, then it will not even try to call the URI. Reading here: Redirect a call to SIP URI when endpoint is unavailable - #3 by billsimon it seems that calling the PJSIP Trunk directly should work (although I can’t confirm the actual setting since the pictures aren’t loading in that post) but when I try, it fails.
yplab*CLI> channel originate PJSIP/55412@TestAppTrunk application echo
[2023-02-15 06:27:13] ERROR[10921]: res_pjsip.c:849 ast_sip_create_dialog_uac: Endpoint 'TestAppTrunk': Could not create dialog to invalid URI 'TestAppTrunk'. Is endpoint registered and reachable?
[2023-02-15 06:27:13] ERROR[10921]: chan_pjsip.c:2672 request: Failed to create outgoing session to endpoint 'TestAppTrunk'
What am I missing?
Issue #2: Incoming calls to :5060
Even tho we set the Trunk to use a custom UDP transport which listens on :5064, Asterisk will accept calls on both :5064 and :5060 (the original PJSIP UDP/5060). Is there any way we can restrict that it should only be able to accept calls on :5064?
Meaning, this Trunk has the IP of the Application and listens on 5064. If the Application sends a call to :5060, why isn’t it treated as an anonymous/SIP Guest call?
Appreciate any pointers
Thanks