HI,
how to handle sip-over-websocket load balancing (WebRTC)
it's posible dispatching websocket request?
I am try to connect browser(WebRTC) to sip-phone and vice versa,How i can achieve more concurrent call(more then 1000 call)
On Sat, Jun 13, 2015 at 8:49 PM, Alex Balashov abalashov@evaristesys.com wrote:
That question is difficult to answer without some elaboration on your part as to what you want to achieve.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. *From: *Murugan Pandian *Sent: *Saturday, June 13, 2015 09:47 *To: *sr-users@lists.sip-router.org *Reply To: *Kamailio (SER) - Users Mailing List *Subject: *[SR-Users] SIP-over-Websocket Load Balancing
HI,
how to handle sip-over-websocket load balancing (WebRTC)
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Well, I performed that by creating a media relay consisting of 2 freeswitches and using rtpengine.
You just need to handle WebRTC by kamailio using kamailio websocket module: http://kamailio.org/docs/modules/4.3.x/modules/websocket.html caruzdias-es configuration helped me a lot in understanding how websockets work on Kamailio: https://github.com/caruizdiaz/kamailio-ws But be aware, this configuration is for peer2peer connections, not for dispatching!
Kamailio will send simple SIP packets to the media relay then.
Also I used different NAT-traversal mechanism for sip and ws traffic (different routes based on client's transport protocol). Also you'll maybe need to have different rtpengine flags for sip and ws - remember that WebRTC MUST have SRTP, but I had some issues in transfering the SRTP handshake in sipphone<-->kamailio<-->freeswitch scheme, so on webrtc connection my "incoming" rtpengine had RTP/AVP flag, and on outgoing webrtc it MUST have RTP/SAVP For usual SIP calls I also conveted everything to RTP/AVP.
So you'll need to know to which type of user - ws or tcp/udp you're calling to understand which type of RTP to send them.
2015-06-13 19:07 GMT+03:00 Murugan Pandian manpower13.cse@gmail.com:
it's posible dispatching websocket request?
I am try to connect browser(WebRTC) to sip-phone and vice versa,How i can achieve more concurrent call(more then 1000 call)
On Sat, Jun 13, 2015 at 8:49 PM, Alex Balashov abalashov@evaristesys.com wrote:
That question is difficult to answer without some elaboration on your part as to what you want to achieve.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. *From: *Murugan Pandian *Sent: *Saturday, June 13, 2015 09:47 *To: *sr-users@lists.sip-router.org *Reply To: *Kamailio (SER) - Users Mailing List *Subject: *[SR-Users] SIP-over-Websocket Load Balancing
HI,
how to handle sip-over-websocket load balancing (WebRTC)
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Sorry, a mistake: on outgoing webrtc it MUST have RTP/SAVP or RTP/SAVPF
2015-06-13 21:54 GMT+03:00 Alexandru Covalschi 568691@gmail.com:
Well, I performed that by creating a media relay consisting of 2 freeswitches and using rtpengine.
You just need to handle WebRTC by kamailio using kamailio websocket module: http://kamailio.org/docs/modules/4.3.x/modules/websocket.html caruzdias-es configuration helped me a lot in understanding how websockets work on Kamailio: https://github.com/caruizdiaz/kamailio-ws But be aware, this configuration is for peer2peer connections, not for dispatching!
Kamailio will send simple SIP packets to the media relay then.
Also I used different NAT-traversal mechanism for sip and ws traffic (different routes based on client's transport protocol). Also you'll maybe need to have different rtpengine flags for sip and ws - remember that WebRTC MUST have SRTP, but I had some issues in transfering the SRTP handshake in sipphone<-->kamailio<-->freeswitch scheme, so on webrtc connection my "incoming" rtpengine had RTP/AVP flag, and on outgoing webrtc it MUST have RTP/SAVP For usual SIP calls I also conveted everything to RTP/AVP.
So you'll need to know to which type of user - ws or tcp/udp you're calling to understand which type of RTP to send them.
2015-06-13 19:07 GMT+03:00 Murugan Pandian manpower13.cse@gmail.com:
it's posible dispatching websocket request?
I am try to connect browser(WebRTC) to sip-phone and vice versa,How i can achieve more concurrent call(more then 1000 call)
On Sat, Jun 13, 2015 at 8:49 PM, Alex Balashov <abalashov@evaristesys.com
wrote:
That question is difficult to answer without some elaboration on your part as to what you want to achieve.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. *From: *Murugan Pandian *Sent: *Saturday, June 13, 2015 09:47 *To: *sr-users@lists.sip-router.org *Reply To: *Kamailio (SER) - Users Mailing List *Subject: *[SR-Users] SIP-over-Websocket Load Balancing
HI,
how to handle sip-over-websocket load balancing (WebRTC)
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alexandru Covalschi ABRISS-Solutions VoIP engineer and system administrator phone: +37367398493 web: http://abs-telecom.com/
HI Alexandru,
i try to connect like this
!--Freeswitch(IVR,Callcenter,dialplan,sip auth)
Browser(chrome,firefox,opera)--(WS)--->Kamailio--->!
!--Freeswitch(IVR,Callcenter,dialplan,sip auth)
i understand Kamailio only handling signalling(using websocket) but stream goes to peer-to-peer ,But i need to play ivr and handle callcenter (freeswitch)
so here i try to kamailiio act proxy server
Any idea how i can achieve thid
On Sun, Jun 14, 2015 at 12:24 AM, Alexandru Covalschi 568691@gmail.com wrote:
Well, I performed that by creating a media relay consisting of 2 freeswitches and using rtpengine.
You just need to handle WebRTC by kamailio using kamailio websocket module: http://kamailio.org/docs/modules/4.3.x/modules/websocket.html caruzdias-es configuration helped me a lot in understanding how websockets work on Kamailio: https://github.com/caruizdiaz/kamailio-ws But be aware, this configuration is for peer2peer connections, not for dispatching!
Kamailio will send simple SIP packets to the media relay then.
Also I used different NAT-traversal mechanism for sip and ws traffic (different routes based on client's transport protocol). Also you'll maybe need to have different rtpengine flags for sip and ws - remember that WebRTC MUST have SRTP, but I had some issues in transfering the SRTP handshake in sipphone<-->kamailio<-->freeswitch scheme, so on webrtc connection my "incoming" rtpengine had RTP/AVP flag, and on outgoing webrtc it MUST have RTP/SAVP For usual SIP calls I also conveted everything to RTP/AVP.
So you'll need to know to which type of user - ws or tcp/udp you're calling to understand which type of RTP to send them.
2015-06-13 19:07 GMT+03:00 Murugan Pandian manpower13.cse@gmail.com:
it's posible dispatching websocket request?
I am try to connect browser(WebRTC) to sip-phone and vice versa,How i can achieve more concurrent call(more then 1000 call)
On Sat, Jun 13, 2015 at 8:49 PM, Alex Balashov <abalashov@evaristesys.com
wrote:
That question is difficult to answer without some elaboration on your part as to what you want to achieve.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. *From: *Murugan Pandian *Sent: *Saturday, June 13, 2015 09:47 *To: *sr-users@lists.sip-router.org *Reply To: *Kamailio (SER) - Users Mailing List *Subject: *[SR-Users] SIP-over-Websocket Load Balancing
HI,
how to handle sip-over-websocket load balancing (WebRTC)
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alexandru Covalschi ABRISS-Solutions VoIP engineer and system administrator phone: +37367398493 web: http://abs-telecom.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hi, sorry, my previus answer wasn't clear enough - was writing it in a very sleepy mood :)
No, kamailio acts as a full proxy server for websocket and SIP. P2P is for caruzdias's configuration from github. You can try following this http://nil.uniza.sk/sip/kamailio/configuring-kamailio-4x-websocket guide for editing your current configuration file to support WebRTC. But as I said, you can face some problems with NAT-traversal, so you may to create different routes for ws and simple SIP. Also, if you use Asterisk - make sure your version doesn't have some problems with understanding SRTP handshake (RTP/SAVPF) - be sure that you have last stable version of your branch (my colleague spent 3 days to figure out that there was a bug in his version). However, even after update we couldn't perform a transparent proxy for SRTP, so I used rtpengine with such scheme:
1. On each registration user's proto is stored in redis database 2. When rtpengine is being called, Kamailio checks user's proto a) If user is WS and is incoming call, dispatch him to media relay with RTP/AVP flag b) If user is WS and is outgoing call (from media relay) send it to the endpoint with RTP/SAVPF flag c) If user is SIP and is incoming call, dispatch it to media-relay with RTP/AVP flag (some SIP clients also have SRTP turned on by default) d) If user is SIP and is outgoing call, send it to endpoint without any RTP flags (most sipphones ca recognize which traffic is incomig)
This configurations works well both with Asterisk and Freeswitch, but Freeswitch in my practice can provide more concurent calls for lesser cost.
2015-06-13 22:24 GMT+03:00 Murugan Pandian manpower13.cse@gmail.com:
HI Alexandru,
i try to connect like this
!--Freeswitch(IVR,Callcenter,dialplan,sip auth)
Browser(chrome,firefox,opera)--(WS)--->Kamailio--->!
!--Freeswitch(IVR,Callcenter,dialplan,sip auth)
i understand Kamailio only handling signalling(using websocket) but
stream goes to peer-to-peer ,But i need to play ivr and handle callcenter (freeswitch)
so here i try to kamailiio act proxy server
Any idea how i can achieve thid
On Sun, Jun 14, 2015 at 12:24 AM, Alexandru Covalschi 568691@gmail.com wrote:
Well, I performed that by creating a media relay consisting of 2 freeswitches and using rtpengine.
You just need to handle WebRTC by kamailio using kamailio websocket module: http://kamailio.org/docs/modules/4.3.x/modules/websocket.html caruzdias-es configuration helped me a lot in understanding how websockets work on Kamailio: https://github.com/caruizdiaz/kamailio-ws But be aware, this configuration is for peer2peer connections, not for dispatching!
Kamailio will send simple SIP packets to the media relay then.
Also I used different NAT-traversal mechanism for sip and ws traffic (different routes based on client's transport protocol). Also you'll maybe need to have different rtpengine flags for sip and ws - remember that WebRTC MUST have SRTP, but I had some issues in transfering the SRTP handshake in sipphone<-->kamailio<-->freeswitch scheme, so on webrtc connection my "incoming" rtpengine had RTP/AVP flag, and on outgoing webrtc it MUST have RTP/SAVP For usual SIP calls I also conveted everything to RTP/AVP.
So you'll need to know to which type of user - ws or tcp/udp you're calling to understand which type of RTP to send them.
2015-06-13 19:07 GMT+03:00 Murugan Pandian manpower13.cse@gmail.com:
it's posible dispatching websocket request?
I am try to connect browser(WebRTC) to sip-phone and vice versa,How i can achieve more concurrent call(more then 1000 call)
On Sat, Jun 13, 2015 at 8:49 PM, Alex Balashov < abalashov@evaristesys.com> wrote:
That question is difficult to answer without some elaboration on your part as to what you want to achieve.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. *From: *Murugan Pandian *Sent: *Saturday, June 13, 2015 09:47 *To: *sr-users@lists.sip-router.org *Reply To: *Kamailio (SER) - Users Mailing List *Subject: *[SR-Users] SIP-over-Websocket Load Balancing
HI,
how to handle sip-over-websocket load balancing (WebRTC)
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alexandru Covalschi ABRISS-Solutions VoIP engineer and system administrator phone: +37367398493 web: http://abs-telecom.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Thanks ALexandru
You have any route logic (script) for bellow operation
1. On each registration user's proto is stored in redis database 2. When rtpengine is being called, Kamailio checks user's proto a) If user is WS and is incoming call, dispatch him to media relay with RTP/AVP flag b) If user is WS and is outgoing call (from media relay) send it to the endpoint with RTP/SAVPF flag c) If user is SIP and is incoming call, dispatch it to media-relay with RTP/AVP flag (some SIP clients also have SRTP turned on by default) d) If user is SIP and is outgoing call, send it to endpoint without any RTP flags (most sipphones ca recognize which traffic is incomig)
Because i am new for Kamailio ,And how i can store user's proto to redis
On Sun, Jun 14, 2015 at 5:06 PM, Alexandru Covalschi 568691@gmail.com wrote:
Hi, sorry, my previus answer wasn't clear enough - was writing it in a very sleepy mood :)
No, kamailio acts as a full proxy server for websocket and SIP. P2P is for caruzdias's configuration from github. You can try following this http://nil.uniza.sk/sip/kamailio/configuring-kamailio-4x-websocket guide for editing your current configuration file to support WebRTC. But as I said, you can face some problems with NAT-traversal, so you may to create different routes for ws and simple SIP. Also, if you use Asterisk - make sure your version doesn't have some problems with understanding SRTP handshake (RTP/SAVPF) - be sure that you have last stable version of your branch (my colleague spent 3 days to figure out that there was a bug in his version). However, even after update we couldn't perform a transparent proxy for SRTP, so I used rtpengine with such scheme:
- On each registration user's proto is stored in redis database
- When rtpengine is being called, Kamailio checks user's proto a) If user is WS and is incoming call, dispatch him to media relay
with RTP/AVP flag b) If user is WS and is outgoing call (from media relay) send it to the endpoint with RTP/SAVPF flag c) If user is SIP and is incoming call, dispatch it to media-relay with RTP/AVP flag (some SIP clients also have SRTP turned on by default) d) If user is SIP and is outgoing call, send it to endpoint without any RTP flags (most sipphones ca recognize which traffic is incomig)
This configurations works well both with Asterisk and Freeswitch, but Freeswitch in my practice can provide more concurent calls for lesser cost.
2015-06-13 22:24 GMT+03:00 Murugan Pandian manpower13.cse@gmail.com:
HI Alexandru,
i try to connect like this
!--Freeswitch(IVR,Callcenter,dialplan,sip auth)
Browser(chrome,firefox,opera)--(WS)--->Kamailio--->!
!--Freeswitch(IVR,Callcenter,dialplan,sip auth)
i understand Kamailio only handling signalling(using websocket) but
stream goes to peer-to-peer ,But i need to play ivr and handle callcenter (freeswitch)
so here i try to kamailiio act proxy server
Any idea how i can achieve thid
On Sun, Jun 14, 2015 at 12:24 AM, Alexandru Covalschi 568691@gmail.com wrote:
Well, I performed that by creating a media relay consisting of 2 freeswitches and using rtpengine.
You just need to handle WebRTC by kamailio using kamailio websocket module: http://kamailio.org/docs/modules/4.3.x/modules/websocket.html caruzdias-es configuration helped me a lot in understanding how websockets work on Kamailio: https://github.com/caruizdiaz/kamailio-ws But be aware, this configuration is for peer2peer connections, not for dispatching!
Kamailio will send simple SIP packets to the media relay then.
Also I used different NAT-traversal mechanism for sip and ws traffic (different routes based on client's transport protocol). Also you'll maybe need to have different rtpengine flags for sip and ws
- remember that WebRTC MUST have SRTP, but I had some issues in transfering
the SRTP handshake in sipphone<-->kamailio<-->freeswitch scheme, so on webrtc connection my "incoming" rtpengine had RTP/AVP flag, and on outgoing webrtc it MUST have RTP/SAVP For usual SIP calls I also conveted everything to RTP/AVP.
So you'll need to know to which type of user - ws or tcp/udp you're calling to understand which type of RTP to send them.
2015-06-13 19:07 GMT+03:00 Murugan Pandian manpower13.cse@gmail.com:
it's posible dispatching websocket request?
I am try to connect browser(WebRTC) to sip-phone and vice versa,How i can achieve more concurrent call(more then 1000 call)
On Sat, Jun 13, 2015 at 8:49 PM, Alex Balashov < abalashov@evaristesys.com> wrote:
That question is difficult to answer without some elaboration on your part as to what you want to achieve.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. *From: *Murugan Pandian *Sent: *Saturday, June 13, 2015 09:47 *To: *sr-users@lists.sip-router.org *Reply To: *Kamailio (SER) - Users Mailing List *Subject: *[SR-Users] SIP-over-Websocket Load Balancing
HI,
how to handle sip-over-websocket load balancing (WebRTC)
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alexandru Covalschi ABRISS-Solutions VoIP engineer and system administrator phone: +37367398493 web: http://abs-telecom.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alexandru Covalschi ABRISS-Solutions VoIP engineer and system administrator phone: +37367398493 web: http://abs-telecom.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Murugan Pandian writes:
- On each registration user's proto is stored in redis database
you don't need a database for that. you can use location table flags.
- When rtpengine is being called, Kamailio checks user's proto a) If user is WS and is incoming call, dispatch him to media relay with
RTP/AVP flag
that would prevent e2e rtp/savpf.
b) If user is WS and is outgoing call (from media relay) send it to the
endpoint with RTP/SAVPF flag
again not needed if incoming is rtp/savpf and so on,
-- juha
You have any route logic (script) for bellow operation
Well, I can, if you can wait till Monday.
you don't need a database for that. you can use location table flags
Can you please describe how to do that? I chosen redis because I need to figure out the proto of the leg_b (called) user pretty fast - mysql is much slower.
that would prevent e2e rtp/savpf.
e2e=endpoint2endpoint? I don't need it - all traffic comes through my media relay, no p2p
again not needed if incoming is rtp/savpf and so on,
well, how do you offer to connect RTP/AVP SIP call with RTP/SAVPF WS call? Or maybe I just don't understand the RTP flow - I'm also queit new to all this stuff
2015-06-14 20:09 GMT+03:00 Juha Heinanen jh@tutpro.com:
Murugan Pandian writes:
- On each registration user's proto is stored in redis database
you don't need a database for that. you can use location table flags.
- When rtpengine is being called, Kamailio checks user's proto a) If user is WS and is incoming call, dispatch him to media relay
with
RTP/AVP flag
that would prevent e2e rtp/savpf.
b) If user is WS and is outgoing call (from media relay) send it to
the
endpoint with RTP/SAVPF flag
again not needed if incoming is rtp/savpf and so on,
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Ya sure Alexandru monday ok for me(Waiting for your Script :) ) Thanks man
On Sun, Jun 14, 2015 at 11:11 PM, Alexandru Covalschi 568691@gmail.com wrote:
You have any route logic (script) for bellow operation
Well, I can, if you can wait till Monday.
you don't need a database for that. you can use location table flags
Can you please describe how to do that? I chosen redis because I need to figure out the proto of the leg_b (called) user pretty fast - mysql is much slower.
that would prevent e2e rtp/savpf.
e2e=endpoint2endpoint? I don't need it - all traffic comes through my media relay, no p2p
again not needed if incoming is rtp/savpf and so on,
well, how do you offer to connect RTP/AVP SIP call with RTP/SAVPF WS call? Or maybe I just don't understand the RTP flow - I'm also queit new to all this stuff
2015-06-14 20:09 GMT+03:00 Juha Heinanen jh@tutpro.com:
Murugan Pandian writes:
- On each registration user's proto is stored in redis database
you don't need a database for that. you can use location table flags.
- When rtpengine is being called, Kamailio checks user's proto a) If user is WS and is incoming call, dispatch him to media relay
with
RTP/AVP flag
that would prevent e2e rtp/savpf.
b) If user is WS and is outgoing call (from media relay) send it to
the
endpoint with RTP/SAVPF flag
again not needed if incoming is rtp/savpf and so on,
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alexandru Covalschi ABRISS-Solutions VoIP engineer and system administrator phone: +37367398493 web: http://abs-telecom.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Alexandru Covalschi writes:
you don't need a database for that. you can use location table flags
Can you please describe how to do that? I chosen redis because I need to figure out the proto of the leg_b (called) user pretty fast - mysql is much slower.
sorry, i thought you use registrar/usrloc modules.
-- juha
sorry, i thought you use registrar/usrloc modules
Well, I do use them - so if you could explain in which table does Kamailio write the user's proto and which flags I can use - I'll make a test to see which scheme is preferable :)
So, about script:
1.) Write to redis Please read http://kamailio.org/docs/modules/4.3.x/modules/ndb_redis.html this guide to understand how to connect redis to Kamailio It route[AUTH] you shall add write to redis command:
if (is_method("REGISTER") || from_uri==myself) { # authenticate requests
redis_cmd("protobase", "SET $fU $proto bar", "r"); # Here is the redis
if (!auth_check("$fd", "subscriber", "1")) { auth_challenge("$fd", "0"); exit; } # user authenticated - remove auth header if(!is_method("REGISTER|PUBLISH")) consume_credentials(); }
You can find information about pseudo-variables on this http://www.kamailio.org/wiki/cookbooks/4.0.x/pseudovariables page
2. Rtpengine algorithm First of all, look through https://github.com/sipwise/rtpengine and http://kamailio.org/docs/modules/4.3.x/modules/rtpengine.html to understand what's the difference between rtpengine and rtpproxy In your NATMANAGE route change rtpproxy_manage(); or rtpengine_manage(); string to this:
if(ds_is_from_list()) { xlog("L_NOTICE","====== selecting $tU proto\n"); redis_cmd("protobase", "GET $tU", "uproto"); xlog("L_NOTICE","===== $tU has proto $redis(uproto=>value)\n"); if ($redis(uproto=>value)=="ws") { xlog("L_NOTICE","===== $tU is a websocket user\n"); rtpengine_manage("direction=internal direction=external force trust-address replace-origin replace-session-connection ICE=force RTP/SAVPF"); } else { xlog("L_NOTICE","===== $tU is classy user\n"); rtpengine_manage("direction=internal direction=external force trust-address replace-origin replace-session-connection"); } } else { xlog("L_NOTICE","====== $fU proto is $proto "); if ($proto=="ws") { xlog("L_NOTICE","===== $fU is websocket user\n"); rtpengine_manage("direction=external direction=internal force trust-address replace-origin replace-session-connection ICE=force RTP/AVP"); } else { xlog("L_NOTICE","===== $fU is a classy user"); rtpengine_manage("direction=external direction=internal replace-origin replace-session-connection force trust-address RTP/AVP"); }
}
2015-06-14 22:24 GMT+03:00 Juha Heinanen jh@tutpro.com:
Alexandru Covalschi writes:
you don't need a database for that. you can use location table flags
Can you please describe how to do that? I chosen redis because I need to figure out the proto of the leg_b (called) user pretty fast - mysql is
much
slower.
sorry, i thought you use registrar/usrloc modules.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Let me try this script ,Thanks
On Mon, Jun 15, 2015 at 1:27 PM, Alexandru Covalschi 568691@gmail.com wrote:
sorry, i thought you use registrar/usrloc modules
Well, I do use them - so if you could explain in which table does Kamailio write the user's proto and which flags I can use - I'll make a test to see which scheme is preferable :)
So, about script:
1.) Write to redis Please read http://kamailio.org/docs/modules/4.3.x/modules/ndb_redis.html this guide to understand how to connect redis to Kamailio It route[AUTH] you shall add write to redis command:
if (is_method("REGISTER") || from_uri==myself) { # authenticate requests
redis_cmd("protobase", "SET $fU $proto bar", "r"); # Here is the redis
if (!auth_check("$fd", "subscriber", "1")) { auth_challenge("$fd", "0"); exit; } # user authenticated - remove auth header if(!is_method("REGISTER|PUBLISH")) consume_credentials(); }
You can find information about pseudo-variables on this http://www.kamailio.org/wiki/cookbooks/4.0.x/pseudovariables page
- Rtpengine algorithm
First of all, look through https://github.com/sipwise/rtpengine and http://kamailio.org/docs/modules/4.3.x/modules/rtpengine.html to understand what's the difference between rtpengine and rtpproxy In your NATMANAGE route change rtpproxy_manage(); or rtpengine_manage(); string to this:
if(ds_is_from_list()) { xlog("L_NOTICE","====== selecting $tU proto\n"); redis_cmd("protobase", "GET $tU", "uproto"); xlog("L_NOTICE","===== $tU has proto
$redis(uproto=>value)\n"); if ($redis(uproto=>value)=="ws") { xlog("L_NOTICE","===== $tU is a websocket user\n"); rtpengine_manage("direction=internal direction=external force trust-address replace-origin replace-session-connection ICE=force RTP/SAVPF"); } else { xlog("L_NOTICE","===== $tU is classy user\n"); rtpengine_manage("direction=internal direction=external force trust-address replace-origin replace-session-connection"); } } else { xlog("L_NOTICE","====== $fU proto is $proto "); if ($proto=="ws") { xlog("L_NOTICE","===== $fU is websocket user\n"); rtpengine_manage("direction=external direction=internal force trust-address replace-origin replace-session-connection ICE=force RTP/AVP"); } else { xlog("L_NOTICE","===== $fU is a classy user"); rtpengine_manage("direction=external direction=internal replace-origin replace-session-connection force trust-address RTP/AVP"); }
}
2015-06-14 22:24 GMT+03:00 Juha Heinanen jh@tutpro.com:
Alexandru Covalschi writes:
you don't need a database for that. you can use location table flags
Can you please describe how to do that? I chosen redis because I need to figure out the proto of the leg_b (called) user pretty fast - mysql is
much
slower.
sorry, i thought you use registrar/usrloc modules.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alexandru Covalschi ABRISS-Solutions VoIP engineer and system administrator phone: +37367398493 web: http://abs-telecom.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Alexandru Covalschi writes:
sorry, i thought you use registrar/usrloc modules
Well, I do use them - so if you could explain in which table does Kamailio write the user's proto and which flags I can use - I'll make a test to see which scheme is preferable :)
before calling save() function, set one of the branch flags if registering ua uses ws protocol. save() then causes branch flags to be stored in location table cflags field. when you do lookup(), branch flags are then restored from that field.
-- juha
thanks, will try that
2015-06-15 14:07 GMT+03:00 Juha Heinanen jh@tutpro.com:
Alexandru Covalschi writes:
sorry, i thought you use registrar/usrloc modules
Well, I do use them - so if you could explain in which table does
Kamailio
write the user's proto and which flags I can use - I'll make a test to
see
which scheme is preferable :)
before calling save() function, set one of the branch flags if registering ua uses ws protocol. save() then causes branch flags to be stored in location table cflags field. when you do lookup(), branch flags are then restored from that field.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users