MaiTao - 2013-05-29

Hi friends:

opensips.cfg :
...
...

imc

loadmodule "imc.so"
modparam("imc", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam("imc", "rooms_table", "imc_rooms")
modparam("imc", "members_table", "imc_members")
modparam("imc", "hash_size", 8)

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

modparam("imc", "outbound_proxy", "sip:opensips.org;transport=tcp")

...

the rooms will be named chat-xyz to avoid overlapping

with usernames

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

then

/etc/init.d/opensips restart

May 29 16:35:57 [2240] WARNING:core:warn: warning in config file /usr/local/opensips_proxy//etc/opensips/opensips.cfg, line 50, column 13-16: tls support not compiled in
May 29 16:35:57 [2240] CRITICAL:core:yyerror: parse error in config file /usr/local/opensips_proxy//etc/opensips/opensips.cfg, line 248, column 2-13: syntax error
May 29 16:35:57 [2240] CRITICAL:core:yyerror: parse error in config file /usr/local/opensips_proxy//etc/opensips/opensips.cfg, line 248, column 2-13: bad command!)
May 29 16:35:57 [2240] ERROR:core:main: bad config file (2 errors)

if I do that:

the rooms will be named chat-xyz to avoid overlapping

with usernames

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

    imc_manager();

it is ok
/etc/init.d/opensips restart
Starting opensips: Listening on
udp: 192.168.1.17 [192.168.1.17]:5060
tcp: 192.168.1.17 [192.168.1.17]:5060
Aliases:
: sip-xmpp.opensips.org:

                                                       [  OK  ]

then i send some messages
opensips.log:
May 29 16:42:52 localhost /usr/local/opensips_proxy/sbin/opensips[2359]: ERROR:imc:imc_handle_message: room [103] does not exist!
May 29 16:42:52 localhost /usr/local/opensips_proxy/sbin/opensips[2359]: ERROR:imc:imc_manager: failed to handle 'message'
May 29 16:42:52 localhost /usr/local/opensips_proxy/sbin/opensips[2358]: ERROR:imc:imc_handle_message: room [103] does not exist!
May 29 16:42:52 localhost /usr/local/opensips_proxy/sbin/opensips[2358]: ERROR:imc:imc_manager: failed to handle 'message'

Thanks.