[SR-Users] IMC module not sending messages to members of a conference room

Henning Westerholt hw at skalatan.de
Thu Aug 29 19:06:35 CEST 2019


Hello David,

haven't looked in detail on the specific errors that you observed. But if you are still in the implementation of this project, you might want to give the upcoming 5.3 version IMC module as try. It was extended considerably and also refactored/optimzed:

https://www.kamailio.org/wiki/features/new-in-devel#imc

If you need to stay on stable branch, I would suggest to debug this as well with some SIP traces (e.g. ngrep or wireshark). This way you could check if the MESSAGE is actually send out and a routing problem might be the cause.

Cheers,

Henning


Cheers,

Henning

Am 27.08.19 um 17:58 schrieb david at aslo.us<mailto:david at aslo.us>:

Hello everyone,

I'm runing Kamailio 5.2.4 with enabled mysql, usrlocdb, presence, aliasdb, auth and NAT.
I can register clients, establish calls and video calls, send IMs, etc. imc_rooms and imc_members tables were created when kamailio was installed. I've also checked imc-create.sql script and tables are correctly created.

I'm trying to configure the IMC module, but my problem is that I'm not receiving system messages and messages sent to a room aren't correctly broadcasted to its members.

I'm using following code provided by the IMC module documentation:

modparam("imc", "rooms_table", "imc_rooms")

modparam("imc", "members_table", "imc_members")

modparam("imc", "hash_size", 8)

modparam("imc", "imc_cmd_start_char", "#")

## route block ###

        if(is_method("MESSAGE") && (uri=~ "sip:chat-[0-9]+@") || (uri=~ "sip:chat-manager@")) {

                xlog("L_INFO", "going to imc: From [$fu] To [$tu] MSG [$rb]\n");

                if(imc_manager())

                        #log("MESSAGE received -> processing with imc\n");

                        sl_send_reply("200", "ok - imc_manager()");

                else

                        sl_send_reply("500", "command error");

        exit;

        }

I am creating a chat room with the following message sent to sip:chat-manager at x.x.x.x<mailto:sip:chat-manager at x.x.x.x>: "#create chat-111"



Aug 27 15:16:20 aslo_kamailio /usr/sbin/kamailio[17448]: INFO: {1 1 MESSAGE 670EAF5439D284FD2EBABC7ADBEAC47B12B07C1E} <script>: going to imc: From [sip:david at x.x.x.x:5060<mailto:sip:david at x.x.x.x:5060>] To [sip:chat-manager at x.x.x.x:5060<mailto:sip:chat-manager at x.x.x.x:5060>] MSG [#create chat-111]

Aug 27 15:16:20 aslo_kamailio /usr/sbin/kamailio[17448]: DEBUG: {1 1 MESSAGE 670EAF5439D284FD2EBABC7ADBEAC47B12B07C1E} imc [imc.c:493]: ki_imc_manager(): found command

Aug 27 15:16:20 aslo_kamailio /usr/sbin/kamailio[17448]: DEBUG: {1 1 MESSAGE 670EAF5439D284FD2EBABC7ADBEAC47B12B07C1E} imc [imc_cmd.c:144]: imc_parse_cmd(): command: [create]

Aug 27 15:16:20 aslo_kamailio /usr/sbin/kamailio[17448]: DEBUG: {1 1 MESSAGE 670EAF5439D284FD2EBABC7ADBEAC47B12B07C1E} imc [imc_cmd.c:149]: imc_parse_cmd(): parameter 0=[chat-111]

Aug 27 15:16:20 aslo_kamailio /usr/sbin/kamailio[17448]: DEBUG: {1 1 MESSAGE 670EAF5439D284FD2EBABC7ADBEAC47B12B07C1E} imc [imc_cmd.c:169]: imc_handle_create(): new room [chat-111]

Aug 27 15:16:20 aslo_kamailio /usr/sbin/kamailio[17448]: DEBUG: {1 1 MESSAGE 670EAF5439D284FD2EBABC7ADBEAC47B12B07C1E} imc [imc_cmd.c:184]: imc_handle_create(): added room uri= sip:chat-111 at x.x.x.x<mailto:sip:chat-111 at x.x.x.x>

Aug 27 15:16:20 aslo_kamailio /usr/sbin/kamailio[17448]: DEBUG: {1 1 MESSAGE 670EAF5439D284FD2EBABC7ADBEAC47B12B07C1E} imc [imc_mng.c:320]: imc_add_member(): [uri]= sip:david at x.x.x.x<mailto:sip:david at x.x.x.x>

Aug 27 15:16:20 aslo_kamailio /usr/sbin/kamailio[17448]: DEBUG: {1 1 MESSAGE 670EAF5439D284FD2EBABC7ADBEAC47B12B07C1E} imc [imc_mng.c:324]: imc_add_member(): [user]= david

Aug 27 15:16:20 aslo_kamailio /usr/sbin/kamailio[17448]: DEBUG: {1 1 MESSAGE 670EAF5439D284FD2EBABC7ADBEAC47B12B07C1E} imc [imc_cmd.c:193]: imc_handle_create(): added the owner as the first member [sip:david at x.x.x.x<mailto:sip:david at x.x.x.x>]





Then, from a different user, I send the following command to sip:chat-111 at x.x.x.x<mailto:sip:chat-111 at x.x.x.x>:

"#join"





Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: INFO: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} <script>: going to imc: From [sip:eduardo at x.x.x.x:5060<mailto:sip:eduardo at x.x.x.x:5060>] To [sip:chat-111 at x.x.x.x:5060<mailto:sip:chat-111 at x.x.x.x:5060>] MSG [#join]
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} imc [imc.c:493]: ki_imc_manager(): found command
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} imc [imc_cmd.c:144]: imc_parse_cmd(): command: [join]
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} imc [imc_cmd.c:290]: imc_handle_join(): found room [chat-111]
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} imc [imc_cmd.c:295]: imc_handle_join(): room [chat-111] is public
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} imc [imc_cmd.c:298]: imc_handle_join(): adding new member [eduardo]
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} imc [imc_mng.c:320]: imc_add_member(): [uri]= sip:eduardo at x.x.x.x<mailto:sip:eduardo at x.x.x.x>
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} imc [imc_mng.c:324]: imc_add_member(): [user]= eduardo
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} imc [imc_cmd.c:1097]: imc_room_broadcast(): nr = 2
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} imc [imc_cmd.c:1101]: imc_room_broadcast(): to uri = sip:david at x.x.x.x<mailto:sip:david at x.x.x.x>
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} tm [uac.c:429]: t_uac_prepare(): next_hop=<sip:david at x.x.x.x><mailto:sip:david at x.x.x.x>
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} tm [uac.c:152]: dlg2hash(): hashid 34678
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} tm [uac.c:656]: send_prepared_request_impl(): uac: 0x7f894faaed28 branch: 0 to x.x.x.x:5060
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} tm [../../core/onsend.h:69]: run_onsend(): required parameters are not available - ignoring
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} imc [imc_cmd.c:1101]: imc_room_broadcast(): to uri = sip:eduardo at x.x.x.x<mailto:sip:eduardo at x.x.x.x>
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} tm [uac.c:429]: t_uac_prepare(): next_hop=<sip:eduardo at x.x.x.x><mailto:sip:eduardo at x.x.x.x>
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} tm [uac.c:152]: dlg2hash(): hashid 34679
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} tm [uac.c:656]: send_prepared_request_impl(): uac: 0x7f894faabfa8 branch: 0 to x.x.x.x:5060
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} tm [../../core/onsend.h:69]: run_onsend(): required parameters are not available - ignoring
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} <core> [core/receive.c:354]: receive_msg(): request-route executed in: 438 usec
Aug 27 15:24:10 aslo_kamailio /usr/sbin/kamailio[17452]: DEBUG: {1 1 MESSAGE 1A16E53DE339181E4F970B9DC16BB8E18B0DBF98} <core> [core/usr_avp.c:636]: destroy_avp_list(): destroying list (nil)





And finally, I send messages from a user to sip:chat-111 at x.x.x.x<mailto:sip:chat-111 at x.x.x.x>:





Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: INFO: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} <script>: going to imc: From [sip:eduardo at x.x.x.x:5060<mailto:sip:eduardo at x.x.x.x:5060>] To [sip:chat-111 at x.x.x.x:5060<mailto:sip:chat-111 at x.x.x.x:5060>] MSG [Hello Everyone]
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} imc [imc_mng.c:371]: imc_get_member(): found member
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} imc [imc_cmd.c:1057]: imc_handle_message(): broadcast to room [sip:chat-111 at x.x.x.x<mailto:sip:chat-111 at x.x.x.x>]
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} imc [imc_cmd.c:1097]: imc_room_broadcast(): nr = 2
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} imc [imc_cmd.c:1101]: imc_room_broadcast(): to uri = sip:david at x.x.x.x<mailto:sip:david at x.x.x.x>
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} tm [uac.c:429]: t_uac_prepare(): next_hop=<sip:david at x.x.x.x><mailto:sip:david at x.x.x.x>
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} tm [uac.c:152]: dlg2hash(): hashid 50535
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} tm [uac.c:656]: send_prepared_request_impl(): uac: 0x7f894faaed28 branch: 0 to x.x.x.x:5060
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} tm [../../core/onsend.h:69]: run_onsend(): required parameters are not available - ignoring
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} imc [imc_cmd.c:1101]: imc_room_broadcast(): to uri = sip:eduardo at x.x.x.x<mailto:sip:eduardo at x.x.x.x>
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} <core> [core/receive.c:354]: receive_msg(): request-route executed in: 318 usec
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} <core> [core/usr_avp.c:636]: destroy_avp_list(): destroying list (nil)
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: message repeated 5 times: [ DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} <core> [core/usr_avp.c:636]: destroy_avp_list(): destroying list (nil)]
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} <core> [core/xavp.c:495]: xavp_destroy_list(): destroying xavp list (nil)
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17449]: DEBUG: {1 1 MESSAGE CD6C7043E1FF56D32DEAC097718DBE9D35E9FAA2} <core> [core/receive.c:458]: receive_msg(): cleaning up
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17456]: DEBUG: tm [t_reply.c:1266]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17456]: DEBUG: tm [t_reply.c:1494]: t_should_relay_response(): rps completed - uas status: 0 branch: 0
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17456]: DEBUG: tm [t_reply.c:2117]: local_reply(): branch=0, save=0, winner=0
Aug 27 15:32:45 aslo_kamailio /usr/sbin/kamailio[17456]: DEBUG: tm [t_reply.c:2156]: local_reply(): local transaction completed 408/0 (totag retr: 0/0)





This is the sip trace when I send a message from eduardo to the conference chat-111 (being david the other user in the room):





23547 84639.636444071 148.x.x.x → 192.y.y.y SIP 602 Request: MESSAGE sip:chat-111 at 148.z.z.z:5060<mailto:sip:chat-111 at 148.z.z.z:5060> | (text/plain)
23548 84639.636859382 192.y.y.y → 148.z.z.z SIP 492 Request: MESSAGE sip:david at 148.z.z.z<mailto:sip:david at 148.z.z.z> | (text/plain)
23549 84639.636936241 192.y.y.y → 148.x.x.x SIP 464 Status: 200 ok - imc_manager() |
23550 84640.123596134 192.y.y.y → 148.z.z.z SIP 492 Request: MESSAGE sip:david at 148.z.z.z<mailto:sip:david at 148.z.z.z> | (text/plain)
23551 84641.123591836 192.y.y.y → 148.z.z.z SIP 492 Request: MESSAGE sip:david at 148.z.z.z<mailto:sip:david at 148.z.z.z> | (text/plain)
23552 84643.123615246 192.y.y.y → 148.z.z.z SIP 492 Request: MESSAGE sip:david at 148.z.z.z<mailto:sip:david at 148.z.z.z> | (text/plain)
23553 84647.123607208 192.y.y.y → 148.z.z.z SIP 492 Request: MESSAGE sip:david at 148.z.z.z<mailto:sip:david at 148.z.z.z> | (text/plain)
23556 84651.123605257 192.y.y.y → 148.z.z.z SIP 492 Request: MESSAGE sip:david at 148.z.z.z<mailto:sip:david at 148.z.z.z> | (text/plain)
23557 84655.123586963 192.y.y.y → 148.z.z.z SIP 492 Request: MESSAGE sip:david at 148.z.z.z<mailto:sip:david at 148.z.z.z> | (text/plain)
23561 84659.123587125 192.y.y.y → 148.z.z.z SIP 492 Request: MESSAGE sip:david at 148.z.z.z<mailto:sip:david at 148.z.z.z> | (text/plain)
23563 84663.123605383 192.y.y.y → 148.z.z.z SIP 492 Request: MESSAGE sip:david at 148.z.z.z<mailto:sip:david at 148.z.z.z> | (text/plain)
23564 84665.297801577 192.y.y.y → 148.x.x.x UDP 48 5060 → 50613 Len=4
23565 84667.123592273 192.y.y.y → 148.z.z.z SIP 492 Request: MESSAGE sip:david at 148.z.z.z<mailto:sip:david at 148.z.z.z> | (text/plain)
23566 84669.063509921 148.x.x.x → 192.y.y.y STUN 72 Binding Request



Any help is greatly appreciated.

Best regards, David Tirado



_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190829/584dbf18/attachment.html>


More information about the sr-users mailing list