From 888927ac1c34c9b49f6f2b1808851c8eefe8fdda Mon Sep 17 00:00:00 2001 From: blogic Date: Mon, 7 Feb 2011 21:47:54 +0000 Subject: [voip] * drop libtapi and tapi_sip (moved to external git) * add build variants to pjsip * split tapi_dev audio driver out of patch into src/ git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25412 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/tapi_sip/src/session.c | 84 ------------------------------------------ 1 file changed, 84 deletions(-) delete mode 100644 package/tapi_sip/src/session.c (limited to 'package/tapi_sip/src/session.c') diff --git a/package/tapi_sip/src/session.c b/package/tapi_sip/src/session.c deleted file mode 100644 index 97f6f06fe..000000000 --- a/package/tapi_sip/src/session.c +++ /dev/null @@ -1,84 +0,0 @@ -#include -#include - -#include "agent.h" -#include "session.h" - -#include - - -struct session -{ - struct agent *agents[2]; - - struct tapi_device *tdev; - - void (*release)(struct session *); - - int link; -}; - -struct session *session_alloc(struct tapi_device *dev, struct agent *caller, - struct agent *callee, void (*release)(struct session *)) -{ - struct session *session; - int ret; - - session = malloc(sizeof(*session)); - - session->tdev = dev; - - session->agents[0] = caller; - session->agents[1] = callee; - - ret = agent_invite(callee, session); - if (ret < 0) { - session_hangup(session, callee); - free(session); - return NULL; - } - - session->release = release; - - return session; -} - -void session_accept(struct session *session, struct agent *agent) -{ - int ep[2]; - - printf("session_accept: %p %p\n", session, agent); - printf("session agents: %p %p\n", session->agents[0], session->agents[1]); - printf("session tdev: %p\n", session->tdev); - - agent_accept(session->agents[0], session); - - ep[0] = agent_get_endpoint(session->agents[0], session); - ep[1] = agent_get_endpoint(session->agents[1], session); - session->link = tapi_link_alloc(session->tdev, ep[0], ep[1]); - - printf("eps: %d %d\n", ep[0], ep[1]); - - tapi_link_enable(session->tdev, session->link); - - tapi_sync(session->tdev); -} - -void session_hangup(struct session *session, struct agent *agent) -{ - struct agent *other_agent; - - if (session->agents[0] == agent) - other_agent = session->agents[1]; - else - other_agent = session->agents[0]; - - agent_hangup(other_agent, session); - - tapi_link_disable(session->tdev, session->link); - tapi_link_free(session->tdev, session->link); - tapi_sync(session->tdev); - - if (session->release) - session->release(session); -} -- cgit v1.2.3