aboutsummaryrefslogtreecommitdiffstats
path: root/package/tapi_sip/src/sip_client.h
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2010-11-03 19:12:34 +0000
committerJohn Crispin <john@openwrt.org>2010-11-03 19:12:34 +0000
commita8b2a07f375edefec242de9f20d4aefafa927517 (patch)
treed15f5bb696bfa9dfd9555788d411e0ba59b99a65 /package/tapi_sip/src/sip_client.h
parent72ae8452cda47d6e18e664097a4adbc0eee3fc7b (diff)
downloadupstream-a8b2a07f375edefec242de9f20d4aefafa927517.tar.gz
upstream-a8b2a07f375edefec242de9f20d4aefafa927517.tar.bz2
upstream-a8b2a07f375edefec242de9f20d4aefafa927517.zip
* adds a rewrite of the tapi drivers + sip app. this is the result of lars' gsoc 2010 project, Thanks !
SVN-Revision: 23840
Diffstat (limited to 'package/tapi_sip/src/sip_client.h')
-rw-r--r--package/tapi_sip/src/sip_client.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/package/tapi_sip/src/sip_client.h b/package/tapi_sip/src/sip_client.h
new file mode 100644
index 0000000000..1c494b6dc3
--- /dev/null
+++ b/package/tapi_sip/src/sip_client.h
@@ -0,0 +1,61 @@
+#ifndef __SIP_CLIENT_H__
+#define __SIP_CLIENT_H__
+
+#include <tapi-stream.h>
+#include <tapi-device.h>
+
+#include <pjsip.h>
+#include <pjsip_ua.h>
+#include <pjsip_simple.h>
+#include <pjlib-util.h>
+#include <pjlib.h>
+
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <stdint.h>
+
+struct stun_client;
+struct sip_agent;
+
+struct sip_client_config {
+ const char *iface;
+
+ const char *host;
+ uint16_t port;
+ const char *username;
+ const char *password;
+
+ const char *stun_host;
+ uint16_t stun_port;
+};
+
+struct sip_client {
+ const struct sip_client_config *config;
+
+ struct tapi_device *tdev;
+ struct stun_client *stun;
+
+ struct sockaddr_storage public_addr;
+ struct sockaddr_storage local_addr;
+
+ int sockfd;
+
+ pj_thread_t *sip_thread;
+ pj_caching_pool cp;
+ pj_pool_t *pool;
+ pjsip_endpoint *sip_endpt;
+ pjsip_cred_info cred;
+ pj_str_t local_contact;
+ pj_str_t server_uri;
+
+ pjsip_regc *regc;
+
+ int (*incoming_call_cb)(struct sip_client *client, struct sip_agent *agent);
+};
+
+void sip_client_init(struct sip_client *client, struct tapi_device *dev,
+ const struct sip_client_config *config);
+
+struct sip_agent *sip_client_alloc_agent(struct sip_client *client, const char *dst_uri);
+
+#endif