Created
June 24, 2015 16:36
-
-
Save dangowrt/4803578dbeefa6f3183c to your computer and use it in GitHub Desktop.
asterisk11-chan-dongle: git diff jstasiak/master..bg111/master
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/.gitignore b/.gitignore | |
deleted file mode 100644 | |
index fcf14a7..0000000 | |
--- a/.gitignore | |
+++ /dev/null | |
@@ -1,18 +0,0 @@ | |
-.INSTALL.swp | |
-.gitignore | |
-Makefile | |
-aclocal.m4 | |
-autom4te.cache/ | |
-config.guess | |
-config.h | |
-config.log | |
-config.status | |
-config.sub | |
-configure | |
-install-sh | |
-missing | |
-stamp-h1 | |
- | |
-*.o | |
-*.o.d | |
-*.so | |
diff --git a/README.txt b/README.txt | |
index 58e6b1d..d9a8c8b 100644 | |
--- a/README.txt | |
+++ b/README.txt | |
@@ -19,7 +19,7 @@ This channel driver should work with the folowing UMTS cards: | |
* Huawei K3765 | |
Check complete list in: | |
-http://code.google.com/p/asteris-chan-dongle/wiki/Supported_devices_eng | |
+http://wiki.e1550.mobi/doku.php?id=requirements#list_of_supported_models | |
Before using the channel driver make sure to: | |
@@ -111,4 +111,4 @@ For reading installation notes please look to INSTALL file. | |
For additional information about Huawei dongle usage | |
look to chan_dongle Wiki at http://wiki.e1550.mobi | |
-and chan_dongle project home at http://code.google.com/p/asterisk-chan-dongle/ | |
+and chan_dongle project home at https://github.com/bg111/asterisk-chan-dongle/ | |
diff --git a/at_response.c b/at_response.c | |
index cc02efd..15c5531 100644 | |
--- a/at_response.c | |
+++ b/at_response.c | |
@@ -1587,6 +1587,7 @@ static int at_response_cgmm (struct pvt* pvt, const char* str) | |
"E171", | |
"E153", | |
"E156B", | |
+ "E1752", | |
}; | |
ast_copy_string (pvt->model, str, sizeof (pvt->model)); | |
diff --git a/chan_dongle.c b/chan_dongle.c | |
index 25372a2..e6e99ba 100644 | |
--- a/chan_dongle.c | |
+++ b/chan_dongle.c | |
@@ -1,7 +1,7 @@ | |
/* | |
* chan_dongle | |
* | |
- * Copyright (C) 2011 | |
+ * Copyright (C) 2011-2015 | |
* bg <bg_one@mail.ru> | |
* http://www.e1550.mobi | |
* | |
@@ -12,10 +12,6 @@ | |
* | |
* Dmitry Vagin <dmitry2004@yandex.ru> | |
* | |
- * Copyright (C) 2011 | |
- * bg <bg_one@mail.ru> | |
- * http://www.e1550.mobi | |
- | |
* chan_datacard is based on chan_mobile by Digium | |
* (Mark Spencer <markster@digium.com>) | |
* | |
@@ -112,7 +108,7 @@ static int lock_build(const char * devname, char * buf, unsigned length) | |
basename = devname; | |
/* NOTE: use system system wide lock directory */ | |
- return snprintf(buf, length, "/var/lock/LOCK..%s", basename); | |
+ return snprintf(buf, length, "/var/lock/LCK..%s", basename); | |
} | |
#/* return 0 on error */ | |
@@ -129,7 +125,10 @@ static int lock_create(const char * lockfile) | |
len = snprintf(pidb, sizeof(pidb), "%d %d", getpid(), fd); | |
len = write(fd, pidb, len); | |
close(fd); | |
+ } else { | |
+ ast_log(LOG_ERROR, "open('%s') failed: %s\n", lockfile, strerror(errno)); | |
} | |
+ | |
return len; | |
} | |
@@ -933,6 +932,7 @@ EXPORT_DEF struct pvt * find_device_by_resource_ex(struct public_state * state, | |
size_t last_used; | |
struct pvt * pvt; | |
struct pvt * found = NULL; | |
+ struct pvt * round_robin[MAXDONGLEDEVICES]; | |
*exists = 0; | |
/* Find requested device and make sure it's connected and initialized. */ | |
@@ -967,17 +967,17 @@ EXPORT_DEF struct pvt * find_device_by_resource_ex(struct public_state * state, | |
group = (int) strtol (&resource[1], (char**) NULL, 10); | |
if (errno != EINVAL) | |
{ | |
- ast_mutex_lock(&state->round_robin_mtx); | |
+// ast_mutex_lock(&state->round_robin_mtx); | |
/* Generate a list of all availible devices */ | |
- j = ITEMS_OF (state->round_robin); | |
+ j = ITEMS_OF (round_robin); | |
c = 0; last_used = 0; | |
AST_RWLIST_TRAVERSE(&state->devices, pvt, entry) | |
{ | |
ast_mutex_lock (&pvt->lock); | |
if (CONF_SHARED(pvt, group) == group) | |
{ | |
- state->round_robin[c] = pvt; | |
+ round_robin[c] = pvt; | |
if (pvt->group_last_used == 1) | |
{ | |
pvt->group_last_used = 0; | |
@@ -1003,7 +1003,7 @@ EXPORT_DEF struct pvt * find_device_by_resource_ex(struct public_state * state, | |
j = 0; | |
} | |
- pvt = state->round_robin[j]; | |
+ pvt = round_robin[j]; | |
*exists = 1; | |
ast_mutex_lock (&pvt->lock); | |
@@ -1016,22 +1016,22 @@ EXPORT_DEF struct pvt * find_device_by_resource_ex(struct public_state * state, | |
ast_mutex_unlock (&pvt->lock); | |
} | |
- ast_mutex_unlock(&state->round_robin_mtx); | |
+// ast_mutex_unlock(&state->round_robin_mtx); | |
} | |
} | |
else if (((resource[0] == 'p') || (resource[0] == 'P')) && resource[1] == ':') | |
{ | |
- ast_mutex_lock(&state->round_robin_mtx); | |
+// ast_mutex_lock(&state->round_robin_mtx); | |
/* Generate a list of all availible devices */ | |
- j = ITEMS_OF(state->round_robin); | |
+ j = ITEMS_OF(round_robin); | |
c = 0; last_used = 0; | |
AST_RWLIST_TRAVERSE(&state->devices, pvt, entry) | |
{ | |
ast_mutex_lock (&pvt->lock); | |
if (!strcmp (pvt->provider_name, &resource[2])) | |
{ | |
- state->round_robin[c] = pvt; | |
+ round_robin[c] = pvt; | |
if (pvt->prov_last_used == 1) | |
{ | |
pvt->prov_last_used = 0; | |
@@ -1057,7 +1057,7 @@ EXPORT_DEF struct pvt * find_device_by_resource_ex(struct public_state * state, | |
j = 0; | |
} | |
- pvt = state->round_robin[j]; | |
+ pvt = round_robin[j]; | |
*exists = 1; | |
ast_mutex_lock (&pvt->lock); | |
@@ -1070,14 +1070,14 @@ EXPORT_DEF struct pvt * find_device_by_resource_ex(struct public_state * state, | |
ast_mutex_unlock (&pvt->lock); | |
} | |
- ast_mutex_unlock(&state->round_robin_mtx); | |
+// ast_mutex_unlock(&state->round_robin_mtx); | |
} | |
else if (((resource[0] == 's') || (resource[0] == 'S')) && resource[1] == ':') | |
{ | |
- ast_mutex_lock(&state->round_robin_mtx); | |
+// ast_mutex_lock(&state->round_robin_mtx); | |
/* Generate a list of all availible devices */ | |
- j = ITEMS_OF(state->round_robin); | |
+ j = ITEMS_OF(round_robin); | |
c = 0; last_used = 0; | |
i = strlen (&resource[2]); | |
@@ -1086,7 +1086,7 @@ EXPORT_DEF struct pvt * find_device_by_resource_ex(struct public_state * state, | |
ast_mutex_lock (&pvt->lock); | |
if (!strncmp (pvt->imsi, &resource[2], i)) | |
{ | |
- state->round_robin[c] = pvt; | |
+ round_robin[c] = pvt; | |
if (pvt->sim_last_used == 1) | |
{ | |
pvt->sim_last_used = 0; | |
@@ -1112,7 +1112,7 @@ EXPORT_DEF struct pvt * find_device_by_resource_ex(struct public_state * state, | |
j = 0; | |
} | |
- pvt = state->round_robin[j]; | |
+ pvt = round_robin[j]; | |
*exists = 1; | |
ast_mutex_lock (&pvt->lock); | |
@@ -1125,7 +1125,7 @@ EXPORT_DEF struct pvt * find_device_by_resource_ex(struct public_state * state, | |
ast_mutex_unlock (&pvt->lock); | |
} | |
- ast_mutex_unlock(&state->round_robin_mtx); | |
+// ast_mutex_unlock(&state->round_robin_mtx); | |
} | |
else if (((resource[0] == 'i') || (resource[0] == 'I')) && resource[1] == ':') | |
{ | |
@@ -1652,7 +1652,7 @@ static int public_state_init(struct public_state * state) | |
ast_mutex_init(&state->discovery_lock); | |
state->discovery_thread = AST_PTHREADT_NULL; | |
- ast_mutex_init(&state->round_robin_mtx); | |
+// ast_mutex_init(&state->round_robin_mtx); | |
if(reload_config(state, 0, RESTATE_TIME_NOW, NULL) == 0) | |
{ | |
@@ -1686,7 +1686,7 @@ static int public_state_init(struct public_state * state) | |
ast_log (LOG_ERROR, "Errors reading config file " CONFIG_FILE ", Not loading module\n"); | |
} | |
- ast_mutex_destroy(&state->round_robin_mtx); | |
+// ast_mutex_destroy(&state->round_robin_mtx); | |
ast_mutex_destroy(&state->discovery_lock); | |
AST_RWLIST_HEAD_DESTROY(&state->devices); | |
@@ -1710,7 +1710,7 @@ static void public_state_fini(struct public_state * state) | |
discovery_stop(state); | |
devices_destroy(state); | |
- ast_mutex_destroy(&state->round_robin_mtx); | |
+// ast_mutex_destroy(&state->round_robin_mtx); | |
ast_mutex_destroy(&state->discovery_lock); | |
AST_RWLIST_HEAD_DESTROY(&state->devices); | |
} | |
diff --git a/chan_dongle.h b/chan_dongle.h | |
index b05956f..0123e04 100644 | |
--- a/chan_dongle.h | |
+++ b/chan_dongle.h | |
@@ -1,9 +1,12 @@ | |
-/* | |
- Copyright (C) 2009 - 2010 | |
- | |
+/* | |
+ Copyright (C) 2009-2015 | |
+ | |
+ bg <bg_one@mail.ru> | |
+ http://www.e1550.mobi | |
+ | |
Artem Makhutov <artem@makhutov.org> | |
http://www.makhutov.org | |
- | |
+ | |
Dmitry Vagin <dmitry2004@yandex.ru> | |
*/ | |
#ifndef CHAN_DONGLE_H_INCLUDED | |
@@ -20,7 +23,7 @@ | |
#include "dc_config.h" /* pvt_config_t */ | |
#define MODULE_DESCRIPTION "Huawei 3G Dongle Channel Driver" | |
-#define MAXDONGLEDEVICES 256 | |
+#define MAXDONGLEDEVICES 128 | |
INLINE_DECL const char * dev_state2str(dev_state_t state) | |
{ | |
@@ -206,8 +209,8 @@ typedef struct public_state | |
ast_mutex_t discovery_lock; | |
pthread_t discovery_thread; /* The discovery thread handler */ | |
volatile int unloading_flag; /* no need mutex or other locking for protect this variable because no concurent r/w and set non-0 atomically */ | |
- ast_mutex_t round_robin_mtx; | |
- struct pvt * round_robin[MAXDONGLEDEVICES]; | |
+// ast_mutex_t round_robin_mtx; | |
+// struct pvt * round_robin[MAXDONGLEDEVICES]; // TODO: remove and make local variable of find_device_by_resource_ex() | |
struct dc_gconfig global_settings; | |
} public_state_t; | |
diff --git a/configure.in b/configure.in | |
index 5a75b06..ed8d25f 100644 | |
--- a/configure.in | |
+++ b/configure.in | |
@@ -1,8 +1,8 @@ | |
dnl init | |
dnl AC_REVISION($Revision: 1.30 $) | |
AC_PREREQ([2.60]) | |
-AC_INIT([chan_dongle],[1.1],[http://code.google.com/p/asterisk-chan-dongle/issues/list],[chan_dongle],[http://code.google.com/p/asterisk-chan-dongle]) | |
-PACKAGE_REVISION="34" | |
+AC_INIT([chan_dongle],[1.1],[https://github.com/bg111/asterisk-chan-dongle/issues],[chan_dongle],[https://github.com/bg111/asterisk-chan-dongle/]) | |
+PACKAGE_REVISION="42gh=46cg" | |
AC_CANONICAL_TARGET | |
AM_INIT_AUTOMAKE | |
AC_CONFIG_HEADERS([config.h]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment