2
votes

I recently migrated our old server to new Asterisk with PJSIP, we are using database and AGI to control calls. Our customer can set up calls to either PSTN or Sip endpoints. In old sip server, we were using the following command in AGI.

SIP/#######@sipserverip.com,30,HL(299940000:7000:5000)

Now for PJSIP I have changed following for my PSTN it is working perfectly, same string but for outbound Sip calls I am getting errors. As my PSTN trunk is registered so it is working,

 PJSIP/#######@sipserverip.com,30,HL(299940000:7000:5000)

It is giving me error

Unable to create PJSIP channel - endpoint 'sipserverip.com' was not found

I can fix it using pjsip.conf file and add this endpoint, but my issue is I have a huge number of endpoints in my database and there should be another solution, is it anything in configuration? as we don't add these IPS in the system but just forward calls to another sip endpoint. And the user has the option to add more endpoints too. We are not using sip registration, neither allow sipper real-time user management.

Thanks for helping out.

2

2 Answers

3
votes

Thank @arheops after few tries I resolved the issue. I need to create one PJSIP endpoint in my PJSIP.conf file with the following information. I understand need to reduce this configuration, but now call is going perfectly. Thank you for help, the following is configuration maybe it will someone else to sort out the issue.

[outgoing]
type = aor
maximum_expiration = 60
minimum_expiration = 60
default_expiration = 180

[outgoing]
type = identify
endpoint = outgoing

[outgoing]
type = endpoint
context = default
dtmf_mode = none
disallow = all
allow = all
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes
direct_media = no
language = en
aors = outgoing
t38_udptl = yes
t38_udptl_ec = none
1
votes
same => n,Dial(PJSIP/default_endpoint/sip:[email protected]:5060)

Please note, defualt_endpoint should be VALID endpoint specified in config. That way it get connection parameters(codecs etc) from default_endpoint and call directly to url specified(ignore endpoint ip).

It is clearly described in asterisk documentation project

https://wiki.asterisk.org/wiki/display/AST/Dialing+PJSIP+Channels