Multiple Call Handling using PJSIP

A
alaa
Wed, Mar 2, 2016 1:04 PM

I am trying to create a system that can handle Multiple Calls
simultaneously and play announcements to each call.
I need to use PJSIP and PJMedia (not PJSUA).
Is there any document or sample code on how to use pjsip and pjmedia
with multiple calls , and what design structure i should create ?
should i create one conference bridge to handle all calls or a one for
every calls? should i create one pjmedia endpoint or multiple ?

--
Signatures

Kind Regards,

**

Alaa Al Ashkar

Senior Signaling Engineer

**

Apliman S.A.L. | P.O. Box 13-5412, Beirut, Lebanon

**

t.+961 1 785382/3 ext. 135 | m.+961 3 088231 | e.**
alaa@apliman.com mailto:alaa@apliman.com

*web.*http://www.apliman.com| *twi.*www.twitter.com
https://twitter.com/AplimanTech

in. www.linkedin.com/apliman
http://www.linkedin.com/company/apliman-technologies


Please consider the environment before printing this email.

/This email, including any attachment, is private and confidential. It
should not be read, copied, disclosed /

/or otherwise used by any person other than intended recipient(s). If
you have received this email in error, /

/please notify the sender immediately/

I am trying to create a system that can handle Multiple Calls simultaneously and play announcements to each call. I need to use PJSIP and PJMedia (not PJSUA). Is there any document or sample code on how to use pjsip and pjmedia with multiple calls , and what design structure i should create ? should i create one conference bridge to handle all calls or a one for every calls? should i create one pjmedia endpoint or multiple ? -- Signatures Kind Regards, ** *Alaa Al Ashkar* Senior Signaling Engineer ** *Apliman S.A.L*. | P.O. Box 13-5412, Beirut, Lebanon ** *t.*+961 1 785382/3 ext. 135 | *m.*+961 3 088231 | *e.*** alaa@apliman.com <mailto:alaa@apliman.com> *web.*http://www.apliman.com| *twi.*www.twitter.com <https://twitter.com/AplimanTech> *in.* www.linkedin.com/apliman <http://www.linkedin.com/company/apliman-technologies> --------------------------------------------------------------------------------------------------------------------- Please consider the environment before printing this email. /This email, including any attachment, is private and confidential. It should not be read, copied, disclosed / /or otherwise used by any person other than intended recipient(s). If you have received this email in error, / /please notify the sender immediately/
BG
Bill Gardner
Wed, Mar 2, 2016 3:10 PM

Hi Alaa,

It's pretty easy to code an announcement system using pjsua, and if you
don't want to use pjsua you can look at the pjsua code as a guide.
Basically when the call connects you create a wav player object and
connect it to the incoming call via the bridge. See the --auto-play
option in pjsua. You would use --null-audio option so your server
doesn't need an audio device to clock media flow. You can use a single
conference bridge and use this for all calls. However you will then be
limited to using a single processor core which might be a problem if you
want to handle hundreds of simultaneous calls. Creating a bridge for
each call is more complicated but will allow your server to take full
advantage of multiple cores and hence handle more calls.

Regards,

Bill

On 3/2/2016 8:04 AM, alaa wrote:

I am trying to create a system that can handle Multiple Calls
simultaneously and play announcements to each call.
I need to use PJSIP and PJMedia (not PJSUA).
Is there any document or sample code on how to use pjsip and pjmedia
with multiple calls , and what design structure i should create ?
should i create one conference bridge to handle all calls or a one for
every calls? should i create one pjmedia endpoint or multiple ?

--
Signatures

Kind Regards,

**

Alaa Al Ashkar

Senior Signaling Engineer

**

Apliman S.A.L. | P.O. Box 13-5412, Beirut, Lebanon

**

t.+961 1 785382/3 ext. 135 | m.+961 3 088231 | e.**
alaa@apliman.com mailto:alaa@apliman.com

web.http://www.apliman.comhttp://www.apliman.com|
*twi.*www.twitter.com https://twitter.com/AplimanTech

in. www.linkedin.com/apliman
http://www.linkedin.com/company/apliman-technologies


Please consider the environment before printing this email.

/This email, including any attachment, is private and confidential. It
should not be read, copied, disclosed /

/or otherwise used by any person other than intended recipient(s). If
you have received this email in error, /

/please notify the sender immediately/


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hi Alaa, It's pretty easy to code an announcement system using pjsua, and if you don't want to use pjsua you can look at the pjsua code as a guide. Basically when the call connects you create a wav player object and connect it to the incoming call via the bridge. See the --auto-play option in pjsua. You would use --null-audio option so your server doesn't need an audio device to clock media flow. You can use a single conference bridge and use this for all calls. However you will then be limited to using a single processor core which might be a problem if you want to handle hundreds of simultaneous calls. Creating a bridge for each call is more complicated but will allow your server to take full advantage of multiple cores and hence handle more calls. Regards, Bill On 3/2/2016 8:04 AM, alaa wrote: > I am trying to create a system that can handle Multiple Calls > simultaneously and play announcements to each call. > I need to use PJSIP and PJMedia (not PJSUA). > Is there any document or sample code on how to use pjsip and pjmedia > with multiple calls , and what design structure i should create ? > should i create one conference bridge to handle all calls or a one for > every calls? should i create one pjmedia endpoint or multiple ? > > > -- > Signatures > > Kind Regards, > > ** > > > *Alaa Al Ashkar* > > Senior Signaling Engineer > > ** > > *Apliman S.A.L*. | P.O. Box 13-5412, Beirut, Lebanon > > ** > > *t.*+961 1 785382/3 ext. 135 | *m.*+961 3 088231 | *e.*** > alaa@apliman.com <mailto:alaa@apliman.com> > > *web.*<http://www.apliman.com>http://www.apliman.com| > *twi.*www.twitter.com <https://twitter.com/AplimanTech> > > *in.* www.linkedin.com/apliman > <http://www.linkedin.com/company/apliman-technologies> > > --------------------------------------------------------------------------------------------------------------------- > > Please consider the environment before printing this email. > > /This email, including any attachment, is private and confidential. It > should not be read, copied, disclosed / > > /or otherwise used by any person other than intended recipient(s). If > you have received this email in error, / > > /please notify the sender immediately/ > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
A
alaa
Thu, Mar 3, 2016 8:47 AM

HI Bill ,

i am trying to create a system that should handle thousands of
simultaneous calls. Can pjsua handle such load?
How much simultaneous calls can pjsip with pjmedia using a bridge for
each call handle?
Thx
On 3/2/2016 5:10 PM, Bill Gardner wrote:

Hi Alaa,

It's pretty easy to code an announcement system using pjsua, and if
you don't want to use pjsua you can look at the pjsua code as a guide.
Basically when the call connects you create a wav player object and
connect it to the incoming call via the bridge. See the --auto-play
option in pjsua. You would use --null-audio option so your server
doesn't need an audio device to clock media flow. You can use a single
conference bridge and use this for all calls. However you will then be
limited to using a single processor core which might be a problem if
you want to handle hundreds of simultaneous calls. Creating a bridge
for each call is more complicated but will allow your server to take
full advantage of multiple cores and hence handle more calls.

Regards,

Bill

On 3/2/2016 8:04 AM, alaa wrote:

I am trying to create a system that can handle Multiple Calls
simultaneously and play announcements to each call.
I need to use PJSIP and PJMedia (not PJSUA).
Is there any document or sample code on how to use pjsip and pjmedia
with multiple calls , and what design structure i should create ?
should i create one conference bridge to handle all calls or a one
for every calls? should i create one pjmedia endpoint or multiple ?
//


Visit our blog:http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

HI Bill , i am trying to create a system that should handle thousands of simultaneous calls. Can pjsua handle such load? How much simultaneous calls can pjsip with pjmedia using a bridge for each call handle? Thx On 3/2/2016 5:10 PM, Bill Gardner wrote: > Hi Alaa, > > It's pretty easy to code an announcement system using pjsua, and if > you don't want to use pjsua you can look at the pjsua code as a guide. > Basically when the call connects you create a wav player object and > connect it to the incoming call via the bridge. See the --auto-play > option in pjsua. You would use --null-audio option so your server > doesn't need an audio device to clock media flow. You can use a single > conference bridge and use this for all calls. However you will then be > limited to using a single processor core which might be a problem if > you want to handle hundreds of simultaneous calls. Creating a bridge > for each call is more complicated but will allow your server to take > full advantage of multiple cores and hence handle more calls. > > Regards, > > Bill > > On 3/2/2016 8:04 AM, alaa wrote: >> I am trying to create a system that can handle Multiple Calls >> simultaneously and play announcements to each call. >> I need to use PJSIP and PJMedia (not PJSUA). >> Is there any document or sample code on how to use pjsip and pjmedia >> with multiple calls , and what design structure i should create ? >> should i create one conference bridge to handle all calls or a one >> for every calls? should i create one pjmedia endpoint or multiple ? >> // >> >> >> >> _______________________________________________ >> Visit our blog:http://blog.pjsip.org >> >> pjsip mailing list >> pjsip@lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
BG
Bill Gardner
Thu, Mar 3, 2016 3:59 PM

Hi Alaa,

I've never tested pjsua with more than about 50 calls but I don't see
why it couldn't scale to thousands. If you are using G711 with bridge
running at 8kHz then the media processing per call is very light, a
single core should be able to handle perhaps 100-200 calls, but I don't
know exactly. But if you are using a high def codec you will get far
fewer calls. You could create one bridge per core, so for example if
using an 8 core server you would create 8 bridges and as calls come in
you would assign them to the least loaded bridge. That may be simpler
than one bridge (and one media processing thread) per call.

I recommend you code up a single bridge answering system using pjsua,
and then load test it to see what kind of performance you get.

Regards,

Bill

On 3/3/2016 3:47 AM, alaa wrote:

HI Bill ,

i am trying to create a system that should handle thousands of
simultaneous calls. Can pjsua handle such load?
How much simultaneous calls can pjsip with pjmedia using a bridge for
each call handle?
Thx
On 3/2/2016 5:10 PM, Bill Gardner wrote:

Hi Alaa,

It's pretty easy to code an announcement system using pjsua, and if
you don't want to use pjsua you can look at the pjsua code as a
guide. Basically when the call connects you create a wav player
object and connect it to the incoming call via the bridge. See the
--auto-play option in pjsua. You would use --null-audio option so
your server doesn't need an audio device to clock media flow. You can
use a single conference bridge and use this for all calls. However
you will then be limited to using a single processor core which might
be a problem if you want to handle hundreds of simultaneous calls.
Creating a bridge for each call is more complicated but will allow
your server to take full advantage of multiple cores and hence handle
more calls.

Regards,

Bill

On 3/2/2016 8:04 AM, alaa wrote:

I am trying to create a system that can handle Multiple Calls
simultaneously and play announcements to each call.
I need to use PJSIP and PJMedia (not PJSUA).
Is there any document or sample code on how to use pjsip and pjmedia
with multiple calls , and what design structure i should create ?
should i create one conference bridge to handle all calls or a one
for every calls? should i create one pjmedia endpoint or multiple ?
//


Visit our blog:http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog:http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hi Alaa, I've never tested pjsua with more than about 50 calls but I don't see why it couldn't scale to thousands. If you are using G711 with bridge running at 8kHz then the media processing per call is very light, a single core should be able to handle perhaps 100-200 calls, but I don't know exactly. But if you are using a high def codec you will get far fewer calls. You could create one bridge per core, so for example if using an 8 core server you would create 8 bridges and as calls come in you would assign them to the least loaded bridge. That may be simpler than one bridge (and one media processing thread) per call. I recommend you code up a single bridge answering system using pjsua, and then load test it to see what kind of performance you get. Regards, Bill On 3/3/2016 3:47 AM, alaa wrote: > HI Bill , > > i am trying to create a system that should handle thousands of > simultaneous calls. Can pjsua handle such load? > How much simultaneous calls can pjsip with pjmedia using a bridge for > each call handle? > Thx > On 3/2/2016 5:10 PM, Bill Gardner wrote: >> Hi Alaa, >> >> It's pretty easy to code an announcement system using pjsua, and if >> you don't want to use pjsua you can look at the pjsua code as a >> guide. Basically when the call connects you create a wav player >> object and connect it to the incoming call via the bridge. See the >> --auto-play option in pjsua. You would use --null-audio option so >> your server doesn't need an audio device to clock media flow. You can >> use a single conference bridge and use this for all calls. However >> you will then be limited to using a single processor core which might >> be a problem if you want to handle hundreds of simultaneous calls. >> Creating a bridge for each call is more complicated but will allow >> your server to take full advantage of multiple cores and hence handle >> more calls. >> >> Regards, >> >> Bill >> >> On 3/2/2016 8:04 AM, alaa wrote: >>> I am trying to create a system that can handle Multiple Calls >>> simultaneously and play announcements to each call. >>> I need to use PJSIP and PJMedia (not PJSUA). >>> Is there any document or sample code on how to use pjsip and pjmedia >>> with multiple calls , and what design structure i should create ? >>> should i create one conference bridge to handle all calls or a one >>> for every calls? should i create one pjmedia endpoint or multiple ? >>> // >>> >>> >>> >>> _______________________________________________ >>> Visit our blog:http://blog.pjsip.org >>> >>> pjsip mailing list >>> pjsip@lists.pjsip.org >>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> >> >> _______________________________________________ >> Visit our blog:http://blog.pjsip.org >> >> pjsip mailing list >> pjsip@lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
NF
Norman Franke
Thu, Mar 3, 2016 8:51 PM

Using something like Asterisk would make this trivial, of course. It’s set up to do that out of the box, but is much more complicated.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com http://www.myasd.com/

On Mar 3, 2016, at 10:59 AM, Bill Gardner billg@wavearts.com wrote:

Hi Alaa,

I've never tested pjsua with more than about 50 calls but I don't see why it couldn't scale to thousands. If you are using G711 with bridge running at 8kHz then the media processing per call is very light, a single core should be able to handle perhaps 100-200 calls, but I don't know exactly. But if you are using a high def codec you will get far fewer calls. You could create one bridge per core, so for example if using an 8 core server you would create 8 bridges and as calls come in you would assign them to the least loaded bridge. That may be simpler than one bridge (and one media processing thread) per call.

I recommend you code up a single bridge answering system using pjsua, and then load test it to see what kind of performance you get.

Regards,

Bill

On 3/3/2016 3:47 AM, alaa wrote:

<Mail Attachment.gif> HI Bill ,

i am trying to create a system that should handle thousands of simultaneous calls. Can pjsua handle such load?
How much simultaneous calls can pjsip with pjmedia using a bridge for each call handle?
Thx
On 3/2/2016 5:10 PM, Bill Gardner wrote:

Hi Alaa,

It's pretty easy to code an announcement system using pjsua, and if you don't want to use pjsua you can look at the pjsua code as a guide. Basically when the call connects you create a wav player object and connect it to the incoming call via the bridge. See the --auto-play option in pjsua. You would use --null-audio option so your server doesn't need an audio device to clock media flow. You can use a single conference bridge and use this for all calls. However you will then be limited to using a single processor core which might be a problem if you want to handle hundreds of simultaneous calls. Creating a bridge for each call is more complicated but will allow your server to take full advantage of multiple cores and hence handle more calls.

Regards,

Bill

On 3/2/2016 8:04 AM, alaa wrote:

I am trying to create a system that can handle Multiple Calls simultaneously and play announcements to each call.
I need to use PJSIP and PJMedia (not PJSUA).
Is there any document or sample code on how to use pjsip and pjmedia with multiple calls , and what design structure i should create ?
should i create one conference bridge to handle all calls or a one for every calls? should i create one pjmedia endpoint or multiple ?

<Mail Attachment.gif>

Visit our blog: http://blog.pjsip.org http://blog.pjsip.org/

pjsip mailing list
pjsip@lists.pjsip.org mailto:pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Using something like Asterisk would make this trivial, of course. It’s set up to do that out of the box, but is much more complicated. Norman Franke Answering Service for Directors, Inc. www.myasd.com <http://www.myasd.com/> > On Mar 3, 2016, at 10:59 AM, Bill Gardner <billg@wavearts.com> wrote: > > Hi Alaa, > > I've never tested pjsua with more than about 50 calls but I don't see why it couldn't scale to thousands. If you are using G711 with bridge running at 8kHz then the media processing per call is very light, a single core should be able to handle perhaps 100-200 calls, but I don't know exactly. But if you are using a high def codec you will get far fewer calls. You could create one bridge per core, so for example if using an 8 core server you would create 8 bridges and as calls come in you would assign them to the least loaded bridge. That may be simpler than one bridge (and one media processing thread) per call. > > I recommend you code up a single bridge answering system using pjsua, and then load test it to see what kind of performance you get. > > Regards, > > Bill > > On 3/3/2016 3:47 AM, alaa wrote: >> <Mail Attachment.gif> >> HI Bill , >> >> i am trying to create a system that should handle thousands of simultaneous calls. Can pjsua handle such load? >> How much simultaneous calls can pjsip with pjmedia using a bridge for each call handle? >> Thx >> On 3/2/2016 5:10 PM, Bill Gardner wrote: >>> Hi Alaa, >>> >>> It's pretty easy to code an announcement system using pjsua, and if you don't want to use pjsua you can look at the pjsua code as a guide. Basically when the call connects you create a wav player object and connect it to the incoming call via the bridge. See the --auto-play option in pjsua. You would use --null-audio option so your server doesn't need an audio device to clock media flow. You can use a single conference bridge and use this for all calls. However you will then be limited to using a single processor core which might be a problem if you want to handle hundreds of simultaneous calls. Creating a bridge for each call is more complicated but will allow your server to take full advantage of multiple cores and hence handle more calls. >>> >>> Regards, >>> >>> Bill >>> >>> On 3/2/2016 8:04 AM, alaa wrote: >>>> I am trying to create a system that can handle Multiple Calls simultaneously and play announcements to each call. >>>> I need to use PJSIP and PJMedia (not PJSUA). >>>> Is there any document or sample code on how to use pjsip and pjmedia with multiple calls , and what design structure i should create ? >>>> should i create one conference bridge to handle all calls or a one for every calls? should i create one pjmedia endpoint or multiple ? >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> <Mail Attachment.gif> >>>> >>>> >>>> _______________________________________________ >>>> Visit our blog: http://blog.pjsip.org <http://blog.pjsip.org/> >>>> >>>> pjsip mailing list >>>> pjsip@lists.pjsip.org <mailto:pjsip@lists.pjsip.org> >>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org <http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org> >>> >>> >>> >>> _______________________________________________ >>> Visit our blog: http://blog.pjsip.org <http://blog.pjsip.org/> >>> >>> pjsip mailing list >>> pjsip@lists.pjsip.org <mailto:pjsip@lists.pjsip.org> >>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org <http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org> >> >> >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org <http://blog.pjsip.org/> >> >> pjsip mailing list >> pjsip@lists.pjsip.org <mailto:pjsip@lists.pjsip.org> >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org <http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
A
alaa
Fri, Mar 4, 2016 8:41 AM

Hi Bill ,

Keeping the coding complexity aside , which is the best design
architecture , having a bridge for each call , or a bridge per core.
which will achieve a best result using pjsip and pjmedia?
On 3/3/2016 5:59 PM, Bill Gardner wrote:

Hi Alaa,

I've never tested pjsua with more than about 50 calls but I don't see
why it couldn't scale to thousands. If you are using G711 with bridge
running at 8kHz then the media processing per call is very light, a
single core should be able to handle perhaps 100-200 calls, but I
don't know exactly. But if you are using a high def codec you will get
far fewer calls. You could create one bridge per core, so for example
if using an 8 core server you would create 8 bridges and as calls come
in you would assign them to the least loaded bridge. That may be
simpler than one bridge (and one media processing thread) per call.

I recommend you code up a single bridge answering system using pjsua,
and then load test it to see what kind of performance you get.

Regards,

Bill

On 3/3/2016 3:47 AM, alaa wrote:

HI Bill ,

i am trying to create a system that should handle thousands of
simultaneous calls. Can pjsua handle such load?
How much simultaneous calls can pjsip with pjmedia using a bridge for
each call handle?
Thx
On 3/2/2016 5:10 PM, Bill Gardner wrote:

Hi Alaa,

It's pretty easy to code an announcement system using pjsua, and if
you don't want to use pjsua you can look at the pjsua code as a
guide. Basically when the call connects you create a wav player
object and connect it to the incoming call via the bridge. See the
--auto-play option in pjsua. You would use --null-audio option so
your server doesn't need an audio device to clock media flow. You
can use a single conference bridge and use this for all calls.
However you will then be limited to using a single processor core
which might be a problem if you want to handle hundreds of
simultaneous calls. Creating a bridge for each call is more
complicated but will allow your server to take full advantage of
multiple cores and hence handle more calls.

Regards,

Bill

On 3/2/2016 8:04 AM, alaa wrote:

I am trying to create a system that can handle Multiple Calls
simultaneously and play announcements to each call.
I need to use PJSIP and PJMedia (not PJSUA).
Is there any document or sample code on how to use pjsip and
pjmedia with multiple calls , and what design structure i should
create ?
should i create one conference bridge to handle all calls or a one
for every calls? should i create one pjmedia endpoint or multiple ?
//


Visit our blog:http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog:http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog:http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hi Bill , Keeping the coding complexity aside , which is the best design architecture , having a bridge for each call , or a bridge per core. which will achieve a best result using pjsip and pjmedia? On 3/3/2016 5:59 PM, Bill Gardner wrote: > Hi Alaa, > > I've never tested pjsua with more than about 50 calls but I don't see > why it couldn't scale to thousands. If you are using G711 with bridge > running at 8kHz then the media processing per call is very light, a > single core should be able to handle perhaps 100-200 calls, but I > don't know exactly. But if you are using a high def codec you will get > far fewer calls. You could create one bridge per core, so for example > if using an 8 core server you would create 8 bridges and as calls come > in you would assign them to the least loaded bridge. That may be > simpler than one bridge (and one media processing thread) per call. > > I recommend you code up a single bridge answering system using pjsua, > and then load test it to see what kind of performance you get. > > Regards, > > Bill > > On 3/3/2016 3:47 AM, alaa wrote: >> HI Bill , >> >> i am trying to create a system that should handle thousands of >> simultaneous calls. Can pjsua handle such load? >> How much simultaneous calls can pjsip with pjmedia using a bridge for >> each call handle? >> Thx >> On 3/2/2016 5:10 PM, Bill Gardner wrote: >>> Hi Alaa, >>> >>> It's pretty easy to code an announcement system using pjsua, and if >>> you don't want to use pjsua you can look at the pjsua code as a >>> guide. Basically when the call connects you create a wav player >>> object and connect it to the incoming call via the bridge. See the >>> --auto-play option in pjsua. You would use --null-audio option so >>> your server doesn't need an audio device to clock media flow. You >>> can use a single conference bridge and use this for all calls. >>> However you will then be limited to using a single processor core >>> which might be a problem if you want to handle hundreds of >>> simultaneous calls. Creating a bridge for each call is more >>> complicated but will allow your server to take full advantage of >>> multiple cores and hence handle more calls. >>> >>> Regards, >>> >>> Bill >>> >>> On 3/2/2016 8:04 AM, alaa wrote: >>>> I am trying to create a system that can handle Multiple Calls >>>> simultaneously and play announcements to each call. >>>> I need to use PJSIP and PJMedia (not PJSUA). >>>> Is there any document or sample code on how to use pjsip and >>>> pjmedia with multiple calls , and what design structure i should >>>> create ? >>>> should i create one conference bridge to handle all calls or a one >>>> for every calls? should i create one pjmedia endpoint or multiple ? >>>> // >>>> >>>> >>>> >>>> _______________________________________________ >>>> Visit our blog:http://blog.pjsip.org >>>> >>>> pjsip mailing list >>>> pjsip@lists.pjsip.org >>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>> >>> >>> >>> _______________________________________________ >>> Visit our blog:http://blog.pjsip.org >>> >>> pjsip mailing list >>> pjsip@lists.pjsip.org >>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> >> >> _______________________________________________ >> Visit our blog:http://blog.pjsip.org >> >> pjsip mailing list >> pjsip@lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
OH
Omar Hussein
Fri, Mar 4, 2016 10:19 AM

Hi alaa,

I found that with a single bridge I could get around 30 calls playing a wav
file (continuous tone) before I would hear a stutter in the tone.  So I
create a bridge for each call and store them in an array like is done for
the players array in pjsua.  I tested 96 simultaneous calls with no stutter
in the tone.  I'm sure it could go much higher.

Obviously if the application requires two calls to be bridged then you need
to move the calls to the same bridge first and destroy the one that is no
longer in use.
I wonder if it would be possible to cascade the bridges by making outbound
SIP calls back to the server, auto answering and connecting the relevant
ports so that two bridges are cascaded via the RTP stream.

One thing I found is that if you follow the example
http://trac.pjsip.org/repos/wiki/FAQ#pjsua-lib-perf and de-initialize as
follows.

pjmedia_master_port_stop(cd->m);
pjmedia_master_port_destroy(cd->m, PJ_FALSE);

There is a thread handle leak as pjmedia_master_port_stop sets the
clock thread to NULL.  Then pj_thread_destroy is never called in
pjmedia_master_port_destroy since the clock thread is already NULL.

Regards,

Omar

On Fri, Mar 4, 2016 at 7:41 PM, alaa alaa@apliman.com wrote:

Hi Bill ,

Keeping the coding complexity aside , which is the best design
architecture , having a bridge for each call , or a bridge per core. which
will achieve a best result using pjsip and pjmedia?

On 3/3/2016 5:59 PM, Bill Gardner wrote:

Hi Alaa,

I've never tested pjsua with more than about 50 calls but I don't see why
it couldn't scale to thousands. If you are using G711 with bridge running
at 8kHz then the media processing per call is very light, a single core
should be able to handle perhaps 100-200 calls, but I don't know exactly.
But if you are using a high def codec you will get far fewer calls. You
could create one bridge per core, so for example if using an 8 core server
you would create 8 bridges and as calls come in you would assign them to
the least loaded bridge. That may be simpler than one bridge (and one media
processing thread) per call.

I recommend you code up a single bridge answering system using pjsua, and
then load test it to see what kind of performance you get.

Regards,

Bill

On 3/3/2016 3:47 AM, alaa wrote:

HI Bill ,

i am trying to create a system that should handle thousands of
simultaneous calls. Can pjsua handle such load?
How much simultaneous calls can pjsip with pjmedia using a bridge for each
call handle?
Thx
On 3/2/2016 5:10 PM, Bill Gardner wrote:

Hi Alaa,

It's pretty easy to code an announcement system using pjsua, and if you
don't want to use pjsua you can look at the pjsua code as a guide.
Basically when the call connects you create a wav player object and connect
it to the incoming call via the bridge. See the --auto-play option in
pjsua. You would use --null-audio option so your server doesn't need an
audio device to clock media flow. You can use a single conference bridge
and use this for all calls. However you will then be limited to using a
single processor core which might be a problem if you want to handle
hundreds of simultaneous calls. Creating a bridge for each call is more
complicated but will allow your server to take full advantage of multiple
cores and hence handle more calls.

Regards,

Bill

On 3/2/2016 8:04 AM, alaa wrote:

I am trying to create a system that can handle Multiple Calls
simultaneously and play announcements to each call.
I need to use PJSIP and PJMedia (not PJSUA).
Is there any document or sample code on how to use pjsip and pjmedia with
multiple calls , and what design structure i should create ?
should i create one conference bridge to handle all calls or a one for
every calls? should i create one pjmedia endpoint or multiple ?


Visit our blog: http://blog.pjsip.org

pjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog: http://blog.pjsip.org

pjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog: http://blog.pjsip.org

pjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog: http://blog.pjsip.org

pjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hi alaa, I found that with a single bridge I could get around 30 calls playing a wav file (continuous tone) before I would hear a stutter in the tone. So I create a bridge for each call and store them in an array like is done for the players array in pjsua. I tested 96 simultaneous calls with no stutter in the tone. I'm sure it could go much higher. Obviously if the application requires two calls to be bridged then you need to move the calls to the same bridge first and destroy the one that is no longer in use. I wonder if it would be possible to cascade the bridges by making outbound SIP calls back to the server, auto answering and connecting the relevant ports so that two bridges are cascaded via the RTP stream. One thing I found is that if you follow the example http://trac.pjsip.org/repos/wiki/FAQ#pjsua-lib-perf and de-initialize as follows. pjmedia_master_port_stop(cd->m); pjmedia_master_port_destroy(cd->m, PJ_FALSE); There is a thread handle leak as pjmedia_master_port_stop sets the clock thread to NULL. Then pj_thread_destroy is never called in pjmedia_master_port_destroy since the clock thread is already NULL. Regards, Omar On Fri, Mar 4, 2016 at 7:41 PM, alaa <alaa@apliman.com> wrote: > > > Hi Bill , > > Keeping the coding complexity aside , which is the best design > architecture , having a bridge for each call , or a bridge per core. which > will achieve a best result using pjsip and pjmedia? > > On 3/3/2016 5:59 PM, Bill Gardner wrote: > > Hi Alaa, > > I've never tested pjsua with more than about 50 calls but I don't see why > it couldn't scale to thousands. If you are using G711 with bridge running > at 8kHz then the media processing per call is very light, a single core > should be able to handle perhaps 100-200 calls, but I don't know exactly. > But if you are using a high def codec you will get far fewer calls. You > could create one bridge per core, so for example if using an 8 core server > you would create 8 bridges and as calls come in you would assign them to > the least loaded bridge. That may be simpler than one bridge (and one media > processing thread) per call. > > I recommend you code up a single bridge answering system using pjsua, and > then load test it to see what kind of performance you get. > > Regards, > > Bill > > On 3/3/2016 3:47 AM, alaa wrote: > > HI Bill , > > i am trying to create a system that should handle thousands of > simultaneous calls. Can pjsua handle such load? > How much simultaneous calls can pjsip with pjmedia using a bridge for each > call handle? > Thx > On 3/2/2016 5:10 PM, Bill Gardner wrote: > > Hi Alaa, > > It's pretty easy to code an announcement system using pjsua, and if you > don't want to use pjsua you can look at the pjsua code as a guide. > Basically when the call connects you create a wav player object and connect > it to the incoming call via the bridge. See the --auto-play option in > pjsua. You would use --null-audio option so your server doesn't need an > audio device to clock media flow. You can use a single conference bridge > and use this for all calls. However you will then be limited to using a > single processor core which might be a problem if you want to handle > hundreds of simultaneous calls. Creating a bridge for each call is more > complicated but will allow your server to take full advantage of multiple > cores and hence handle more calls. > > Regards, > > Bill > > On 3/2/2016 8:04 AM, alaa wrote: > > I am trying to create a system that can handle Multiple Calls > simultaneously and play announcements to each call. > I need to use PJSIP and PJMedia (not PJSUA). > Is there any document or sample code on how to use pjsip and pjmedia with > multiple calls , and what design structure i should create ? > should i create one conference bridge to handle all calls or a one for > every calls? should i create one pjmedia endpoint or multiple ? > > > > > > > > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >