+ {
+#ifdef WITH_MISDN
+ struct mISDNport *mISDNport;
+ char *ifname = interface_out->name;
+ int channel = 0;
+ struct admin_list *admin;
+ int earlyb;
+ int mode = B_MODE_TRANSPARENT;
+
+ /* hunt for mISDNport and create Port */
+ mISDNport = hunt_port(ifname, &channel);
+ if (!mISDNport) {
+ trace_header("INTERFACE (busy)", DIRECTION_NONE);
+ add_trace("interface", NULL, "%s", ifname);
+ end_trace();
+ cause = 33;
+ goto fail;
+ }
+
+ SPRINT(portname, "%s-%d-out", mISDNport->ifport->interface->name, mISDNport->portnum);
+#ifdef WITH_SS5
+ if (mISDNport->ss5)
+ port = ss5_hunt_line(mISDNport);
+ else
+#endif
+ if (mISDNport->ifport->remote) {
+ admin = admin_first;
+ while(admin) {
+ if (admin->remote_name[0] && !strcmp(admin->remote_name, mISDNport->ifport->remote_app))
+ break;
+ admin = admin->next;
+ }
+ if (!admin) {
+ trace_header("INTERFACE (remote not connected)", DIRECTION_NONE);
+ add_trace("application", NULL, "%s", mISDNport->ifport->remote_app);
+ end_trace();
+ cause = 27;
+ goto fail;
+ }
+ port = new Premote(PORT_TYPE_REMOTE_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode, admin->sock);
+ } else
+ port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
+ earlyb = mISDNport->earlyb;
+#else
+ trace_header("INTERFACE (has no function)", DIRECTION_NONE);
+ add_trace("interface", NULL, "%s", ifname);
+ end_trace();
+ cause = 31;
+ goto fail
+#endif
+ }