]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
send 200 to keep-alive notifies. Thanks Norm.
authorMichael Jerris <mike@jerris.com>
Sat, 2 Feb 2008 00:02:28 +0000 (00:02 +0000)
committerMichael Jerris <mike@jerris.com>
Sat, 2 Feb 2008 00:02:28 +0000 (00:02 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7482 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index 1b24df8ea56f80bf8bf0d3c560a471de60f52703..a54b61f7fb8be0f17f633ff0afe212c3b29d41fa 100644 (file)
@@ -90,8 +90,19 @@ void sofia_handle_sip_i_notify(switch_core_session_t *session, int status,
 {
        switch_channel_t *channel = NULL;
        
+       /* make sure we have a proper event */
+       if (!sip || !sip->sip_event) {
+               goto error;
+       }
+
+       /* Automatically return a 200 OK for Event: keep-alive */
+       if (!strcasecmp(sip->sip_event->o_type, "keep-alive")) {
+               nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END());
+               return;
+       }
+
        /* make sure we have a proper "talk" event */
-       if (!session || !sip || !sip->sip_event || strcasecmp(sip->sip_event->o_type, "talk")) {
+       if (!session || strcasecmp(sip->sip_event->o_type, "talk")) {
                goto error;
        }