fixed some bugs
[lcr.git] / port.cpp
index d254d0c..e397b31 100644 (file)
--- a/port.cpp
+++ b/port.cpp
@@ -45,15 +45,6 @@ Functions:
    
 */
 
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <math.h>
 #include "main.h"
 
 #define SHORT_MIN -32768
@@ -216,7 +207,7 @@ Port::Port(int type, char *portname, struct port_settings *settings)
 Port::~Port(void)
 {
        class Port *temp, **tempp;
-       struct message *message;
+       struct lcr_msg *message;
 
        if (p_record)
                close_record(0, 0);
@@ -449,7 +440,7 @@ void Port::set_vbox_tone(char *dir, char *name)
 void Port::set_vbox_play(char *name, int offset)
 {
        signed long size;
-       struct message *message;
+       struct lcr_msg *message;
 
        /* use ser_box_tone() */
        set_vbox_tone("", name);
@@ -563,7 +554,7 @@ read_more:
                if (((p_tone_size-p_tone_left)/8000) != (p_tone_size-tone_left_before)/8000)
                {
 //printf("\nsize=%d left=%d\n\n",p_tone_size,p_tone_left);
-                       struct message *message;
+                       struct lcr_msg *message;
                        message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_TONE_COUNTER);
                        message->param.counter.current = (p_tone_size-p_tone_left)/8000;
                        message->param.counter.max = -1;
@@ -598,7 +589,7 @@ read_more:
 try_loop:
        if (p_tone_eof && ACTIVE_EPOINT(p_epointlist))
        {
-               struct message *message;
+               struct lcr_msg *message;
                message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_TONE_EOF);
                message_put(message);
        }
@@ -652,7 +643,7 @@ int Port::handler(void)
  * this is called by the message_epoint inherited by child classes
  * therefor a return=1 means: stop, no more processing
  */
-//extern struct message *dddebug;
+//extern struct lcr_msg *dddebug;
 int Port::message_epoint(unsigned long epoint_id, int message_id, union parameter *param)
 {
        /* check if we got audio data from one remote port */
@@ -810,7 +801,7 @@ void Port::close_record(int beep, int mute)
 //     apply_callerid_restriction(p_record_anon_ignore, callerinfo.id, &callerinfo.ntype, &callerinfo.present, &callerinfo.screen, callerinfo.extension, callerinfo.name);
 
        SCPY(number, p_dialinginfo.id);
-       SCPY(callerid, numberrize_callerinfo(callerinfo.id, callerinfo.ntype));
+       SCPY(callerid, numberrize_callerinfo(callerinfo.id, callerinfo.ntype, options.national, options.international));
        if (callerid[0] == '\0')
        {
                if (callerinfo.present == INFO_PRESENT_RESTRICTED)