We use mediaproxy and kamailio and using the init.d script from the Debian package to restart kamailio has no effect on mediaproxy process.
2013/2/8 Eduardo Lejarreta lejarreta.e@sarenet.es:
Good morning Daniel.
I send you the "messages" log which is a bit filtered. The flow is:
Start a call, engage_mediaproxy on ports (50156, 50157, 50158, 50159) and then "kamctl restart". As you see it seems that an instruction from kamailio tells mediaproxy to drop the ports. We have tried to script around "kamctl" to avoid sending orders to mediaproxy, killing the "media-dispatcher" before Kamailio and then restarting again (media-dispatcher) and this works OK, but seems not be a reasonable way to fix it.
...... Feb 8 11:04:51 kamailio-dev media-relay[2474]: mediaproxy.mediacontrol.StreamListenerProtocol starting on 50156 Feb 8 11:04:51 kamailio-dev media-relay[2474]: mediaproxy.mediacontrol.StreamListenerProtocol starting on 50157 Feb 8 11:04:51 kamailio-dev media-relay[2474]: mediaproxy.mediacontrol.StreamListenerProtocol starting on 50158 Feb 8 11:04:51 kamailio-dev media-relay[2474]: mediaproxy.mediacontrol.StreamListenerProtocol starting on 50159 Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3461]: NOTICE: <core> [main.c:706]: Thank you for flying kamailio!!! Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3561]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3558]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3560]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3553]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3557]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3549]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3552]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3547]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3545]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3546]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3541]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3538]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3536]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3526]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3492]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3528]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3521]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3530]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3495]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3532]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3493]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3539]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3523]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3534]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3489]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3496]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3488]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3525]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3487]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3498]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3484]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3500]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3482]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3501]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3479]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3499]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3474]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3476]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3475]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3477]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3491]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3480]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3490]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3486]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev /sbin/kamailio[3483]: INFO: <core> [main.c:817]: INFO: signal 15 received Feb 8 11:05:06 kamailio-dev media-relay[2474]: (Port 50156 Closed) Feb 8 11:05:06 kamailio-dev media-relay[2474]: (Port 50157 Closed) Feb 8 11:05:06 kamailio-dev media-relay[2474]: (Port 50158 Closed) Feb 8 11:05:06 kamailio-dev media-relay[2474]: (Port 50159 Closed) Feb 8 11:05:08 kamailio-dev kamailio: INFO: <core> [tcp_main.c:4727]: init_tcp: using epoll_lt as the io watch method (auto detected) Feb 8 11:05:08 kamailio-dev /sbin/kamailio[3761]: INFO: usrloc [hslot.c:53]: locks array size 512 ......
Thanks and regards.
Eduardo Lejarreta.
-----Mensaje original----- De: Daniel-Constantin Mierla [mailto:miconda@gmail.com] Enviado el: viernes, 08 de febrero de 2013 9:38 Para: lejarreta.e@sarenet.es; SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List Asunto: Re: [SR-Users] kamctl restart and mediaproxy
Hello,
not using mediaproxy, but have you looked at its logs to see if prints some messages?
Cheers, Daniel
On 2/7/13 5:03 PM, Eduardo Lejarreta Langarica SARENET wrote:
Good evening again.
Kamailio 3.2.2 and mediaproxy 2.5.2
An long-time issue for us:
kamctl restart stops mediaproxy audio.
is there anyway to avoid this?
Any idea will be helpful.
Thanks and best regards.
Eduardo Lejarreta
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
-- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, April 16-17, 2013, Berlin
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
Good morning Victor.
As you mentioned I've been playing with init.d scripts in case you were right. Nothing to do with this. "media-dispatcher" and "media-relay" are still alive and with the same PID before and after "kamctl restart".
Kamailio gives some order to "media-dispatcher" so this last orders "media-relay" to close media ports.
I'm trying with Kamailio.cfg and code inspection once again.
I'll keep you informed now I know that someone has it working.
Thanks and regards.
Good evening.
Launching "mediaproxy-dispatcher" and "mediaproxy-relay" on the foreground and with "DEBUG" we can see:
mediaproxy-dispatcher log: ------------------------------------------------------------------> Kamctl restart debug: Connection to OpenSIPS lost: Connection was closed cleanly. debug: Connection to OpenSIPS lost: Connection was closed cleanly. debug: Connection to OpenSIPS lost: Connection was closed cleanly. debug: Issuing "remove" command to relay at A.B.C.D debug: Got statistics: {xxxxxxxxxxxxxxxxxxx} debug: Connection to OpenSIPS lost: Connection was closed cleanly.
mediaproxy-relay log: ------------------------------------------------------------------> Kamctl restart debug: removing session xxxxxxxxxxxxxxxxxxx (Port 50000 Closed) (Port 50001 Closed) (Port 50002 Closed) (Port 50003 Closed)
So "mediaproxy-dispatcher" doesn't receive any command from Kamailio, he just detects " Connection was closed cleanly" and then issues a "remove" command to "mediaproxy-relay".
Does anybody know any way to avoid this?
Thanks and regards.
Good morning Vinay.
I had this experience 1 year ago, so maybe Microsoft has improved something or our client has discovered new functionality.
Calling from Lync Server to Outside.
1.- You need to modparam("rr", "enable_full_lr", 0) just to avoid Loose Router parameter in this way "lr=on" and having like this "lr" (RFC3261 compliant). Microsoft denies traffic with "lr=on".
2.- At the time of my trials, our client or Microsoft was not able to authenticate, so we had to validate Lync through "trusted" table (IP auth).
3.- As always avoid ALG support on Lync Server side's Router/FW. You don't have to deal with UDP NAT timeouts as Lync only worked over TCP (you will also have to enable TCP support on Kamailio side).
4.- When detecting NAT on Kamailio side through nathelper module you will find a new issue with regard to nat_uac_test() which doesn't (as it's obvious) recognize "yourmicrosoftdomain.local". You have to deal to recompile nathelper.c introducing this exception or play with "contact header var" to correctly detect NAT.
Calling from the Outside to Lync Server:
1.- As there was no REGISTER from Lync Server you have to map your public IP address on you Router/FW to your Lync Server.
2.- You should send from Kamailio a RURI with DDI and filter this one to proper extension on your Lync Server side.
3.- As Microsoft was not able to REGISTER you also have to create a location entry on Kamailio database like: kamctl ul add <DDI> “sip:<DDI>@<yourLyncpublicIP>:5060;transport=tcp”
Hope this helps you.
I'm sorry Vinay.
I read it quickly so everything I've written is for just SIP calls purpose (no xmpp server experience).
Regards.
Hello once again !
Finally logs were confusing me. Kamailio through "mediaproxy.c" sends a "remove" command before dying.
I've been working with mediaproxy.c and dialog module callbacks but this is stuff for developers forum so I'm writing just to avoid someother to be confused.
There is solution working on mediaproxy.c playing with DLGCB_LOADED event.
Thanks to everyone.