# Hello world: Cannot setup pjsip

**URL:** <https://community.asterisk.org/t/hello-world-cannot-setup-pjsip/102588>\
**Category:** Asterisk Support\
**Created:** [May 22, 2024, 7:28am UTC](https://community.asterisk.org/t/hello-world-cannot-setup-pjsip/102588 "2024-05-22T07:28:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![SleepingFish](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@SleepingFish](https://community.asterisk.org/u/SleepingFish)\
**Post date:** [May 22, 2024, 7:28am UTC](https://community.asterisk.org/t/hello-world-cannot-setup-pjsip/102588/1 "2024-05-22T07:28:43Z")

</div>

Hello.  
I am trying to setup hello-world pjsip example as written in the wiki.  
My pjsip.conf:

```auto
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[6001]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=6001
aors=6001

[6001]
type=auth
auth_type=userpass
password=6001pass
username=6001

[6001]
type=aor
max_contacts=1

```

extensions.conf:

```auto
[from-internal]
exten => 100,1,Answer()
same => n,Wait(1)
same => n,Playback(hello-world)
same => n,Hangup()

```

Why my softphone is trying to connect to the asterisk, i see the following message in cli:

```auto
[May 22 10:22:17] NOTICE[951]: chan_sip.c:29060 handle_request_register: Registration from '"6001" <sip:6001@192.168.122.207>' failed for '192.168.122.1:5060' - Wrong password

```

So somewhy the call is processed by chan\_sip.  
If chan\_sip is unloaded by `module unload chan_sip`, then i see no messages in cli when softphone is trying to connect.  
An there are even no open sip ports:

```auto
# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name    
tcp 0 0 127.0.0.1:5038 0.0.0.0:* LISTEN 879/asterisk        
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 861/cupsd           
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 499/systemd-resolve 
tcp 0 0 127.0.0.54:53 0.0.0.0:* LISTEN 499/systemd-resolve 
tcp6 0 0 ::1:631 :::* LISTEN 861/cupsd

```

Module res\_pjsp is loaded, as shown by `module show`:

```auto
res_pjsip.so Basic SIP resource 51 Running core

```

So the question is: what i forgot do do to enable test call via pjsip?

P.S.

```auto
$ asterisk -V
Asterisk 20.6.0~dfsg+~cs6.13.40431414-2build5

```

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [May 22, 2024, 8:04am UTC](https://community.asterisk.org/t/hello-world-cannot-setup-pjsip/102588/2 "2024-05-22T08:04:52Z")

</div>

Check the console output at startup to see if PJSIP is loading, and if it is if it is presenting any log messages. You can also use “module show like pjsip” to see if any of the modules loaded. If you see no mention of PJSIP, then it may not be installed from the packages or modules.conf is configured to not load things.

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [May 22, 2024, 8:09am UTC](https://community.asterisk.org/t/hello-world-cannot-setup-pjsip/102588/3 "2024-05-22T08:09:36Z")

</div>

Only one driver can claim port 5060. You should disable loading for it.

Also if you install a supported version of Asterisk, built with default settings, chan\_sip will not get loaded, and may not even get built. That suggests you are installing an old version.

---

<div class="post-metadata">

**Author:** ![SleepingFish](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@SleepingFish](https://community.asterisk.org/u/SleepingFish)\
**Post date:** [May 25, 2024, 11:43am UTC](https://community.asterisk.org/t/hello-world-cannot-setup-pjsip/102588/4 "2024-05-25T11:43:48Z")

</div>

Quoting my first message

> Module res\_pjsp is loaded, as shown by `module show`

---

<div class="post-metadata">

**Author:** ![SleepingFish](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@SleepingFish](https://community.asterisk.org/u/SleepingFish)\
**Post date:** [May 25, 2024, 11:47am UTC](https://community.asterisk.org/t/hello-world-cannot-setup-pjsip/102588/5 "2024-05-25T11:47:08Z")

</div>

It is the default version in ubuntu 24.04. Is it supported?

Also, i checked /var/log/asterisk/messages.log and found many identical errors:

> ERROR[1894] res\_sorcery\_config.c: Unable to load config file ‘pjsip.conf’

But no additional info why it cannot read the config

---

<div class="post-metadata">

**Author:** ![Pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pooh](https://community.asterisk.org/u/Pooh)\
**Post date:** [May 25, 2024, 12:02pm UTC](https://community.asterisk.org/t/hello-world-cannot-setup-pjsip/102588/6 "2024-05-25T12:02:10Z")

</div>

On Saturday 25 May 2024 at 13:58:03, SleepingFish via Asterisk Community  
wrote:

> It is the default version in ubuntu 24.04. Is it supported?

[https://docs.asterisk.org/About-the-Project/Asterisk-Versions/](https://docs.asterisk.org/About-the-Project/Asterisk-Versions/)

> Also, i checked /var/log/asterisk/messages.log and found many identical  
> errors:  
> ERROR[1894] res\_sorcery\_config.c: Unable to load config file ‘pjsip.conf’
> 
> But no additional info why it cannot read the config

What are the ownership / permissions on that file?

Are they different from any of the other files in /etc/asterisk?

Antony.

–  
A good conversation is like a miniskirt;  
short enough to retain interest,  
but long enough to cover the subject.

- Celeste Headlee

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [May 25, 2024, 2:06pm UTC](https://community.asterisk.org/t/hello-world-cannot-setup-pjsip/102588/7 "2024-05-25T14:06:16Z")

</div>

> [@SleepingFish](#):
>
> It is the default version in ubuntu 24.04. Is it supported?

Asterisk 20 is supported, but it is unlikely that Ubuntu meets the default configuration condition.

---

<div class="post-metadata">

**Author:** ![SleepingFish](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@SleepingFish](https://community.asterisk.org/u/SleepingFish)\
**Post date:** [May 25, 2024, 4:25pm UTC](https://community.asterisk.org/t/hello-world-cannot-setup-pjsip/102588/8 "2024-05-25T16:25:40Z")

</div>

Yes, permissions were the reason. I forgot that I created config files as root.  
After permissions fixing everything works, thank you!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [June 24, 2024, 4:25pm UTC](https://community.asterisk.org/t/hello-world-cannot-setup-pjsip/102588/9 "2024-06-24T16:25:42Z")

</div>

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