- if (!epointlist)
- epointlist_new(epoint_id);
-
- /* creating l3id */
- l1l2l3_trace_header(p_m_mISDNport, this, L3_NEW_L3ID_REQ, DIRECTION_OUT);
- p_m_g_callref = new_callref++;
- add_trace("callref", "new", "0x%x", p_m_g_callref);
- end_trace();
-
- gsm_trace_header(p_m_mISDNport, this, MNCC_SETUP_REQ, DIRECTION_OUT);
- mncc = create_mncc(MNCC_SETUP_REQ, p_m_g_callref);
- /* caller information */
- mncc->fields |= MNCC_F_CALLING;
- mncc->calling.plan = 1;
- switch (p_callerinfo.ntype) {
- case INFO_NTYPE_UNKNOWN:
- mncc->calling.type = 0x0;
- break;
- case INFO_NTYPE_INTERNATIONAL:
- mncc->calling.type = 0x1;
- break;
- case INFO_NTYPE_NATIONAL:
- mncc->calling.type = 0x2;
- break;
- case INFO_NTYPE_SUBSCRIBER:
- mncc->calling.type = 0x4;
- break;
- default: /* INFO_NTYPE_NOTPRESENT */
- mncc->fields &= ~MNCC_F_CALLING;
- break;
- }
- switch (p_callerinfo.screen) {
- case INFO_SCREEN_USER:
- mncc->calling.screen = 0;
- break;
- default: /* INFO_SCREEN_NETWORK */
- mncc->calling.screen = 3;
- break;
- }
- switch (p_callerinfo.present) {
- case INFO_PRESENT_ALLOWED:
- mncc->calling.present = 0;
- break;
- case INFO_PRESENT_RESTRICTED:
- mncc->calling.present = 1;
- break;
- default: /* INFO_PRESENT_NOTAVAIL */
- mncc->calling.present = 2;
- break;
- }
- if (mncc->fields & MNCC_F_CALLING) {
- SCPY(mncc->calling.number, p_callerinfo.id);
- add_trace("calling", "type", "%d", mncc->calling.type);
- add_trace("calling", "plan", "%d", mncc->calling.plan);
- add_trace("calling", "present", "%d", mncc->calling.present);
- add_trace("calling", "screen", "%d", mncc->calling.screen);
- add_trace("calling", "number", "%s", mncc->calling.number);
- }
- /* dialing information */
- 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);
- }
-
- /* sending user-user */
-
- /* redirecting number */
- mncc->fields |= MNCC_F_REDIRECTING;
- mncc->redirecting.plan = 1;
- switch (p_redirinfo.ntype) {
- case INFO_NTYPE_UNKNOWN:
- mncc->redirecting.type = 0x0;
- break;
- case INFO_NTYPE_INTERNATIONAL:
- mncc->redirecting.type = 0x1;
- break;
- case INFO_NTYPE_NATIONAL:
- mncc->redirecting.type = 0x2;
- break;
- case INFO_NTYPE_SUBSCRIBER:
- mncc->redirecting.type = 0x4;
- break;
- default: /* INFO_NTYPE_NOTPRESENT */
- mncc->fields &= ~MNCC_F_REDIRECTING;
- break;
- }
- switch (p_redirinfo.screen) {
- case INFO_SCREEN_USER:
- mncc->redirecting.screen = 0;
- break;
- default: /* INFO_SCREE_NETWORK */
- mncc->redirecting.screen = 3;
- break;
- }
- switch (p_redirinfo.present) {
- case INFO_PRESENT_ALLOWED:
- mncc->redirecting.present = 0;
- break;
- case INFO_PRESENT_RESTRICTED:
- mncc->redirecting.present = 1;
- break;
- default: /* INFO_PRESENT_NOTAVAIL */
- mncc->redirecting.present = 2;
- break;
- }
- /* sending redirecting number only in ntmode */
- if (mncc->fields & MNCC_F_REDIRECTING) {
- SCPY(mncc->redirecting.number, p_redirinfo.id);
- add_trace("redir", "type", "%d", mncc->redirecting.type);
- add_trace("redir", "plan", "%d", mncc->redirecting.plan);
- add_trace("redir", "present", "%d", mncc->redirecting.present);
- add_trace("redir", "screen", "%d", mncc->redirecting.screen);
- add_trace("redir", "number", "%s", mncc->redirecting.number);
- }
- /* bearer capability */
- //todo
-
- end_trace();
- send_and_free_mncc((struct gsm_network *)gsm->network, mncc->msg_type, mncc);
-
- new_state(PORT_STATE_OUT_SETUP);
-
- message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_PROCEEDING);
- message_put(message);
-
- new_state(PORT_STATE_OUT_PROCEEDING);