SIP Registered Trunk terminated calls

All viewers, I am facing an issue with my outbound calls using sip registered trunk, I registered successfully with the server.

localhost*CLI> sip show registry
Host                                    dnsmgr Username       Refresh State                Reg.Time                       N      5bbf689b1dbb      1785 Registered           Sat, 29 Oct 2022 06:21:51
1 SIP registrations.

as you can see above username 5bbf689b1dbb is registered successfully & when try to make outbound calls by this registered user I am getting the below error

Executing [97525319@cont:2] Dial("SIP/sipclient-00000004", "SIP/97525319@5bbf689b1dbbb2fd") in new stack
  == Using SIP RTP CoS mark 5
[Oct 29 06:46:22] ERROR[14570][C-00000003]: netsock2.c:271 ast_sockaddr_resolve: getaddrinfo("5bbf689b1dbbb2fd", "(null)", ...): Name or service not known
[Oct 29 06:46:22] WARNING[14570][C-00000003]: chan_sip.c:6069 create_addr: No such host: 5bbf689b1dbbb2fd
[Oct 29 06:46:22] WARNING[14570][C-00000003]: app_dial.c:2437 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [97525319@cont:4] Hangup("SIP/sipclient-00000004", "") in new stack
  == Spawn extension (cont, 97525319, 4) exited non-zero on 'SIP/sipclient-00000004'

sip.conf is

register =>


exten => _X.,1,Progress()
 same => n,Dial(SIP/${EXTEN:3}@5bbf689b1dbbb2fd)
 same => n,Dial(SIP/5bbf689b1dbbb2fd/${EXTEN:3})
 same => n,Hangup()

please help me out by guiding me where I am wrong, Thanks for your attention.

  1. your are using a deprecated channel driver, which will be removed in the next version (21) of Asterisk. Given the other issues indicate you are completely new to Asterisk, there appears to be no reason for not using chan_pjsip.

  2. you are referencing a peer section that does not exist in your sip.conf, so the peer name is being interpreted as a literal domain name, hence the no such host error. You also haven’t provided the shared secret in the dialstring (and you don’t have a sip.conf section to provide it).

As technical points, nowhere does the SIP RFC refer to trunks, and nothing in that RFC requires registration before making outbound calls, although people commonly use the term trunk, and some, but probably not many, providers only accept calls from endpoints registered to receive them.

Do you mean to say I can use a registered client only for incoming calls, not outgoing calls?

if yes then please tell me if PjSip can solve my problem, I want to use my sip registered client for outbound calls like a sip trunk.

SIP registration is a mechanism for telling the registrar where to send incoming calls. Whilst some systems may validate outgoing calls against registrations, SIP does not require that.

Both chan_sip and chan_pjsip can do outgoing calls with authentication, although no new installation should use chan_sip, except in specific circumstances (one of which just went away). Registration, on its own, doesn’t configure Asterisk to make outbound calls, or to accept incoming calls, except on an anonymous basis.

The second example in res_pjsip Configuration Examples - Asterisk Project - Asterisk Project Wiki is probably closest to what you want. Use the first example for your phones.

Although you should not be using chan_sip in new systems and should be planning to retire it in older ones, the typical sip.conf settings are in:

although, these days, I would use remotesecret, which didn’t exist when this was written, rather than a combination of secret and insecure.

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