SIP user agent and RTP proxy combo - how?

ZC
Zarko Coklin
Mon, Sep 18, 2017 12:32 AM

Hi all!

I would like to achieve PJSIP to work in some sort of a hybrid mode. SIP-wise it will act as a full SIP client (registers, make and receives video with audio calls).  Instead of using a local camera device it would receive an RTP input from a local device.

For example, when it gets an incoming call from a remote SIP client, it will be able to answer the call through SIP. PJSIP will not use a video froma local camera to send the video. Rather, it will simply proxy an RTP coming from a local device to a remote SIP client. And the local device will be getting a video coming from a remote SIP client. Hence, it is simply proxying RTP back and forth. The same applies to outgoing calls.

Graphically, it can be represented as on the diagram below. My question is what would be the best approach to accomplish this with PJSIP? Ideally, PJSUA2 but I accept ideas at any API level.

Regards,
Zarko

Remote SIP client (IP1 addr)    PJSIP (IP2 addr)    Local device (IP3 addr)
|                                |                    |
|-------------INVITE------------->|                    |
|<------------100 Trying----------|                    |
|<------------180 Ringing---------|                    |
|<--------------200 OK -----------|                    |
|---------------ACK ------------->|                    |
|                                |                    |
|===============RTP1=============>|                    |
|                                |=========RTP1=======>|
|                                |<========RTP2========|
|<==============RTP2==============|                    |
|                                |                    |
|                                |                    |
|----------------BYE------------->|                    |
|<--------------200 OK -----------|                    |
|                                |                    |
|                                |                    |

Hi all! I would like to achieve PJSIP to work in some sort of a hybrid mode. SIP-wise it will act as a full SIP client (registers, make and receives video with audio calls). Instead of using a local camera device it would receive an RTP input from a local device. For example, when it gets an incoming call from a remote SIP client, it will be able to answer the call through SIP. PJSIP will not use a video froma local camera to send the video. Rather, it will simply proxy an RTP coming from a local device to a remote SIP client. And the local device will be getting a video coming from a remote SIP client. Hence, it is simply proxying RTP back and forth. The same applies to outgoing calls. Graphically, it can be represented as on the diagram below. My question is what would be the best approach to accomplish this with PJSIP? Ideally, PJSUA2 but I accept ideas at any API level. Regards, Zarko Remote SIP client (IP1 addr) PJSIP (IP2 addr) Local device (IP3 addr) | | | |-------------INVITE------------->| | |<------------100 Trying----------| | |<------------180 Ringing---------| | |<--------------200 OK -----------| | |---------------ACK ------------->| | | | | |===============RTP1=============>| | | |=========RTP1=======>| | |<========RTP2========| |<==============RTP2==============| | | | | | | | |----------------BYE------------->| | |<--------------200 OK -----------| | | | | | | |
Лухнов Андрей Олегович
Mon, Sep 18, 2017 7:46 AM

Zarko,

in the similar scenario we've ended up with creating dedicated pjmedia_vid_dev_factory which in turn creates render device baked by a gstreamer pipeline.

От: "Zarko Coklin" zcoklin@hotmail.com
Кому: "pjsip" pjsip@lists.pjsip.org
Отправленные: Понедельник, 18 Сентябрь 2017 г 3:32:02
Тема: [pjsip] SIP user agent and RTP proxy combo - how?

Hi all!

I would like to achieve PJSIP to work in some sort of a hybrid mode. SIP-wise it will act as a full SIP client (registers, make and receives video with audio calls). Instead of using a local camera device it would receive an RTP input from a local device.

For example, when it gets an incoming call from a remote SIP client, it will be able to answer the call through SIP. PJSIP will not use a video froma local camera to send the video. Rather, it will simply proxy an RTP coming from a local device to a remote SIP client. And the local device will be getting a video coming from a remote SIP client. Hence, it is simply proxying RTP back and forth. The same applies to outgoing calls.

Graphically, it can be represented as on the diagram below. My question is what would be the best approach to accomplish this with PJSIP? Ideally, PJSUA2 but I accept ideas at any API level.

Regards,
Zarko

Remote SIP client (IP1 addr) PJSIP (IP2 addr) Local device (IP3 addr)
| | |
|-------------INVITE------------->| |
|<------------100 Trying----------| |
|<------------180 Ringing---------| |
|<--------------200 OK -----------| |
|---------------ACK ------------->| |
| | |
|===============RTP1=============>| |
| |=========RTP1=======>|
| |<========RTP2========|
|<==============RTP2==============| |
| | |
| | |
|----------------BYE------------->| |
|<--------------200 OK -----------| |
| | |
| | |


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

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

Zarko, in the similar scenario we've ended up with creating dedicated pjmedia_vid_dev_factory which in turn creates render device baked by a gstreamer pipeline. От: "Zarko Coklin" <zcoklin@hotmail.com> Кому: "pjsip" <pjsip@lists.pjsip.org> Отправленные: Понедельник, 18 Сентябрь 2017 г 3:32:02 Тема: [pjsip] SIP user agent and RTP proxy combo - how? Hi all! I would like to achieve PJSIP to work in some sort of a hybrid mode. SIP-wise it will act as a full SIP client (registers, make and receives video with audio calls). Instead of using a local camera device it would receive an RTP input from a local device. For example, when it gets an incoming call from a remote SIP client, it will be able to answer the call through SIP. PJSIP will not use a video froma local camera to send the video. Rather, it will simply proxy an RTP coming from a local device to a remote SIP client. And the local device will be getting a video coming from a remote SIP client. Hence, it is simply proxying RTP back and forth. The same applies to outgoing calls. Graphically, it can be represented as on the diagram below. My question is what would be the best approach to accomplish this with PJSIP? Ideally, PJSUA2 but I accept ideas at any API level. Regards, Zarko Remote SIP client (IP1 addr) PJSIP (IP2 addr) Local device (IP3 addr) | | | |-------------INVITE------------->| | |<------------100 Trying----------| | |<------------180 Ringing---------| | |<--------------200 OK -----------| | |---------------ACK ------------->| | | | | |===============RTP1=============>| | | |=========RTP1=======>| | |<========RTP2========| |<==============RTP2==============| | | | | | | | |----------------BYE------------->| | |<--------------200 OK -----------| | | | | | | | _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Žarko Coklin
Mon, Sep 18, 2017 1:56 PM

Thanks Andrei for the info. How difficult was to accomplish all this?

Z


From: pjsip pjsip-bounces@lists.pjsip.org on behalf of Лухнов Андрей Олегович loukhnov@lotes-tm.ru
Sent: September 18, 2017 3:46 AM
To: pjsip
Subject: Re: [pjsip] SIP user agent and RTP proxy combo - how?

Zarko,

in the similar scenario we've ended up with creating dedicated pjmedia_vid_dev_factory which in turn creates render device baked by a gstreamer pipeline.


От: "Zarko Coklin" zcoklin@hotmail.com
Кому: "pjsip" pjsip@lists.pjsip.org
Отправленные: Понедельник, 18 Сентябрь 2017 г 3:32:02
Тема: [pjsip] SIP user agent and RTP proxy combo - how?

Hi all!

I would like to achieve PJSIP to work in some sort of a hybrid mode. SIP-wise it will act as a full SIP client (registers, make and receives video with audio calls).  Instead of using a local camera device it would receive an RTP input from a local device.

For example, when it gets an incoming call from a remote SIP client, it will be able to answer the call through SIP. PJSIP will not use a video froma local camera to send the video. Rather, it will simply proxy an RTP coming from a local device to a remote SIP client. And the local device will be getting a video coming from a remote SIP client. Hence, it is simply proxying RTP back and forth. The same applies to outgoing calls.

Graphically, it can be represented as on the diagram below. My question is what would be the best approach to accomplish this with PJSIP? Ideally, PJSUA2 but I accept ideas at any API level.

Regards,
Zarko

Remote SIP client (IP1 addr)    PJSIP (IP2 addr)    Local device (IP3 addr)
|                                |                    |
|-------------INVITE------------->|                    |
|<------------100 Trying----------|                    |
|<------------180 Ringing---------|                    |
|<--------------200 OK -----------|                    |
|---------------ACK ------------->|                    |
|                                |                    |
|===============RTP1=============>|                    |
|                                |=========RTP1=======>|
|                                |<========RTP2========|
|<==============RTP2==============|                    |
|                                |                    |
|                                |                    |
|----------------BYE------------->|                    |
|<--------------200 OK -----------|                    |
|                                |                    |
|                                |                    |


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

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

Thanks Andrei for the info. How difficult was to accomplish all this? Z ________________________________ From: pjsip <pjsip-bounces@lists.pjsip.org> on behalf of Лухнов Андрей Олегович <loukhnov@lotes-tm.ru> Sent: September 18, 2017 3:46 AM To: pjsip Subject: Re: [pjsip] SIP user agent and RTP proxy combo - how? Zarko, in the similar scenario we've ended up with creating dedicated pjmedia_vid_dev_factory which in turn creates render device baked by a gstreamer pipeline. ________________________________ От: "Zarko Coklin" <zcoklin@hotmail.com> Кому: "pjsip" <pjsip@lists.pjsip.org> Отправленные: Понедельник, 18 Сентябрь 2017 г 3:32:02 Тема: [pjsip] SIP user agent and RTP proxy combo - how? Hi all! I would like to achieve PJSIP to work in some sort of a hybrid mode. SIP-wise it will act as a full SIP client (registers, make and receives video with audio calls). Instead of using a local camera device it would receive an RTP input from a local device. For example, when it gets an incoming call from a remote SIP client, it will be able to answer the call through SIP. PJSIP will not use a video froma local camera to send the video. Rather, it will simply proxy an RTP coming from a local device to a remote SIP client. And the local device will be getting a video coming from a remote SIP client. Hence, it is simply proxying RTP back and forth. The same applies to outgoing calls. Graphically, it can be represented as on the diagram below. My question is what would be the best approach to accomplish this with PJSIP? Ideally, PJSUA2 but I accept ideas at any API level. Regards, Zarko Remote SIP client (IP1 addr) PJSIP (IP2 addr) Local device (IP3 addr) | | | |-------------INVITE------------->| | |<------------100 Trying----------| | |<------------180 Ringing---------| | |<--------------200 OK -----------| | |---------------ACK ------------->| | | | | |===============RTP1=============>| | | |=========RTP1=======>| | |<========RTP2========| |<==============RTP2==============| | | | | | | | |----------------BYE------------->| | |<--------------200 OK -----------| | | | | | | | _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
GL
Gang Liu
Tue, Sep 19, 2017 3:26 AM

maybe you could consider use pjsip-ua api (pjsip inv and pjsip regc)and a
simple socket rtp proxy.

regards,
Gang

On Mon, Sep 18, 2017 at 8:32 AM, Zarko Coklin zcoklin@hotmail.com wrote:

Hi all!

I would like to achieve PJSIP to work in some sort of a hybrid mode.
SIP-wise it will act as a full SIP client (registers, make and receives
video with audio calls).  Instead of using a local camera device it would
receive an RTP input from a local device.

For example, when it gets an incoming call from a remote SIP client, it
will be able to answer the call through SIP. PJSIP will not use a video
froma local camera to send the video. Rather, it will simply proxy an RTP
coming from a local device to a remote SIP client. And the local device
will be getting a video coming from a remote SIP client. Hence, it is
simply proxying RTP back and forth. The same applies to outgoing calls.

Graphically, it can be represented as on the diagram below. My question is
what would be the best approach to accomplish this with PJSIP? Ideally,
PJSUA2 but I accept ideas at any API level.

Regards,
Zarko

Remote SIP client (IP1 addr)    PJSIP (IP2 addr)    Local device (IP3
addr)
|                                |                    |
|-------------INVITE------------->|                    |
|<------------100 Trying----------|                    |
|<------------180 Ringing---------|                    |
|<--------------200 OK -----------|                    |
|---------------ACK ------------->|                    |
|                                |                    |
|===============RTP1=============>|                    |
|                                |=========RTP1=======>|
|                                |<========RTP2========|
|<==============RTP2==============|                    |
|                                |                    |
|                                |                    |
|----------------BYE------------->|                    |
|<--------------200 OK -----------|                    |
|                                |                    |
|                                |                    |


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

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

maybe you could consider use pjsip-ua api (pjsip inv and pjsip regc)and a simple socket rtp proxy. regards, Gang On Mon, Sep 18, 2017 at 8:32 AM, Zarko Coklin <zcoklin@hotmail.com> wrote: > Hi all! > > I would like to achieve PJSIP to work in some sort of a hybrid mode. > SIP-wise it will act as a full SIP client (registers, make and receives > video with audio calls). Instead of using a local camera device it would > receive an RTP input from a local device. > > For example, when it gets an incoming call from a remote SIP client, it > will be able to answer the call through SIP. PJSIP will not use a video > froma local camera to send the video. Rather, it will simply proxy an RTP > coming from a local device to a remote SIP client. And the local device > will be getting a video coming from a remote SIP client. Hence, it is > simply proxying RTP back and forth. The same applies to outgoing calls. > > Graphically, it can be represented as on the diagram below. My question is > what would be the best approach to accomplish this with PJSIP? Ideally, > PJSUA2 but I accept ideas at any API level. > > Regards, > Zarko > > > Remote SIP client (IP1 addr) PJSIP (IP2 addr) Local device (IP3 > addr) > | | | > |-------------INVITE------------->| | > |<------------100 Trying----------| | > |<------------180 Ringing---------| | > |<--------------200 OK -----------| | > |---------------ACK ------------->| | > | | | > |===============RTP1=============>| | > | |=========RTP1=======>| > | |<========RTP2========| > |<==============RTP2==============| | > | | | > | | | > |----------------BYE------------->| | > |<--------------200 OK -----------| | > | | | > | | | > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >