]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
expose a few more iax packets to the application and kindof handle them.
authorMichael Jerris <mike@jerris.com>
Sat, 12 May 2007 02:09:59 +0000 (02:09 +0000)
committerMichael Jerris <mike@jerris.com>
Sat, 12 May 2007 02:09:59 +0000 (02:09 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5161 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/iax/src/iax.c
src/mod/endpoints/mod_iax/mod_iax.c

index 12e8289c50355842d4a4b98885ca352a8f8ed765..0639f2effb075cfffa8526bf3a8b74bd4e31d2f0 100644 (file)
@@ -1586,7 +1586,7 @@ static struct iax_event *handle_event(struct iax_event *event)
                        case IAX_EVENT_POKE:\r
                                event->etype = IAX_EVENT_PONG;\r
                                iax_send_pong(event->session, event->ts);\r
-                               destroy_session(event->session);\r
+                               iax_destroy(event->session);\r
                                iax_event_free(event);\r
                                break;         \r
                        default:
@@ -2683,7 +2683,8 @@ static struct iax_event *iax_header_to_event(struct iax_session *session,
                        case IAX_COMMAND_POKE:\r
                                e->etype = IAX_EVENT_POKE;\r
                                e->ts = ts;\r
-                               break;                  case IAX_COMMAND_PING:
+                               break;
+                       case IAX_COMMAND_PING:
                                /* PINGS and PONGS don't get scheduled; */
                                e->etype = IAX_EVENT_PING;
                                e->ts = ts;
@@ -2718,6 +2719,14 @@ static struct iax_event *iax_header_to_event(struct iax_session *session,
                                }
                                e = schedule_delivery(e, ts, updatehistory);
                                break;
+                       case IAX_COMMAND_REGREQ:
+                               e->etype = IAX_EVENT_REGREQ;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
+                       case IAX_COMMAND_REGREL:
+                               e->etype = IAX_EVENT_REGREQ;
+                               e = schedule_delivery(e, ts, updatehistory);
+                               break;
                        case IAX_COMMAND_REGACK:
                                e->etype = IAX_EVENT_REGACK;
                                e = schedule_delivery(e, ts, updatehistory);
index 417484e137e4e6da280c18d79d7e4be8e946bd39..ecb12e5c8b8df22d23a609b8c66e274f5a368a5c 100644 (file)
@@ -1036,6 +1036,12 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
                        case IAX_EVENT_REGREJ:
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Registration failed.\n");
                                break;
+                       case IAX_EVENT_REGREQ:
+                               /* what is the right way to handle this? */
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Registration request ignored, not implemented.\n");
+                               iax_destroy(iaxevent->session);
+                               iaxevent->session = NULL;
+                               break;
                        case IAX_EVENT_TIMEOUT:
                                break;
                        case IAX_EVENT_ACCEPT: