X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=socket_server.c;h=e84fa5ea0ede812b30de2eff1bc71640f7b23a18;hp=30830853320aa7f0e61dc76fab06782b5bd7a6a4;hb=5f685ed847af5a80f647383d0c450b67acce17a4;hpb=76c5d82d4cbdd9d75e6b6db9e51eb22d10fb44bd diff --git a/socket_server.c b/socket_server.c index 3083085..e84fa5e 100644 --- a/socket_server.c +++ b/socket_server.c @@ -13,6 +13,7 @@ #include #include #include +#include "config.h" char socket_name[128]; @@ -530,7 +531,7 @@ int admin_call(struct admin_list *admin, struct admin_message *msg) apppbx->e_dialinginfo.sending_complete = 1; apppbx->new_state(PORT_STATE_OUT_SETUP); - apppbx->out_setup(); + apppbx->out_setup(0); return(0); } @@ -538,7 +539,7 @@ int admin_call(struct admin_list *admin, struct admin_message *msg) /* * this function is called for response whenever a call state changes. */ -void admin_call_response(int adminid, int message, const char *connected, int cause, int location, int notify) +void admin_call_response(int adminid, int message, const char *connected, int cause, int location, int notify_progress) { struct admin_list *admin; struct admin_queue *response, **responsep; /* response pointer */ @@ -573,7 +574,7 @@ void admin_call_response(int adminid, int message, const char *connected, int ca SCPY(response->am[0].u.call.callerid, connected); response->am[0].u.call.cause = cause; response->am[0].u.call.location = location; - response->am[0].u.call.notify = notify; + response->am[0].u.call.notify_progress = notify_progress; /* attach to response chain */ *responsep = response; @@ -739,6 +740,7 @@ int admin_state(struct admin_queue **responsep) struct interface *interface; struct interface_port *ifport; struct mISDNport *mISDNport; + struct select_channel *selchannel; int i; int num; int anybusy; @@ -871,7 +873,40 @@ int admin_state(struct admin_queue **responsep) response->am[num].u.i.slip_rx = mISDNport->slip_rx; /* channels */ response->am[num].u.i.channels = mISDNport->b_num; - /* channel info */ + /* channel selection */ + selchannel = ifport->out_channel; + if (ifport->channel_force) + SCAT(response->am[num].u.i.out_channel, "force"); + while (selchannel) { + if (response->am[num].u.i.out_channel[0]) + SCAT(response->am[num].u.i.out_channel, ","); + switch (selchannel->channel) { + case CHANNEL_NO: + SCAT(response->am[num].u.i.out_channel, "no"); + break; + case CHANNEL_ANY: + SCAT(response->am[num].u.i.out_channel, "any"); + break; + case CHANNEL_FREE: + SCAT(response->am[num].u.i.out_channel, "free"); + break; + default: + SPRINT(strchr(response->am[num].u.i.out_channel, '\0'), "%d", selchannel->channel); + } + selchannel = selchannel->next; + } + selchannel = ifport->in_channel; + while (selchannel) { + switch (selchannel->channel) { + case CHANNEL_FREE: + SCAT(response->am[num].u.i.in_channel, "free"); + break; + default: + SPRINT(strchr(response->am[num].u.i.in_channel, '\0'), "%d", selchannel->channel); + } + selchannel = selchannel->next; + } + /* channel state */ i = 0; anybusy = 0; while(i < mISDNport->b_num) { @@ -1049,7 +1084,7 @@ int admin_state(struct admin_queue **responsep) response->am[num].u.p.state = ADMIN_STATE_IDLE; } /* isdn */ - if ((port->p_type&PORT_CLASS_mISDN_MASK) == PORT_CLASS_mISDN_DSS1) { + if ((port->p_type & PORT_CLASS_mISDN_MASK) == PORT_CLASS_DSS1) { response->am[num].u.p.isdn = 1; pdss1 = (class Pdss1 *)port; response->am[num].u.p.isdn_chan = pdss1->p_m_b_channel;