X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=dss1.cpp;h=82b09bbb0938443c961297911761c4d1feeff7ef;hp=e561c071415eb8c8aad3db26b1dd9ca8eb0897bf;hb=31aff20175a3bc9b4bb41d080452ae1d063e267a;hpb=ef3fc1931a2fa82f482d21fb1296735206463d3a diff --git a/dss1.cpp b/dss1.cpp index e561c07..82b09bb 100644 --- a/dss1.cpp +++ b/dss1.cpp @@ -22,7 +22,7 @@ #include #include extern "C" { -#include +#include } //#define CENTREX @@ -42,8 +42,8 @@ Pdss1::Pdss1(int type, struct mISDNport *mISDNport, char *portname, struct port_ p_m_d_ces = -1; p_m_d_queue = NULL; p_m_d_notify_pending = NULL; - p_m_d_collect_cause = CAUSE_NOUSER; - p_m_d_collect_location = LOCATION_PRIVATE_LOCAL; + p_m_d_collect_cause = 0; + p_m_d_collect_location = 0; PDEBUG(DEBUG_ISDN, "Created new mISDNPort(%s). Currently %d objects use, %s port #%d\n", portname, mISDNport->use, (mISDNport->ntmode)?"NT":"TE", p_m_portnum); } @@ -164,7 +164,7 @@ int Pdss1::received_first_reply_to_setup(unsigned long prim, int channel, int ex end_trace(); /* activate our exclusive channel */ - bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_ACTIVATE); + bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE); } else if (p_m_b_channel) { @@ -185,7 +185,7 @@ int Pdss1::received_first_reply_to_setup(unsigned long prim, int channel, int ex add_trace("connect", "channel", "%d", p_m_b_channel); end_trace(); p_m_b_exclusive = 1; // we are done - bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_ACTIVATE); + bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE); return(0); } @@ -212,7 +212,7 @@ int Pdss1::received_first_reply_to_setup(unsigned long prim, int channel, int ex end_trace(); /* activate channel given by remote */ - bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_ACTIVATE); + bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE); } else if (p_m_b_reserve) { @@ -248,7 +248,7 @@ int Pdss1::received_first_reply_to_setup(unsigned long prim, int channel, int ex end_trace(); /* activate channel given by remote */ - bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_ACTIVATE); + bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE); } else { /*** we sent 'no channel available' ***/ @@ -277,7 +277,7 @@ int Pdss1::received_first_reply_to_setup(unsigned long prim, int channel, int ex p_m_b_exclusive = 1; // we are done /* activate channel given by remote */ - bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_ACTIVATE); + bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE); return(0); } @@ -312,7 +312,7 @@ int Pdss1::received_first_reply_to_setup(unsigned long prim, int channel, int ex p_m_b_exclusive = 1; // we are done /* activate channel given by remote */ - bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_ACTIVATE); + bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE); } return(0); @@ -353,9 +353,9 @@ int Pdss1::hunt_bchannel(int channel, int exclusive) } if (channel <= 0) /* not given, no channel, whatever.. */ channel = CHANNEL_ANY; /* any channel */ + add_trace("channel", "reserved", "%d", p_m_mISDNport->b_reserved); if (p_m_mISDNport->b_reserved >= p_m_mISDNport->b_num) // of out chan.. { - add_trace("channel", "reserved", "%d", p_m_mISDNport->b_reserved); add_trace("conclusion", NULL, "all channels are reserved"); end_trace(); return(-34); // no channel @@ -731,14 +731,14 @@ void Pdss1::setup_ind(unsigned long prim, unsigned long dinfo, void *data) p_m_delete = 1; return; } - bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_ACTIVATE); + bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE); /* create endpoint */ if (p_epointlist) FATAL("Incoming call but already got an endpoint.\n"); - if (!(epoint = new Endpoint(p_serial, 0, 0))) + if (!(epoint = new Endpoint(p_serial, 0))) FATAL("No memory for Endpoint instance\n"); - if (!(epoint->ep_app = new DEFAULT_ENDPOINT_APP(epoint))) + if (!(epoint->ep_app = new DEFAULT_ENDPOINT_APP(epoint, 0))) //incomming FATAL("No memory for Endpoint Application instance\n"); epointlist_new(epoint->ep_serial); @@ -746,6 +746,7 @@ void Pdss1::setup_ind(unsigned long prim, unsigned long dinfo, void *data) message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_SETUP); message->param.setup.isdn_port = p_m_portnum; message->param.setup.port_type = p_type; + message->param.setup.dtmf = !p_m_mISDNport->ifport->nodtmf; memcpy(&message->param.setup.dialinginfo, &p_dialinginfo, sizeof(struct dialing_info)); memcpy(&message->param.setup.callerinfo, &p_callerinfo, sizeof(struct caller_info)); memcpy(&message->param.setup.redirinfo, &p_redirinfo, sizeof(struct redir_info)); @@ -812,7 +813,7 @@ void Pdss1::setup_acknowledge_ind(unsigned long prim, unsigned long dinfo, void end_trace(); /* process channel */ - ret = received_first_reply_to_setup(prim, exclusive, channel); + ret = received_first_reply_to_setup(prim, channel, exclusive); if (ret < 0) { message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_RELEASE); @@ -849,7 +850,7 @@ void Pdss1::proceeding_ind(unsigned long prim, unsigned long dinfo, void *data) dec_ie_redir_dn(proceeding->REDIR_DN, (Q931_info_t *)((unsigned long)data+headerlen), &type, &plan, &present, (unsigned char *)redir, sizeof(redir)); end_trace(); - ret = received_first_reply_to_setup(prim, exclusive, channel); + ret = received_first_reply_to_setup(prim, channel, exclusive); if (ret < 0) { message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_RELEASE); @@ -933,7 +934,7 @@ void Pdss1::alerting_ind(unsigned long prim, unsigned long dinfo, void *data) end_trace(); /* process channel */ - ret = received_first_reply_to_setup(prim, exclusive, channel); + ret = received_first_reply_to_setup(prim, channel, exclusive); if (ret < 0) { message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_RELEASE); @@ -1024,7 +1025,7 @@ void Pdss1::connect_ind(unsigned long prim, unsigned long dinfo, void *data) /* select channel */ bchannel_before = p_m_b_channel; - ret = received_first_reply_to_setup(prim, exclusive, channel); + ret = received_first_reply_to_setup(prim, channel, exclusive); if (ret < 0) { message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_RELEASE); @@ -1120,8 +1121,8 @@ void Pdss1::disconnect_ind(unsigned long prim, unsigned long dinfo, void *data) if (cause < 0) cause = 16; - /* release if we are remote sends us no tones */ - if (p_m_mISDNport->earlyb) + /* release if remote sends us no tones */ + if (!p_m_mISDNport->earlyb) { RELEASE_t *release; msg_t *dmsg; @@ -1184,7 +1185,6 @@ void Pdss1::disconnect_ind_i(unsigned long prim, unsigned long dinfo, void *data add_trace("old-cause", "value", "%d", p_m_d_collect_cause); } dec_ie_cause(disconnect->CAUSE, (Q931_info_t *)((unsigned long)data+headerlen), &location, &cause); - end_trace(); if (location == LOCATION_PRIVATE_LOCAL) location = LOCATION_PRIVATE_REMOTE; @@ -1192,6 +1192,7 @@ void Pdss1::disconnect_ind_i(unsigned long prim, unsigned long dinfo, void *data collect_cause(&p_m_d_collect_cause, &p_m_d_collect_location, cause, location); add_trace("new-cause", "location", "%d", p_m_d_collect_location); add_trace("new-cause", "value", "%d", p_m_d_collect_cause); + end_trace(); } @@ -1242,7 +1243,7 @@ void Pdss1::release_ind(unsigned long prim, unsigned long dinfo, void *data) p_m_delete = 1; } -/* CC_RELEASE_COMPLETE INDICATION */ +/* CC_RELEASE_COMPLETE INDICATION (a reject) */ void Pdss1::release_complete_ind(unsigned long prim, unsigned long dinfo, void *data) { int headerlen = (p_m_d_ntmode)?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; @@ -1285,8 +1286,15 @@ void Pdss1::t312_timeout(unsigned long prim, unsigned long dinfo, void *data) while(p_epointlist) { message = message_create(p_serial, p_epointlist->epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE); - message->param.disconnectinfo.cause = p_m_d_collect_cause; - message->param.disconnectinfo.location = p_m_d_collect_location; + if (p_m_d_collect_cause) + { + message->param.disconnectinfo.cause = p_m_d_collect_cause; + message->param.disconnectinfo.location = p_m_d_collect_location; + } else + { + message->param.disconnectinfo.cause = CAUSE_NOUSER; + message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL; + } message_put(message); /* remove epoint */ free_epointlist(p_epointlist); @@ -1303,10 +1311,11 @@ void Pdss1::notify_ind(unsigned long prim, unsigned long dinfo, void *data) NOTIFY_t *notifying = (NOTIFY_t *)((unsigned long)data + headerlen); struct message *message; int notify, type, plan, present; + unsigned char notifyid[sizeof(message->param.notifyinfo.id)]; l1l2l3_trace_header(p_m_mISDNport, this, prim, DIRECTION_IN); dec_ie_notify(notifying->NOTIFY, (Q931_info_t *)((unsigned long)data+headerlen), ¬ify); - dec_ie_redir_dn(notifying->REDIR_DN, (Q931_info_t *)((unsigned long)data+headerlen), &type, &plan, &present, (unsigned char *)message->param.notifyinfo.id, sizeof(message->param.notifyinfo.id)); + dec_ie_redir_dn(notifying->REDIR_DN, (Q931_info_t *)((unsigned long)data+headerlen), &type, &plan, &present, notifyid, sizeof(notifyid)); end_trace(); if (!ACTIVE_EPOINT(p_epointlist)) @@ -1317,6 +1326,7 @@ void Pdss1::notify_ind(unsigned long prim, unsigned long dinfo, void *data) notify |= 0x80; message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_NOTIFY); message->param.notifyinfo.notify = notify; + SCPY(message->param.notifyinfo.id, (char *)notifyid); /* redirection number */ switch (present) { @@ -1463,7 +1473,7 @@ void Pdss1::retrieve_ind(unsigned long prim, unsigned long dinfo, void *data) cause = -ret; goto reject; } - bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_ACTIVATE); + bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE); /* set hold state */ p_m_hold = 0; @@ -1635,7 +1645,7 @@ void Pdss1::resume_ind(unsigned long prim, unsigned long dinfo, void *data) p_m_delete = 1; return; } - bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_ACTIVATE); + bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE); /* create endpoint */ if (p_epointlist) @@ -1867,9 +1877,10 @@ void Pdss1::message_isdn(unsigned long prim, unsigned long dinfo, void *data) } p_m_d_l3id = 0; p_m_delete = 1; +//#warning remove me +//PDEBUG(DEBUG_LOG, "JOLLY release cr %d\n", p_serial); /* sending release to endpoint in case we still have an endpoint - * NOTE: this only happens if the stack releases due to layer1 - * or layer2 breakdown. otherwhise a release is received first. + * this is because we don't get any response if a release_complete is received (or a release in release state) */ while(p_epointlist) { @@ -1915,45 +1926,43 @@ void Pdss1::new_state(int state) class Endpoint *epoint; /* set timeout */ - epoint = find_epoint_id(ACTIVE_EPOINT(p_epointlist)); - if (epoint && p_m_d_ntmode) + if (state == PORT_STATE_IN_OVERLAP) { - if (state == PORT_STATE_IN_OVERLAP) + p_m_timeout = p_m_mISDNport->ifport->tout_dialing; + time(&p_m_timer); + } + if (state != p_state) + { + if (state == PORT_STATE_IN_SETUP + || state == PORT_STATE_OUT_SETUP + || state == PORT_STATE_IN_OVERLAP + || state == PORT_STATE_OUT_OVERLAP) { - p_m_timeout = p_settings.tout_dialing; + p_m_timeout = p_m_mISDNport->ifport->tout_setup; time(&p_m_timer); } - if (state != p_state) + if (state == PORT_STATE_IN_PROCEEDING + || state == PORT_STATE_OUT_PROCEEDING) { - if (state == PORT_STATE_IN_SETUP - || state == PORT_STATE_IN_OVERLAP) - { - p_m_timeout = p_settings.tout_setup; - time(&p_m_timer); - } - if (state == PORT_STATE_IN_PROCEEDING - || state == PORT_STATE_OUT_PROCEEDING) - { - p_m_timeout = p_settings.tout_proceeding; - time(&p_m_timer); - } - if (state == PORT_STATE_IN_ALERTING - || state == PORT_STATE_OUT_ALERTING) - { - p_m_timeout = p_settings.tout_alerting; - time(&p_m_timer); - } - if (state == PORT_STATE_CONNECT - || state == PORT_STATE_CONNECT_WAITING) - { - p_m_timeout = 0; - } - if (state == PORT_STATE_IN_DISCONNECT - || state == PORT_STATE_OUT_DISCONNECT) - { - p_m_timeout = p_settings.tout_disconnect; - time(&p_m_timer); - } + p_m_timeout = p_m_mISDNport->ifport->tout_proceeding; + time(&p_m_timer); + } + if (state == PORT_STATE_IN_ALERTING + || state == PORT_STATE_OUT_ALERTING) + { + p_m_timeout = p_m_mISDNport->ifport->tout_alerting; + time(&p_m_timer); + } + if (state == PORT_STATE_CONNECT + || state == PORT_STATE_CONNECT_WAITING) + { + p_m_timeout = 0; + } + if (state == PORT_STATE_IN_DISCONNECT + || state == PORT_STATE_OUT_DISCONNECT) + { + p_m_timeout = p_m_mISDNport->ifport->tout_disconnect; + time(&p_m_timer); } } @@ -1968,12 +1977,17 @@ int Pdss1::handler(void) { int ret; +//if (p_m_delete && p_m_d_l3id==0) +// printf("ping! %d", p_serial); if ((ret = PmISDN::handler())) return(ret); /* handle destruction */ if (p_m_delete && p_m_d_l3id==0) { +//#warning remove +//PDEBUG(DEBUG_LOG, "JOLLY destroy object %d\n", p_serial); + delete this; return(-1); } @@ -2040,6 +2054,8 @@ void Pdss1::message_setup(unsigned long epoint_id, int message_id, union paramet memcpy(&p_capainfo, ¶m->setup.capainfo, sizeof(p_capainfo)); memcpy(&p_redirinfo, ¶m->setup.redirinfo, sizeof(p_redirinfo)); // SCPY(&p_m_tones_dir, param->setup.ext.tones_dir); + /* screen outgoing caller id */ + do_screen(1, p_callerinfo.id, sizeof(p_callerinfo.id), &p_callerinfo.ntype, &p_callerinfo.present, p_m_mISDNport->ifport->interface); /* only display at connect state: this case happens if endpoint is in connected mode */ if (p_state==PORT_STATE_CONNECT) @@ -2557,6 +2573,8 @@ void Pdss1::message_connect(unsigned long epoint_id, int message_id, union param /* copy connected information */ memcpy(&p_connectinfo, ¶m->connectinfo, sizeof(p_connectinfo)); + /* screen outgoing caller id */ + do_screen(1, p_connectinfo.id, sizeof(p_connectinfo.id), &p_connectinfo.ntype, &p_connectinfo.present, p_m_mISDNport->ifport->interface); /* only display at connect state */ if (p_state == PORT_STATE_CONNECT) @@ -2665,8 +2683,8 @@ void Pdss1::message_disconnect(unsigned long epoint_id, int message_id, union pa char *p = NULL; /* we reject during incoming setup when we have no tones. also if we are in outgoing setup state */ - if ((p_state==PORT_STATE_IN_SETUP && !p_m_mISDNport->tones) - || p_state==PORT_STATE_OUT_SETUP) +// if ((p_state==PORT_STATE_IN_SETUP && !p_m_mISDNport->tones) +if (/* ||*/ p_state==PORT_STATE_OUT_SETUP) { /* sending release to endpoint */ while(p_epointlist) @@ -2691,7 +2709,7 @@ void Pdss1::message_disconnect(unsigned long epoint_id, int message_id, union pa return; } - /* NT-MODE in setup state we must send PROCEEDING first */ + /* workarround: NT-MODE in setup state we must send PROCEEDING first to make it work */ if (p_state==PORT_STATE_IN_SETUP) { CALL_PROCEEDING_t *proceeding; @@ -2745,9 +2763,12 @@ void Pdss1::message_release(unsigned long epoint_id, int message_id, union param class Endpoint *epoint; char *p = NULL; - /* if we have incoming disconnected, we may release */ - if (p_state==PORT_STATE_IN_DISCONNECT - || p_state==PORT_STATE_OUT_DISCONNECT) + /* + * we may only release during incomming disconnect state. + * this means that the endpoint doesnt require audio anymore + */ + if (p_state == PORT_STATE_IN_DISCONNECT + || p_state == PORT_STATE_OUT_DISCONNECT) { /* sending release */ dmsg = create_l3msg(CC_RELEASE | REQUEST, MT_RELEASE, p_m_d_l3id, sizeof(RELEASE_t), p_m_d_ntmode); @@ -2758,16 +2779,24 @@ void Pdss1::message_release(unsigned long epoint_id, int message_id, union param end_trace(); msg_queue_tail(&p_m_mISDNport->downqueue, dmsg); new_state(PORT_STATE_RELEASE); + /* remove epoint */ + free_epointid(epoint_id); + // wait for callref to be released return; } - /* if we are on outgoing/incoming call setup, we may release complete */ - if (p_state==PORT_STATE_OUT_SETUP - || p_state==PORT_STATE_IN_SETUP -// NOTE: a bug in mISDNuser (see disconnect_req_out !!!) - || p_state==PORT_STATE_OUT_PROCEEDING) + /* + * if we are on incoming call setup, we may reject by sending a release_complete + * also on outgoing call setup, we send a release complete, BUT this is not conform. (i don't know any other way) + */ + if (p_state==PORT_STATE_IN_SETUP + || p_state==PORT_STATE_OUT_SETUP) +// // NOTE: a bug in mISDNuser (see disconnect_req_out !!!) +// || p_state==PORT_STATE_OUT_DISCO) { - /* sending release */ +//#warning remove me +//PDEBUG(DEBUG_LOG, "JOLLY sending release complete %d\n", p_serial); + /* sending release complete */ dmsg = create_l3msg(CC_RELEASE_COMPLETE | REQUEST, MT_RELEASE_COMPLETE, p_m_d_l3id, sizeof(RELEASE_COMPLETE_t), p_m_d_ntmode); release_complete = (RELEASE_COMPLETE_t *)(dmsg->data + headerlen); l1l2l3_trace_header(p_m_mISDNport, this, CC_RELEASE | REQUEST, DIRECTION_OUT); @@ -2776,9 +2805,10 @@ void Pdss1::message_release(unsigned long epoint_id, int message_id, union param end_trace(); msg_queue_tail(&p_m_mISDNport->downqueue, dmsg); new_state(PORT_STATE_RELEASE); - /* remove epoint */ free_epointid(epoint_id); +#if 0 + /* remove process */ l1l2l3_trace_header(p_m_mISDNport, this, CC_RELEASE_CR | REQUEST, DIRECTION_OUT); add_trace("callref", NULL, "0x%x", p_m_d_l3id); end_trace(); @@ -2789,9 +2819,13 @@ void Pdss1::message_release(unsigned long epoint_id, int message_id, union param } p_m_d_l3id = 0; p_m_delete = 1; +#endif + // wait for callref to be released return; } +#if 0 +wirklich erst proceeding?: /* NT-MODE in setup state we must send PROCEEDING first */ if (p_m_d_ntmode && p_state==PORT_STATE_IN_SETUP) { @@ -2811,6 +2845,7 @@ void Pdss1::message_release(unsigned long epoint_id, int message_id, union param end_trace(); msg_queue_tail(&p_m_mISDNport->downqueue, dmsg); } +#endif /* sending disconnect */ dmsg = create_l3msg(CC_DISCONNECT | REQUEST, MT_DISCONNECT, p_m_d_l3id, sizeof(DISCONNECT_t), p_m_d_ntmode); @@ -2832,9 +2867,12 @@ void Pdss1::message_release(unsigned long epoint_id, int message_id, union param enc_ie_display(&disconnect->DISPLAY, dmsg, (unsigned char *)p); end_trace(); msg_queue_tail(&p_m_mISDNport->downqueue, dmsg); - new_state(PORT_STATE_RELEASE); + new_state(PORT_STATE_OUT_DISCONNECT); + /* remove epoint */ free_epointid(epoint_id); -// p_m_delete = 1; + // wait for release and callref to be released +//#warning remove me +//PDEBUG(DEBUG_LOG, "JOLLY sending disconnect %d\n", p_serial); } @@ -3034,21 +3072,40 @@ int stack2manager_nt(void *dat, void *arg) /* check out correct stack */ if (pdss1->p_m_mISDNport == mISDNport) /* check out correct id */ - if ((hh->dinfo&0xffff0000) == (pdss1->p_m_d_l3id&0xffff0000)) + if ((pdss1->p_m_d_l3id&0x0000ff00) != 0x000ff00) { - /* found port, the message belongs to */ - break; + /* a single process */ + if (hh->dinfo == pdss1->p_m_d_l3id) + { + /* found port, the message belongs to */ + break; + } + } else + { + /* a broadcast process */ + if ((hh->dinfo&0xffff0000) == (pdss1->p_m_d_l3id&0xffff0000)) + { + /* found port, the message belongs to */ + break; + } } } port = port->next; } if (port) { +//printf("%x %x\n", hh->dinfo, pdss1->p_m_d_l3id); /* if process id is master process, but a child disconnects */ - if ((hh->dinfo&0x0000ff00)!=0x0000ff00 && (pdss1->p_m_d_l3id&0x0000ff00)==0x0000ff00 && hh->prim==(CC_DISCONNECT|INDICATION)) + if ((hh->dinfo&0x0000ff00)!=0x0000ff00 && (pdss1->p_m_d_l3id&0x0000ff00)==0x0000ff00) { - /* send special indication for child disconnect */ - pdss1->disconnect_ind_i(hh->prim, hh->dinfo, msg->data); + if (hh->prim == (CC_DISCONNECT|INDICATION)) + { + /* send special indication for child disconnect */ + pdss1->disconnect_ind_i(hh->prim, hh->dinfo, msg->data); + free_msg(msg); + return(0); + } + // ignoring other messages from child processes free_msg(msg); return(0); } @@ -3105,6 +3162,9 @@ int stack2manager_nt(void *dat, void *arg) time(&mISDNport->l2establish); PDEBUG(DEBUG_ISDN, "because we are ptp, we set a l2establish timer.\n"); } +//#warning debugging usleep crash +// printf("JOLLY release port %d\n", mISDNport->portnum); + usleep(1); break; case CC_SETUP | INDICATION: @@ -3128,11 +3188,28 @@ int stack2manager_nt(void *dat, void *arg) PERROR("unhandled message from stack: call ref released (l3id=0x%x)\n", hh->dinfo); break; - case CC_DISCONNECT | INDICATION: + case CC_RELEASE_COMPLETE | INDICATION: + break; + + case CC_FACILITY | INDICATION: + break; - // fall throug default: PERROR("unhandled message: prim(0x%x) dinfo(0x%x) msg->len(%d)\n", hh->prim, hh->dinfo, msg->len); + port = port_first; + while(port) + { + if (port->p_type == PORT_TYPE_DSS1_NT_IN || port->p_type == PORT_TYPE_DSS1_NT_OUT) + { + pdss1 = (class Pdss1 *)port; + //PDEBUG(DEBUG_ISDN, "comparing dinfo = 0x%x with l3id 0x%x\n", hh->dinfo, pdss1->p_m_d_l3id); + /* check out correct stack */ + if (pdss1->p_m_mISDNport == mISDNport) + /* check out correct id */ + PERROR("unhandled message: dinfo=%x is not associated with port-dinfo=%x\n",hh->dinfo,pdss1->p_m_d_l3id); + } + port = port->next; + } return(-EINVAL); } free_msg(msg);