Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] PJSIP realtime: lots of problems


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
mulitskiy at acedsl.com
Guest





PostPosted: Thu Oct 08, 2015 12:32 pm    Post subject: [asterisk-users] PJSIP realtime: lots of problems Reply with quote

Hello,

I wonder if anybody is using PJSIP realtime in production environment?
I've started to play with it and encountered many problems.
Here's my config:

sorcery.conf:
[res_pjsip]
endpoint=realtime,ps_endpoints

extconfig.conf:
[settings]
ps_endpoints => pgsql,users,pjsip_endpoints_v

pjsip_endpoints_v is postgresql view.

1. The biggest problem: if I have small number of endpoints (roughly up to a 100) then
asterisk loads ok and pjsip seems to be working ok (with other problems described below).
If I have larger number of endpoints (several hundred) then intermittently (but often) asterisk
just hangs during loading. Attempting to start asterisk with console (-c) it never reaches the user
prompt. pjsip isn't functional (doesn't reply to any sip messages). the only way out is to kill asterisk.
It looks like I'm hitting some limit here. Am I doing something wrong? Is there any config
option I'm missing?

2. When it loads ok then it performs initial load of all endpoints individually. Looking at postgres
log it does the following:

SELECT * FROM pjsip_endpoints_v WHERE id LIKE '%' ORDER BY id
SELECT * FROM pjsip_endpoints_v WHERE id = 'ep1'
SELECT * FROM pjsip_endpoints_v WHERE id = 'ep2'
...
SELECT * FROM pjsip_endpoints_v WHERE id = 'epN'

Needless to say it's extremely inefficient with larger number of endpoints.
After this initial load it seems to work correctly - loading endpoints on demand and caching them if I configure caching.
Is there a way to disable this initial load? I want it to load endpoints on demand only.

3. When pjsip receives sip message and tries to match it to endpoint by 'From' username it initially
performs lookup for 'username@domain' and if it fails it falls back to lookup by username only.
Looking at the postgres log it looks like the following:
SELECT * FROM pjsip_endpoints_v WHERE id = 'ep1@domain'
SELECT * FROM pjsip_endpoints_v WHERE id = 'ep1'

In my environment the domain part may be different (depending on which proxy the user is terminated) and
I want to perform lookup on userpart only. Is there a way to tell pjsip to ignore the domain? Otherwise it doubles
the number of queries per request and that's again extremely inefficient.

I'd appreciate any help and/or pointers.
Thanks a lot,

Michael
Back to top
jcolp at digium.com
Guest





PostPosted: Thu Oct 08, 2015 12:37 pm    Post subject: [asterisk-users] PJSIP realtime: lots of problems Reply with quote

On 15-10-08 02:32 PM, Michael Ulitskiy wrote:
Quote:
Hello,

I wonder if anybody is using PJSIP realtime in production environment?

They are.

<snip>

Quote:

1. The biggest problem: if I have small number of endpoints (roughly up
to a 100) then

asterisk loads ok and pjsip seems to be working ok (with other problems
described below).

If I have larger number of endpoints (several hundred) then
intermittently (but often) asterisk

just hangs during loading. Attempting to start asterisk with console
(-c) it never reaches the user

prompt. pjsip isn't functional (doesn't reply to any sip messages). the
only way out is to kill asterisk.

It looks like I'm hitting some limit here. Am I doing something wrong?
Is there any config

option I'm missing?

Nope, you'd have to attach gdb to Asterisk and determine where it is
hanging. It may still be loading stuff.

Quote:

2. When it loads ok then it performs initial load of all endpoints
individually. Looking at postgres

log it does the following:

SELECT * FROM pjsip_endpoints_v WHERE id LIKE '%' ORDER BY id

SELECT * FROM pjsip_endpoints_v WHERE id = 'ep1'

SELECT * FROM pjsip_endpoints_v WHERE id = 'ep2'

...

SELECT * FROM pjsip_endpoints_v WHERE id = 'epN'

Needless to say it's extremely inefficient with larger number of endpoints.

After this initial load it seems to work correctly - loading endpoints
on demand and caching them if I configure caching.

Is there a way to disable this initial load? I want it to load endpoints
on demand only.

3. When pjsip receives sip message and tries to match it to endpoint by
'From' username it initially

performs lookup for 'username@domain' and if it fails it falls back to
lookup by username only.

Looking at the postgres log it looks like the following:

SELECT * FROM pjsip_endpoints_v WHERE id = 'ep1@domain'

SELECT * FROM pjsip_endpoints_v WHERE id = 'ep1'

In my environment the domain part may be different (depending on which
proxy the user is terminated) and

I want to perform lookup on userpart only. Is there a way to tell pjsip
to ignore the domain? Otherwise it doubles

the number of queries per request and that's again extremely inefficient.

The answer to both of your questions is no, there is currently no way to
disable either.

--
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
asterisk3 at pi4tel.de
Guest





PostPosted: Thu Oct 08, 2015 1:02 pm    Post subject: [asterisk-users] PJSIP realtime: lots of problems Reply with quote

Hello Michael

On Thu, Oct 08, 2015 at 01:32:07PM -0400, Michael Ulitskiy wrote:
Quote:

extconfig.conf:
[settings]
ps_endpoints => pgsql,users,pjsip_endpoints_v

Does it change anything if you use odbc instead of pgsql?
I did some testing with chan_sip/pgsql and had much less problems
when pgsql was replaced by odbc.


Quote:
1. The biggest problem: if I have small number of endpoints (roughly up to a 100) then
asterisk loads ok and pjsip seems to be working ok (with other problems described below).
If I have larger number of endpoints (several hundred) then intermittently (but often) asterisk
just hangs during loading. Attempting to start asterisk with console (-c) it never reaches the user
prompt. pjsip isn't functional (doesn't reply to any sip messages).

Did you try "core show locks" in this situation?


--
Stefan Tichy ( asterisk3 at pi4tel dot de )

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
mulitskiy at acedsl.com
Guest





PostPosted: Thu Oct 08, 2015 3:36 pm    Post subject: [asterisk-users] PJSIP realtime: lots of problems Reply with quote

On Thursday, October 08, 2015 08:02:19 PM Stefan Tichy wrote:
Quote:
Hello Michael

On Thu, Oct 08, 2015 at 01:32:07PM -0400, Michael Ulitskiy wrote:
Quote:

extconfig.conf:
[settings]
ps_endpoints => pgsql,users,pjsip_endpoints_v

Does it change anything if you use odbc instead of pgsql?
I did some testing with chan_sip/pgsql and had much less problems
when pgsql was replaced by odbc.

for some reason i can't make it work.
i've installed and configured odbc. asterisk tells me it's connected:

*CLI> odbc show

ODBC DSN Settings
-----------------

Name: asterisk
DSN: asterisk
Last connection attempt: 1969-12-31 19:00:00
Pooled: No
Connected: Yes

i've changed extconfig.conf as follows:
ps_endpoints => odbc,asterisk

Now asterisk logs the following:
WARNING[966]: config.c:2905 find_engine: Realtime mapping for 'ps_endpoints' found to engine 'odbc', but the engine is not available
and don't see any queries in database log. Am I doing something wrong?

Quote:

Quote:
1. The biggest problem: if I have small number of endpoints (roughly up to a 100) then
asterisk loads ok and pjsip seems to be working ok (with other problems described below).
If I have larger number of endpoints (several hundred) then intermittently (but often) asterisk
just hangs during loading. Attempting to start asterisk with console (-c) it never reaches the user
prompt. pjsip isn't functional (doesn't reply to any sip messages).

Did you try "core show locks" in this situation?

Yes, it seems to deadlock in res_config_pgsql.
I've opened an asterisk issue here: https://issues.asterisk.org/jira/browse/ASTERISK-25455
Will see where it goes.
Thanks,

Michael
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services