PJSIP Multiple Trunks to Match by endpoint

Hi

I have a Asterisk 16.19.1 server with multiple trunks registering to a single SIP provider. Currently the trunks use the identify to match based on the IP address:

 Identify:  27123456789/27123456789
      Match: 192.168.1.1/32

ParameterName : ParameterValue

endpoint      : 27123456789
match         : 192.168.1.1/255.255.255.255
match_header  : 
srv_lookups   : true

-----
 Identify:  27123456780/27123456780
      Match: 192.168.1.1/32

ParameterName : ParameterValue

endpoint      : 27123456780
match         : 192.168.1.1/255.255.255.255
match_header  : 
srv_lookups   : true

Problem:
Call received on the trunk reflects as the first endpoint it matches. I would like to have them each match their corresponding endpoint.

Executing [27123456780@external:1] Goto(“PJSIP/27123456789-00032312”, “inbound,27123456780,1”) in new stack

I believe Match_header is an option rather then match ip. But I can’t find any good documentation on how to set it up.

Below is the SIP Invite:

INVITE sip:27123456789@192.168.18.1 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.1:5060;branch=z9hG4bKac401655354
Max-Forwards: 67
From: Test <sip:27116082663@192.168.1.1>;tag=1c1483238104
To: <sip:27123456789@192.168.1.10>
Call-ID: 167528158130120249713@192.168.1.1
CSeq: 1 INVITE
Contact: <sip:192.168.1.1:5060>
Supported: sdp-anat
Allow: INVITE, ACK, BYE, CANCEL, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS, UPDATE
Remote-Party-ID: Test <sip:27116082663@192.168.1.1>;party=calling;screen=no
Expires: 300
User-Agent: Mediant VE SBC/v.7.40A.250.440
P-Asserted-Identity: Test <sip:27111111111@192.168.1.1>
Content-Type: application/sdp
Content-Length: 318
h323-conf-id: 363901196-4060245324-2250076917-2250076917
cisco-GUID: 363901196-4060245324-2250076917-2250076917
vm_id: 144402846830120249712@192.168.1.1

How will the match_header=“To: sip:27123456789” work?

but found this as well.

You need to set sends_line_with_registrations=yes

;sends_line_with_registrations= ; Setting this to true will cause the wizard to
; skip the creation of an identify object to match
; incoming requests to the endpoint and instead add the
; line and endpoint parameters to the outbound
; registration object.

Hello.
match_header=To: <sip:11111@domain> - it’s work now. I use it.
You can find a right string in INVITE packet. Copy full with < >.

I don’t make use of pjsip type=wizard. I don’t think this will work.

It is set on the outbound registration, then:

line=yes
endpoint=<name of endpoint to use>
1 Like

Thank you, adding this fixed all of my trunks:

line=yes
endpoint=<name of endpoint to use>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.