Fix: Do not send notify IDs that are not 0, 1 or 2
[lcr.git] / gsm.cpp
diff --git a/gsm.cpp b/gsm.cpp
index e8f7886..36fb98b 100644 (file)
--- a/gsm.cpp
+++ b/gsm.cpp
@@ -286,9 +286,6 @@ void Pgsm::frame_receive(void *arg)
        unsigned char data[160];
        int i, cmr;
 
-       if (!p_g_fr_decoder)
-               return;
-
        switch (frame->msg_type) {
        case GSM_TCHF_FRAME:
                if (p_g_media_type != MEDIA_TYPE_GSM) {
@@ -841,6 +838,9 @@ void Pgsm::message_notify(unsigned int epoint_id, int message_id, union paramete
 //     printf("if = %d\n", param->notifyinfo.notify);
        if (param->notifyinfo.notify>INFO_NOTIFY_NONE) {
                notify = param->notifyinfo.notify & 0x7f;
+               /* skip all notifiy ids that are not 0, 1, 2 */
+               if (notify > 2)
+                       return;
                if (p_state!=PORT_STATE_CONNECT /*&& p_state!=PORT_STATE_IN_PROCEEDING*/ && p_state!=PORT_STATE_IN_ALERTING) {
                        /* queue notification */
                        if (p_g_notify_pending)
@@ -1283,7 +1283,7 @@ static int mncc_fd_close(struct lcr_gsm *lcr_gsm, struct lcr_fd *lfd)
        /* free all the calls that were running through the MNCC interface */
        port = port_first;
        while(port) {
-               if ((port->p_type & PORT_CLASS_mISDN_MASK) == PORT_CLASS_GSM) {
+               if ((port->p_type & PORT_CLASS_MASK) == PORT_CLASS_GSM) {
                        pgsm = (class Pgsm *)port;
                        if (pgsm->p_g_lcr_gsm == lcr_gsm) {
                                message = message_create(pgsm->p_serial, ACTIVE_EPOINT(pgsm->p_epointlist), PORT_TO_EPOINT, MESSAGE_RELEASE);