CID
This commit is contained in:
parent
94734280c6
commit
1e5a2e6cb7
@ -172,7 +172,9 @@ int close_modem(char* dev)
|
|||||||
lprintf(error, "dev %s must begin with /dev/\n", dev);
|
lprintf(error, "dev %s must begin with /dev/\n", dev);
|
||||||
return -5;
|
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);
|
fclose(modem);
|
||||||
pthread_mutex_unlock(&modemmx);
|
pthread_mutex_unlock(&modemmx);
|
||||||
return 1;
|
return 1;
|
||||||
@ -209,13 +211,13 @@ int init_modem(char* dev)
|
|||||||
pthread_mutex_unlock(&modemmx);
|
pthread_mutex_unlock(&modemmx);
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&modemmx);
|
|
||||||
mo = &rockwell;
|
mo = &rockwell;
|
||||||
mo->init();
|
mo->init();
|
||||||
|
voice_init();
|
||||||
|
pthread_mutex_unlock(&modemmx);
|
||||||
pthread_mutex_lock(&mpipemx);
|
pthread_mutex_lock(&mpipemx);
|
||||||
pipe(modempipes);
|
pipe(modempipes);
|
||||||
pthread_mutex_unlock(&mpipemx);
|
pthread_mutex_unlock(&mpipemx);
|
||||||
voice_init();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,14 +27,14 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* 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 <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <phoned.h>
|
#include <phoned.h>
|
||||||
#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_PICKUP "ATH1"
|
||||||
#define ROCKWELL_HANGUP "ATH"
|
#define ROCKWELL_HANGUP "ATH"
|
||||||
#define ROCKWELL_RESET "ATZ"
|
#define ROCKWELL_RESET "ATZ"
|
||||||
@ -47,6 +47,7 @@ short plug_init(void)
|
|||||||
int rw_init(void)
|
int rw_init(void)
|
||||||
{
|
{
|
||||||
stmod(ROCKWELL_INITSTRING);
|
stmod(ROCKWELL_INITSTRING);
|
||||||
|
stmod("AT#CID=2");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int rw_destroy(void)
|
int rw_destroy(void)
|
||||||
@ -134,6 +135,8 @@ void rw_sdev(d)
|
|||||||
/* voice */
|
/* voice */
|
||||||
void rw_voice_init(void)
|
void rw_voice_init(void)
|
||||||
{
|
{
|
||||||
|
stmod("ATE0");
|
||||||
|
stmod("ATV0");
|
||||||
stmod("AT#VSP=55");
|
stmod("AT#VSP=55");
|
||||||
stmod("AT#VSD=0");
|
stmod("AT#VSD=0");
|
||||||
stmod("AT#VBS=4");
|
stmod("AT#VBS=4");
|
||||||
@ -142,6 +145,7 @@ void rw_voice_init(void)
|
|||||||
stmod("ATS30=60");
|
stmod("ATS30=60");
|
||||||
stmod("AT#CLS=8");
|
stmod("AT#CLS=8");
|
||||||
rw_sdev(dialup);
|
rw_sdev(dialup);
|
||||||
|
stmod("AT#CID=2");
|
||||||
}
|
}
|
||||||
void rw_set_rings(rings)
|
void rw_set_rings(rings)
|
||||||
int rings;
|
int rings;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* 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 */
|
/* system includes */
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -255,7 +255,7 @@ int dialogue_cb(fd, sck)
|
|||||||
if(FD_ISSET(s, &fds) != 0) {
|
if(FD_ISSET(s, &fds) != 0) {
|
||||||
rc = recv(s, buffer, 1, 0x0);
|
rc = recv(s, buffer, 1, 0x0);
|
||||||
if(rc == 0) {
|
if(rc == 0) {
|
||||||
lprintf(debug, "Socket closed! Got zero!\n");
|
lprintf(debug, "cb: Socket closed! Got zero!\n");
|
||||||
return 0;
|
return 0;
|
||||||
} else if(rc == -1) {
|
} else if(rc == -1) {
|
||||||
lprintf(debug, "recv(): %s", strerror(errno));
|
lprintf(debug, "recv(): %s", strerror(errno));
|
||||||
|
Loading…
Reference in New Issue
Block a user