Multiple from the same SIP provider

Hi,

I want 've many SIP trunks from the same SIP provider, do i need to 've only one identify section in PJSIPconf ?
and how can i match an incoming call to which endpoint must end ?

Thanks

Insufficient information about your requirements.

If registering, try the line option. Otherwise look at an incoming request and talk to the provider about what information can be used.

Generally it is best to have just one account. Are you trying to use consumer accounts for resale, or a SOHO provider for a medium sized enterprise?

HI David,

I ve 2 sip trunks from the same sip provider in one PBX where the provider requires to register these trunks. i can make outbound calls but the problem is with the incoming call in any of those 2 numbers, i cannot distinguise to which endpoint the provider must send the call ? i used match_header in the identify section for each trunk based on the username of each trunk

Does the line option work?

you have tu use send_lines_with_registrations

Le 26/05/2025 à 10:06, daras via Asterisk Community a écrit :

[daras] daras https://community.asterisk.org/u/daras
May 26

HI David,

I ve 2 sip trunks from the same sip provider in one PBX where the
provider requires to register these trunks. i can make outbound calls
but the problem is with the incoming call in any of those 2 numbers, i
cannot distinguise to which endpoint the provider must send the call ?
i used match_header in the identify section for each trunk based on
the username of each trunk


Visit Topic
https://community.asterisk.org/t/multiple-from-the-same-sip-provider/108526/3
or reply to this email to respond.


    In Reply To

[david551] david551 https://community.asterisk.org/u/david551
May 26

Insufficient information about your requirements. If registering, try
the line option. Otherwise look at an incoming request and talk to the
provider about what information can be used. Generally it is best to
have just one account. Are you trying to use consumer accounts for
resale, or a SOHO…

Visit Topic
https://community.asterisk.org/t/multiple-from-the-same-sip-provider/108526/3
or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here
<>.


Daniel

no the line option dont work

[trunk1]
type=endpoint
transport=0.0.0.0-udp
context=from-providers
disallow=all
;allow=g722,alaw,g729,gsm
allow=alaw,ulaw,slin
aors=trunk1
send_connected_line=false
rtp_keepalive=0
language=en
outbound_auth=trunk1
from_user=trunk1
contact_user=trunk1
user_eq_phone=no
t38_udptl=yes
t38_udptl_ec=none
fax_detect=no
trust_id_inbound=no
t38_udptl_nat=no
send_pai=yes
direct_media=no
rtp_symmetric=yes
dtmf_mode=auto

[trunk1]
type=aor
qualify_frequency=30
contact=sip:trunk1@provider.com

[trunk1]
type=auth
auth_type=userpass
password=trunk1
username=trunk1

[trunk1]
type=identify
endpoint=trunk1
match=provider.com
match_header=To:sip:trunk1@provider.com


[trunk1]
type=registration
transport=0.0.0.0-udp
outbound_auth=trunk1
retry_interval=60
fatal_retry_interval=60
forbidden_retry_interval=60
max_retries=1000000
expiration=120
auth_rejection_permanent=no
line=yes
endpoint=trunk1
contact_user=trunk1
server_uri=sip:provider.com
client_uri=sip:trunk1@provider.com


[trunk2]
type=endpoint
transport=0.0.0.0-udp
context=from-providers
disallow=all
;allow=g722,alaw,g729,gsm
allow=alaw,ulaw,slin
aors=trunk2
send_connected_line=false
rtp_keepalive=0
language=en
outbound_auth=trunk2
from_user=trunk2
contact_user=trunk2
user_eq_phone=no
t38_udptl=yes
t38_udptl_ec=none
fax_detect=no
trust_id_inbound=no
t38_udptl_nat=no
send_pai=yes
direct_media=no
rtp_symmetric=yes
dtmf_mode=auto
;force_rport = yes ;ors
;rewrite_contact = yes ;ors

[trunk2]
type=aor
qualify_frequency=30
contact=sip:trunk2@provider.com

[trunk2]
type=auth
auth_type=userpass
password=xxxxxxxxxxx
username=trunk2

[trunk2]
type=identify
endpoint=trunk2
match=provider.com
match_header=To:sip:trunk2@provider.com


;
[trunk2]
type=registration
transport=0.0.0.0-udp
outbound_auth=trunk2
retry_interval=60
fatal_retry_interval=60
forbidden_retry_interval=60
max_retries=1000000
expiration=120
auth_rejection_permanent=no
line=yes
endpoint=trunk2
contact_user=trunk2
server_uri=sip:provider.com
client_uri=sip:trunk2@provider.com

Hi,
Any idea what might me wrong in my PJSIP.conf ?

Probably nothing. You are trying to use a provider in a way in which they don’t expect to be used.

I think match conditions are ORed, not ANDed.

(Well, actually, you have too many explicit settings, which makes it difficult to see the wood for the trees.)