Added new option to interface.conf: "nonotify" to disable notify messages.
[lcr.git] / gsm.cpp
diff --git a/gsm.cpp b/gsm.cpp
index cd3aa8f..e747ff0 100644 (file)
--- a/gsm.cpp
+++ b/gsm.cpp
@@ -32,6 +32,7 @@ extern int bsc_shutdown_net(struct gsm_network *net);
 void talloc_ctx_init(void);
 void on_dso_load_token(void);
 void on_dso_load_rrlp(void);
+static struct debug_target *stderr_target;
 
 #include "gsm_audio.h"
 
@@ -759,8 +760,15 @@ void Pgsm::rel_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc
 /* NOTIFY INDICATION */
 void Pgsm::notify_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc)
 {
+       struct lcr_msg *message;
+
        gsm_trace_header(p_m_mISDNport, this, msg_type, DIRECTION_IN);
+       add_trace("notify", NULL, "%d", mncc->notify);
        end_trace();
+
+       message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_NOTIFY);
+       message->param.notifyinfo.notify = mncc->notify;
+       message_put(message);
 }
 
 
@@ -1539,7 +1547,7 @@ static int gsm_sock_open(char *portname)
                PERROR_RUNTIME("GSM port %d does not support TE PRI or TE BRI.\n", gsm->gsm_port);
        }
        /* open socket */
-       if ((gsm->gsm_sock = socket(PF_ISDN, SOCK_DGRAM, ISDN_P_TE_S0)) < 0) {
+       if ((gsm->gsm_sock = socket(PF_ISDN, SOCK_DGRAM, (pri)?ISDN_P_TE_E1:ISDN_P_TE_S0)) < 0) {
                PERROR_RUNTIME("GSM port %d failed to open socket.\n", gsm->gsm_port);
                gsm_sock_close();
                return gsm->gsm_sock;
@@ -1610,8 +1618,9 @@ int gsm_init(void)
        }
 
        /* set debug */
+       stderr_target = debug_target_create_stderr();
        if (gsm->conf.debug[0])
-               debug_parse_category_mask(gsm->conf.debug);
+               debug_parse_category_mask(stderr_target, gsm->conf.debug);
 
        /* open pcap file */
        if (gsm->conf.pcapfile[0]) {