提交 6faf831f authored 作者: Michael Jerris's avatar Michael Jerris

expose a few more iax packets to the application and kindof handle them.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5161 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 6a8a7688
...@@ -1586,7 +1586,7 @@ static struct iax_event *handle_event(struct iax_event *event) ...@@ -1586,7 +1586,7 @@ static struct iax_event *handle_event(struct iax_event *event)
case IAX_EVENT_POKE: case IAX_EVENT_POKE:
event->etype = IAX_EVENT_PONG; event->etype = IAX_EVENT_PONG;
iax_send_pong(event->session, event->ts); iax_send_pong(event->session, event->ts);
destroy_session(event->session); iax_destroy(event->session);
iax_event_free(event); iax_event_free(event);
break; break;
default: default:
...@@ -2683,7 +2683,8 @@ static struct iax_event *iax_header_to_event(struct iax_session *session, ...@@ -2683,7 +2683,8 @@ static struct iax_event *iax_header_to_event(struct iax_session *session,
case IAX_COMMAND_POKE: case IAX_COMMAND_POKE:
e->etype = IAX_EVENT_POKE; e->etype = IAX_EVENT_POKE;
e->ts = ts; e->ts = ts;
break; case IAX_COMMAND_PING: break;
case IAX_COMMAND_PING:
/* PINGS and PONGS don't get scheduled; */ /* PINGS and PONGS don't get scheduled; */
e->etype = IAX_EVENT_PING; e->etype = IAX_EVENT_PING;
e->ts = ts; e->ts = ts;
...@@ -2718,6 +2719,14 @@ static struct iax_event *iax_header_to_event(struct iax_session *session, ...@@ -2718,6 +2719,14 @@ static struct iax_event *iax_header_to_event(struct iax_session *session,
} }
e = schedule_delivery(e, ts, updatehistory); e = schedule_delivery(e, ts, updatehistory);
break; 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: case IAX_COMMAND_REGACK:
e->etype = IAX_EVENT_REGACK; e->etype = IAX_EVENT_REGACK;
e = schedule_delivery(e, ts, updatehistory); e = schedule_delivery(e, ts, updatehistory);
......
...@@ -1036,6 +1036,12 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) ...@@ -1036,6 +1036,12 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
case IAX_EVENT_REGREJ: case IAX_EVENT_REGREJ:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Registration failed.\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Registration failed.\n");
break; 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: case IAX_EVENT_TIMEOUT:
break; break;
case IAX_EVENT_ACCEPT: case IAX_EVENT_ACCEPT:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论