From 1e5a2e6cb7b88083c67cebb381b2c228fe820990 Mon Sep 17 00:00:00 2001 From: dcp1990 Date: Sun, 26 Jun 2005 03:27:31 +0000 Subject: [PATCH] CID --- phoned/modem.c | 8 +++++--- phoned/modems/rockwell.c | 8 ++++++-- phoned/remote.c | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/phoned/modem.c b/phoned/modem.c index 7fa0ab2..4f1d0da 100644 --- a/phoned/modem.c +++ b/phoned/modem.c @@ -172,7 +172,9 @@ int close_modem(char* dev) lprintf(error, "dev %s must begin with /dev/\n", dev); return -5; } - uu_unlock((dev+(sizeof("/dev/")-1))); + if(uu_unlock((dev+(sizeof("/dev/")-1))) == -1) { + lprintf(error, "uu_unlock: %s", strerror(errno)); + } fclose(modem); pthread_mutex_unlock(&modemmx); return 1; @@ -209,13 +211,13 @@ int init_modem(char* dev) pthread_mutex_unlock(&modemmx); return -3; } - pthread_mutex_unlock(&modemmx); mo = &rockwell; mo->init(); + voice_init(); + pthread_mutex_unlock(&modemmx); pthread_mutex_lock(&mpipemx); pipe(modempipes); pthread_mutex_unlock(&mpipemx); - voice_init(); return 1; } diff --git a/phoned/modems/rockwell.c b/phoned/modems/rockwell.c index 078be74..f47cc16 100644 --- a/phoned/modems/rockwell.c +++ b/phoned/modems/rockwell.c @@ -27,14 +27,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -/* $Amigan: phoned/phoned/modems/rockwell.c,v 1.6 2005/06/23 16:46:10 dcp1990 Exp $ */ +/* $Amigan: phoned/phoned/modems/rockwell.c,v 1.7 2005/06/26 03:27:35 dcp1990 Exp $ */ #include #include #include #include #include #include -#define ROCKWELL_INITSTRING "ATZ\r\nAT E0 #CID=2 V0" +#define ROCKWELL_INITSTRING "ATZ\r\nAT E0 #CID=2 V0\r\n" #define ROCKWELL_PICKUP "ATH1" #define ROCKWELL_HANGUP "ATH" #define ROCKWELL_RESET "ATZ" @@ -47,6 +47,7 @@ short plug_init(void) int rw_init(void) { stmod(ROCKWELL_INITSTRING); + stmod("AT#CID=2"); return 1; } int rw_destroy(void) @@ -134,6 +135,8 @@ void rw_sdev(d) /* voice */ void rw_voice_init(void) { + stmod("ATE0"); + stmod("ATV0"); stmod("AT#VSP=55"); stmod("AT#VSD=0"); stmod("AT#VBS=4"); @@ -142,6 +145,7 @@ void rw_voice_init(void) stmod("ATS30=60"); stmod("AT#CLS=8"); rw_sdev(dialup); + stmod("AT#CID=2"); } void rw_set_rings(rings) int rings; diff --git a/phoned/remote.c b/phoned/remote.c index c771161..e20064d 100644 --- a/phoned/remote.c +++ b/phoned/remote.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -/* $Amigan: phoned/phoned/remote.c,v 1.14 2005/06/26 02:56:37 dcp1990 Exp $ */ +/* $Amigan: phoned/phoned/remote.c,v 1.15 2005/06/26 03:27:31 dcp1990 Exp $ */ /* system includes */ #include #include @@ -255,7 +255,7 @@ int dialogue_cb(fd, sck) if(FD_ISSET(s, &fds) != 0) { rc = recv(s, buffer, 1, 0x0); if(rc == 0) { - lprintf(debug, "Socket closed! Got zero!\n"); + lprintf(debug, "cb: Socket closed! Got zero!\n"); return 0; } else if(rc == -1) { lprintf(debug, "recv(): %s", strerror(errno));