Merge branch 'develop'
authorAndreas Eversberg <jolly@eversberg.eu>
Mon, 20 Sep 2010 06:23:55 +0000 (08:23 +0200)
committerAndreas Eversberg <jolly@eversberg.eu>
Mon, 20 Sep 2010 06:23:55 +0000 (08:23 +0200)
gsm_ms.cpp
vbox.cpp

index 2e6299f..f8541fa 100644 (file)
@@ -585,13 +585,10 @@ void Pgsm_ms::message_setup(unsigned int epoint_id, int message_id, union parame
                }
                /* dialing information (mandatory) */
                mncc->fields |= MNCC_F_CALLED;
-               if (!strncmp(p_dialinginfo.id, "imsi-", 5)) {
-                       SCPY(mncc->imsi, p_dialinginfo.id+5);
-                       add_trace("dialing", "imsi", "%s", mncc->imsi);
-               } else {
-                       SCPY(mncc->called.number, p_dialinginfo.id);
-                       add_trace("dialing", "number", "%s", mncc->called.number);
-               }
+               mncc->called.type = 0; /* unknown */
+               mncc->called.plan = 1; /* isdn */
+               SCPY(mncc->called.number, p_dialinginfo.id);
+               add_trace("dialing", "number", "%s", mncc->called.number);
                
                /* bearer capability (mandatory) */
                mncc->fields |= MNCC_F_BEARER_CAP;
index 6eb0ce2..bc2c369 100644 (file)
--- a/vbox.cpp
+++ b/vbox.cpp
@@ -107,14 +107,14 @@ void VBoxPort::send_announcement(void)
        class Endpoint  *epoint;
        int             temp;
        struct timeval current_time;
-       long long       now;
+       long long       now;  /* Time in samples */
 
        /* don't restart timer, if announcement is played */
        if (p_vbox_announce_fh < 0)
                return;
 
        gettimeofday(&current_time, NULL);
-       now = current_time.tv_sec * MICRO_SECONDS + current_time.tv_usec;
+       now = (current_time.tv_sec * MICRO_SECONDS + current_time.tv_usec)/125;
 
        /* set time the first time */
        if (!p_vbox_audio_start)
@@ -122,6 +122,8 @@ void VBoxPort::send_announcement(void)
        
        /* calculate the number of bytes */
        tosend = (unsigned int)(now - p_vbox_audio_start) - p_vbox_audio_transferred;
+       if (tosend > sizeof(buffer))
+               tosend = sizeof(buffer);
 
        /* schedule next event */
        temp = ISDN_TRANSMIT + ISDN_TRANSMIT - tosend;
@@ -129,9 +131,6 @@ void VBoxPort::send_announcement(void)
                temp = 0;
        schedule_timer(&p_vbox_announce_timer, 0, temp*125);
 
-       if (tosend > sizeof(buffer))
-               tosend = sizeof(buffer);
-
        /* add the number of samples elapsed */
        p_vbox_audio_transferred += tosend;