[Asterisk-Dev] [patch] IM Manager Event

Andreas Anderson galium123 at hotmail.com
Mon Sep 5 06:02:43 MST 2005


Hi all,

someone knows what the status of instant messages over sip is? Will a 
complete IM make it into 1.2?

If not, the following mini-patch generates a managerevent when you send a 
message using eyebeam.


Regards,

Andreas


diff -u -r1.836 chan_sip.c
--- chan_sip.c  2 Sep 2005 19:24:32 -0000       1.836
+++ chan_sip.c  5 Sep 2005 12:52:29 -0000
@@ -6780,7 +6880,8 @@
                transmit_response(p, "202 Accepted", req); /* We respond 202 
accepted, since we relay the message */
        } else { /* Message outside of a call, we do not support that */
                ast_log(LOG_WARNING,"Received message to %s from %s, dropped 
it...\n  Content-Type:%s\n  Message: %s\n", get_header(req,"To"), 
get_header(req,"From"), content_type, buf);
-               transmit_response(p, "405 Method Not Allowed", req); /* Good 
enough, or? */
+               manager_event(EVENT_FLAG_SYSTEM, "Messaging", "To: %s\nFrom: 
%s\nContent-Type: %s\nMessage: %s\n", get_header(req,"To"), 
get_header(req,"From"), content_type, buf);
+               transmit_response(p, "202 Accepted", req); /* Good enough, 
or? */
        }
        ast_set_flag(p, SIP_NEEDDESTROY);
        return;

_________________________________________________________________
Read the latest Hollywood gossip  @  http://xtramsn.co.nz/entertainment




More information about the asterisk-dev mailing list