apppbx.o: apppbx.cpp *.h Makefile
$(PP) -c $(CFLAGS) apppbx.cpp -o apppbx.o
+callerid.o: callerid.c *.h Makefile
+ $(PP) -c $(CFLAGS) callerid.c -o callerid.o
+
join.o: join.cpp *.h Makefile
$(PP) -c $(CFLAGS) join.cpp -o join.o
endpoint.o \
endpointapp.o \
apppbx.o \
+ callerid.o \
crypt.o \
action.o \
action_vbox.o \
endpoint.o \
endpointapp.o \
apppbx.o \
+ callerid.o \
crypt.o \
action.o \
action_vbox.o \
** **
\*****************************************************************************/
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <poll.h>
#include "main.h"
-#include "linux/isdnif.h"
extern char **environ;
-/* create caller id from digits by comparing with national and international
- * prefixes.
- */
-char *nationalize_callerinfo(char *string, int *ntype)
-{
- if (!strncmp(options.international, string, strlen(options.international)))
- {
- *ntype = INFO_NTYPE_INTERNATIONAL;
- return(string+strlen(options.international));
- }
- if (!strncmp(options.national, string, strlen(options.national)))
- {
- *ntype = INFO_NTYPE_NATIONAL;
- return(string+strlen(options.national));
- }
- *ntype = INFO_NTYPE_SUBSCRIBER;
- return(string);
-}
-
-/* create number (including access codes) from caller id
- * prefixes.
- */
-char *numberrize_callerinfo(char *string, int ntype)
-{
- static char result[256];
-
- switch(ntype)
- {
- case INFO_NTYPE_INTERNATIONAL:
- UCPY(result, options.international);
- SCAT(result, string);
- return(result);
- break;
-
- case INFO_NTYPE_NATIONAL:
- UCPY(result, options.national);
- SCAT(result, string);
- return(result);
- break;
-
- default:
- return(string);
- }
-}
-
-
/*
* process init 'internal' / 'external' / 'remote' / 'vbox-record' / 'partyline'...
*/
struct caller_info callerinfo;
struct redir_info redirinfo;
struct dialing_info dialinginfo;
- char remote[32];
+ char exten[128] = "";
+ char remote[32];
if (!(rparam = routeparam(e_action, PARAM_APPLICATION)))
{
memcpy(&redirinfo, &e_redirinfo, sizeof(redirinfo));
memset(&dialinginfo, 0, sizeof(dialinginfo));
+ if ((rparam = routeparam(e_action, PARAM_EXTEN)))
+ {
+ SCPY(exten, rparam->string_value);
+ }
/* send setup to remote */
trace_header("ACTION remote (setup)", DIRECTION_NONE);
add_trace("number", NULL, dialinginfo.id);
add_trace("remote", NULL, remote);
+ if (exten[0])
+ add_trace("exten", NULL, remote);
end_trace();
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_SETUP);
memcpy(&message->param.setup.dialinginfo, &dialinginfo, sizeof(struct dialing_info));
memcpy(&message->param.setup.redirinfo, &redirinfo, sizeof(struct redir_info));
memcpy(&message->param.setup.callerinfo, &callerinfo, sizeof(struct caller_info));
memcpy(&message->param.setup.capainfo, &capainfo, sizeof(struct capa_info));
+ SCPY(message->param.setup.exten, exten);
message_put(message);
}
(!next)?e_ext.callerid_type:e_ext.id_next_call_type = INFO_NTYPE_UNKNOWN;
} else
{
- SCPY((!next)?e_ext.callerid:e_ext.id_next_call, nationalize_callerinfo(callerid,&((!next)?e_ext.callerid_type:e_ext.id_next_call_type)));
+ SCPY((!next)?e_ext.callerid:e_ext.id_next_call, nationalize_callerinfo(callerid,&((!next)?e_ext.callerid_type:e_ext.id_next_call_type), options.national, options.international));
}
if (!next) e_ext.id_next_call_type = -1;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d): nationalized callerid: '%s' type=%d\n", ea_endpoint->ep_serial, (!next)?e_ext.callerid:e_ext.id_next_call, (!next)?e_ext.callerid_type:e_ext.id_next_call_type);
trace_header("ACTION change-callerid (only next call)", DIRECTION_NONE);
else
trace_header("ACTION change-callerid (all future calls)", DIRECTION_NONE);
- add_trace("old", "caller id", "%s", numberrize_callerinfo(old_id, old_type));
+ add_trace("old", "caller id", "%s", numberrize_callerinfo(old_id, old_type, options.national, options.international));
add_trace("old", "present", "%s", (old_present==INFO_PRESENT_RESTRICTED)?"restricted":"allowed");
- add_trace("new", "caller id", "%s", numberrize_callerinfo(new_id, new_type));
+ add_trace("new", "caller id", "%s", numberrize_callerinfo(new_id, new_type, options.national, options.international));
add_trace("new", "present", "%s", (new_present==INFO_PRESENT_RESTRICTED)?"restricted":"allowed");
end_trace();
message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "");
argv[i++] = rparam->string_value;
}
argv[i++] = e_extdialing;
- argv[i++] = numberrize_callerinfo(e_callerinfo.id, e_callerinfo.ntype);
+ argv[i++] = numberrize_callerinfo(e_callerinfo.id, e_callerinfo.ntype, options.national, options.international);
argv[i++] = e_callerinfo.extension;
argv[i++] = e_callerinfo.name;
SPRINT(isdn_port, "%d", e_callerinfo.isdn_port);
}
if (e_callerinfo.id[0])
- SPRINT(callertext, "%s", numberrize_callerinfo(e_callerinfo.id, e_callerinfo.ntype));
+ SPRINT(callertext, "%s", numberrize_callerinfo(e_callerinfo.id, e_callerinfo.ntype, options.national, options.international));
else
SPRINT(callertext, "unknown");
/* allpy restriction */
if (e_callerinfo.extension[0])
SPRINT(callertext, "intern:%s", e_callerinfo.extension);
else
- SPRINT(callertext, "extern:%s", numberrize_callerinfo(e_callerinfo.id, e_callerinfo.ntype));
+ SPRINT(callertext, "extern:%s", numberrize_callerinfo(e_callerinfo.id, e_callerinfo.ntype, options.national, options.international));
if (!!strcmp(callertext, e_ext.last_in[0]))
{
i = MAX_REMEMBER-1;
** **
\*****************************************************************************/
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
#include "main.h"
enum {
e_efi_digit = 0;
// fall through
case EFI_STATE_DIGIT:
- digit[8] = numberrize_callerinfo(e_callerinfo.id,e_callerinfo.ntype)[e_efi_digit];
+ digit[8] = numberrize_callerinfo(e_callerinfo.id,e_callerinfo.ntype, options.national, options.international)[e_efi_digit];
if (digit[8])
{
set_tone_efi(digit);
** **
\*****************************************************************************/
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
#include "main.h"
\*****************************************************************************/
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <poll.h>
#include "main.h"
class EndpointAppPBX *apppbx_first = NULL;
/* init trace with given values */
start_trace(0,
NULL,
- numberrize_callerinfo(e_callerinfo.id, e_callerinfo.ntype),
+ numberrize_callerinfo(e_callerinfo.id, e_callerinfo.ntype, options.national, options.international),
e_dialinginfo.id,
direction,
CATEGORY_EP,
} else
{
/* numberrize caller id and use it to dial to the callback */
- SCPY(e_dialinginfo.id, numberrize_callerinfo(e_callerinfo.id,e_callerinfo.ntype));
+ SCPY(e_dialinginfo.id, numberrize_callerinfo(e_callerinfo.id,e_callerinfo.ntype, options.national, options.international));
}
e_dialinginfo.itype = INFO_ITYPE_ISDN;
e_dialinginfo.ntype = INFO_NTYPE_UNKNOWN;
static char display[81];
display[0] = '\0';
- char *cid = numberrize_callerinfo(id, ntype);
+ char *cid = numberrize_callerinfo(id, ntype, options.national, options.international);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) id='%s' itype=%d ntype=%d present=%d screen=%d extension='%s' name='%s'\n", ea_endpoint->ep_serial, (id)?id:"NULL", itype, ntype, present, screen, (extension)?extension:"NULL", (name)?name:"NULL");
if (message->param.setup.callerinfo.id[0] && e_ext.clip_prefix[0])
{
SCPY(message->param.setup.callerinfo.id, e_ext.clip_prefix);
- SCAT(message->param.setup.callerinfo.id, numberrize_callerinfo(e_callerinfo.id,e_callerinfo.ntype));
+ SCAT(message->param.setup.callerinfo.id, numberrize_callerinfo(e_callerinfo.id,e_callerinfo.ntype, options.national, options.international));
message->param.setup.callerinfo.ntype = INFO_NTYPE_UNKNOWN;
}
/* use internal caller id */
logmessage(message_type, param, portlist->port_id, DIRECTION_IN);
/* signal to call tool */
- admin_call_response(e_adminid, ADMIN_CALL_CONNECT, numberrize_callerinfo(param->connectinfo.id,param->connectinfo.ntype), 0, 0, 0);
+ admin_call_response(e_adminid, ADMIN_CALL_CONNECT, numberrize_callerinfo(param->connectinfo.id,param->connectinfo.ntype, options.national, options.international), 0, 0, 0);
memcpy(&e_connectinfo, ¶m->connectinfo, sizeof(e_connectinfo));
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) removing all other ports (start)\n", ea_endpoint->ep_serial);
port = find_port_id(portlist->port_id);
if (port)
{
- SCPY(e_connectinfo.id, nationalize_callerinfo(port->p_dialinginfo.id, &e_connectinfo.ntype));
+ SCPY(e_connectinfo.id, nationalize_callerinfo(port->p_dialinginfo.id, &e_connectinfo.ntype, options.national, options.international));
e_connectinfo.present = INFO_PRESENT_ALLOWED;
}
}
char buffer[64];
/* signal to call tool */
- admin_call_response(e_adminid, ADMIN_CALL_NOTIFY, numberrize_callerinfo(param->notifyinfo.id,param->notifyinfo.ntype), 0, 0, param->notifyinfo.notify);
+ admin_call_response(e_adminid, ADMIN_CALL_NOTIFY, numberrize_callerinfo(param->notifyinfo.id,param->notifyinfo.ntype, options.national, options.international), 0, 0, param->notifyinfo.notify);
if (param->notifyinfo.notify)
{
e_rx_state = track_notify(e_rx_state, param->notifyinfo.notify);
if (e_ext.number[0] && message->param.connectinfo.id[0] && e_ext.clip_prefix[0])
{
SCPY(message->param.connectinfo.id, e_ext.clip_prefix);
- SCAT(message->param.connectinfo.id, numberrize_callerinfo(e_connectinfo.id,e_connectinfo.ntype));
+ SCAT(message->param.connectinfo.id, numberrize_callerinfo(e_connectinfo.id,e_connectinfo.ntype, options.national, options.international));
message->param.connectinfo.ntype = INFO_NTYPE_UNKNOWN;
}
join_mISDNsignal(portlist, message_type, param);
break;
-was ist hiermit
+#warning was ist hiermit
#if 0
/* JOIN requests bchannel */
case MESSAGE_BCHANNEL: /* indicates the need of own bchannel access */
add_trace("from", NULL, "CH(%lu)", port_id);
if (param->setup.callerinfo.extension[0])
add_trace("extension", NULL, "%s", param->setup.callerinfo.extension);
- add_trace("caller id", "number", "%s", numberrize_callerinfo(param->setup.callerinfo.id, param->setup.callerinfo.ntype));
+ add_trace("caller id", "number", "%s", numberrize_callerinfo(param->setup.callerinfo.id, param->setup.callerinfo.ntype, options.national, options.international));
switch(param->setup.callerinfo.present)
{
case INFO_PRESENT_RESTRICTED:
}
if (param->setup.redirinfo.id[0])
{
- add_trace("redir'ing", "number", "%s", numberrize_callerinfo(param->setup.redirinfo.id, param->setup.redirinfo.ntype));
+ add_trace("redir'ing", "number", "%s", numberrize_callerinfo(param->setup.redirinfo.id, param->setup.redirinfo.ntype, options.national, options.international));
switch(param->setup.redirinfo.present)
{
case INFO_PRESENT_RESTRICTED:
add_trace("from", NULL, "CH(%lu)", port_id);
if (param->connectinfo.extension[0])
add_trace("extension", NULL, "%s", param->connectinfo.extension);
- add_trace("connect id", "number", "%s", numberrize_callerinfo(param->connectinfo.id, param->connectinfo.ntype));
+ add_trace("connect id", "number", "%s", numberrize_callerinfo(param->connectinfo.id, param->connectinfo.ntype, options.national, options.international));
switch(param->connectinfo.present)
{
case INFO_PRESENT_RESTRICTED:
add_trace("indicator", NULL, "%s", logtext);
if (param->notifyinfo.id[0])
{
- add_trace("redir'on", "number", "%s", numberrize_callerinfo(param->notifyinfo.id, param->notifyinfo.ntype));
+ add_trace("redir'on", "number", "%s", numberrize_callerinfo(param->notifyinfo.id, param->notifyinfo.ntype, options.national, options.international));
switch(param->notifyinfo.present)
{
case INFO_PRESENT_RESTRICTED:
};
-char *nationalize_callerinfo(char *string, int *type);
-char *numberrize_callerinfo(char *string, int type);
void apply_callerid_restriction(struct extension *ext, char *id, int *ntype, int *present, int *screen, char *extension, char *name);
void send_mail(char *filename, char *callerid, char *callerintern, char *callername, char *vbox_email, int vbox_year, int vbox_mon, int vbox_mday, int vbox_hour, int vbox_min, char *terminal);
};
#ifdef SOCKET_MISDN
-int bchannel_socket = -1;
int bchannel_initialize(void)
{
- /* try to open raw socket to check kernel */
- bchannel_socket = socket(PF_ISDN, SOCK_RAW, ISDN_P_BASE);
- if (bchannel_socket < 0)
- {
- PERROR("Cannot open mISDN due to %s. (Does your Kernel support socket based mISDN?)\n", strerror(errno));
- return(-1);
- }
-
- mISDN_debug_init(global_debug, NULL, NULL, NULL);
-
- bchannel_pid = get_pid();
-
- /* init mlayer3 */
- init_layer3(4); // buffer of 4
-
return(0);
}
void bchannel_deinitialize(void)
{
- cleanup_layer3();
-
- mISDN_debug_close();
-
- if (bchannel_socket > -1)
- close(bchannel_socket);
}
#else
int bchannel_entity = 0; /* used for udevice */
#else
if (channel->b_stid)
#endif
- bchannel_destroy(channel);
+ bchannel_destroy(channel);
+ if (channel->call)
+ {
+ if (channel->call->channel)
+ channel->call->channel = NULL;
+ }
+ if (channel->bridge_channel)
+ {
+ if (channel->bridge_channel->bridge_channel)
+ channel->bridge_channel->bridge_channel = NULL;
+ }
free(channel);
return;
}
struct bchannel {
struct bchannel *next;
- unsigned long ref; /* ref for link to call process */
+ struct chan_call *call; /* ink to call process */
unsigned long handle; /* handle for stack id */
#ifdef SOCKET_MISDN
int b_sock; /* socket for b-channel */
unsigned long b_stid; /* stack id */
unsigned long b_addr; /* channel address */
#endif
+ unsigned short bridge_id; /* bridge id */
+ struct bchannel *bridge_channel;
+ /* remote channel */
int b_state;
int b_txdata;
int b_delay;
--- /dev/null
+/*****************************************************************************\
+** **
+** PBX4Linux **
+** **
+**---------------------------------------------------------------------------**
+** Copyright: Andreas Eversberg **
+** **
+** caller id support file **
+** **
+\*****************************************************************************/
+
+#include "main.h"
+
+/* create caller id from digits by comparing with national and international
+ * prefixes.
+ */
+char *nationalize_callerinfo(char *string, int *ntype, char *national, char *international)
+{
+ if (!strncmp(options.international, string, strlen(options.international)))
+ {
+ *ntype = INFO_NTYPE_INTERNATIONAL;
+ return(string+strlen(international));
+ }
+ if (!strncmp(options.national, string, strlen(options.national)))
+ {
+ *ntype = INFO_NTYPE_NATIONAL;
+ return(string+strlen(national));
+ }
+ *ntype = INFO_NTYPE_SUBSCRIBER;
+ return(string);
+}
+
+/* create number (including access codes) from caller id
+ * prefixes.
+ */
+char *numberrize_callerinfo(char *string, int ntype, char *national, char *international)
+{
+ static char result[256];
+
+ switch(ntype)
+ {
+ case INFO_NTYPE_INTERNATIONAL:
+ UCPY(result, international);
+ SCAT(result, string);
+ return(result);
+ break;
+
+ case INFO_NTYPE_NATIONAL:
+ UCPY(result, national);
+ SCAT(result, string);
+ return(result);
+ break;
+
+ default:
+ return(string);
+ }
+}
+
+
+
--- /dev/null
+/*****************************************************************************\
+** **
+** Linux Call Router **
+** **
+**---------------------------------------------------------------------------**
+** Copyright: Andreas Eversberg **
+** **
+** callerid header file **
+** **
+\*****************************************************************************/
+
+char *nationalize_callerinfo(char *string, int *type, char *national, char *international);
+char *numberrize_callerinfo(char *string, int type, char *national, char *international);
+
*/
-locking asterisk process and handler
+todo (before first compile)
reconnect after socket closed, release all calls.
debug of call handling
-denke an alle info-elements in jeder message (from asterisk & from lcr)
ausloesen beim socket-verlust
-bei "ast_channel_alloc" kannste die Callerid und den type usw. setzten.
-da kannste auch die calledPartyNum setzen. Um asterisk ein Setup zu schicken rufst du einfach "ast_pbx_start( channel ) " auf. Die ganzen queue baren indications und Controls findest du in "include/asterisk/frame.h"
-
-Also zusammenfassend:
-
-Messages die zum Asterisk gehen:
-
-SETUP - > ast_pbx_start(ast)
- CONNECT -> ast_queue_control(ast,
- AST_CONTROL_ANSWER);
-PROCEEDING -> ast_queue_control(ast,
- AST_CONTROL_PROCEEDING);
-ALERTING -> ast_queue_control(ast,
- AST_CONTROL_RINGING);
-DISCONNECT -> ast_queue_hangup(ast);
-
-Messages die vom Asterisk kommen:
-
-lcr_request -> NEWREF
-lcr_call -> SETUP
-lcr_answer -> CONNECT
-lcr_hangup -> RELEASE_(complete)
- lcr_indicate(AST_CONTROL_RINGING) -> ALERTING
- lcr_indicate(AST_CONTROL_PROCEEDING) -> PROCEEDING
- lcr_indicate(AST_CONTROL_PROGRESS) -> PROGRESS
- lcr_indicate(AST_CONTROL_BUSY) -> DISCONNECT ( cause=17 )
-
-
-
-
-
-
-
-
#include <stdio.h>
#include <stdlib.h>
if (*temp == call)
{
*temp = (*temp)->next;
+ if (call->bch)
+ {
+ if (call->bch->call)
+ call->bch->call = NULL;
+ }
free(call);
return;
}
}
/*
+ * in case of a bridge, the unsupported message can be forwarded directly
+ * to the remote call.
+ */
+static void bridge_message_if_bridged(struct chan_call *call, int message_type, union parameter *param)
+{
+ /* check bridge */
+ if (!call) return;
+ if (!call->channel) return;
+ if (!call->channel->bridge_channel) return;
+ if (!call->channel->bridge_channel->call) return;
+ if (!call->channel->bridge_channel->call->ref) return;
+ send_message(MESSAGE_RELEASE, call->channel->bridge_channel->call->ref, param);
+}
+
+/*
* incoming setup from LCR
*/
static void lcr_in_setup(struct chan_call *call, int message_type, union parameter *param)
}
/* set ast pointer */
call->ast = ast;
+ ast->tech_pvt = call;
+ ast->tech = &lcr_tech;
/* fill setup information */
-#warning todo: setup-info reinschreiben
+ if (param->setup.exten[0])
+ strdup(ast->exten, param->setup.exten);
+ if (param->setup.callerinfo.id[0])
+ strdup(ast->cid->cid_num, param->setup.callerinfo.id);
+ if (param->setup.callerinfo.name[0])
+ strdup(ast->cid->cid_name, param->setup.callerinfo.name);
+ if (param->setup.redirinfo.id[0])
+ strdup(ast->cid->cid_name, numberrize_callerinfo(param->setup.callerinfo.name, param->setup.callerinfo.ntype, configfile->prefix_nat, configfile->prefix_inter));
+ switch (param->setup.callerinfo.present)
+ {
+ case INFO_PRESENT_ALLOWED:
+ ast->cid->cid_pres = AST_PRESENT_ALLOWED;
+ break;
+ case INFO_PRESENT_RESTRICTED:
+ ast->cid->cid_pres = AST_PRESENT_RESTRICTED;
+ break;
+ default:
+ ast->cid->cid_pres = AST_PRESENT_UNAVAILABLE;
+ }
+ switch (param->setup.callerinfo.ntype)
+ {
+ case INFO_NTYPE_SUBSCRIBER:
+ ast->cid->cid_ton = AST_wasnu;
+ break;
+ case INFO_NTYPE_NATIONAL:
+ ast->cid->cid_ton = AST_wasnu;
+ break;
+ case INFO_NTYPE_INTERNATIONAL:
+ ast->cid->cid_ton = AST_wasnu;
+ break;
+ default:
+ ast->cid->cid_ton = AST_wasnu;
+ }
+ ast->transfercapability = param->setup.bearerinfo.capability;
+
+ /* configure channel */
+ ast->state = AST_STATE_RESERVED;
+ snprintf(ast->name, sizeof(ast->name), "%s/%d", lcr_type, ++glob_channel);
+ ast->name[sizeof(ast->name)-1] = '\0';
+ ast->type = lcr_type;
+ ast->nativeformat = configfile->lawformat;
+ ast->readformat = ast->rawreadformat = configfile->lawformat;
+ ast->writeformat = ast->rawwriteformat = configfile->lawformat;
+ ast->hangupcause = 0;
+
+ /* change state */
+ call->state = CHAN_LCR_STATE_IN_SETUP;
/* send setup to asterisk */
-#warning todo: setup bei der asterisk triggern
+ ast_pbx_start(ast);
+
+ /* send setup acknowledge to lcr */
+ memset(&newparam, 0, sizeof(union parameter));
+ send_message(MESSAGE_OVERLAP, call->ref, &newparam);
/* change state */
- call->state = CHAN_LCR_STATE_IN_SETUP;
+ call->state = CHAN_LCR_STATE_IN_DIALING;
}
/*
*/
static void lcr_in_overlap(struct chan_call *call, int message_type, union parameter *param)
{
+ if (!call->ast) return;
+
/* send pending digits in dialque */
if (call->dialque)
- send_dialing_to_lcr(call);
+ send_dialque_to_lcr(call);
/* change to overlap state */
call->state = CHAN_LCR_STATE_OUT_DIALING;
}
/* change state */
call->state = CHAN_LCR_STATE_OUT_PROCEEDING;
/* send event to asterisk */
- ast_queue_... todo
+ if (call->ast)
+ ast_queue_control(ast, AST_CONTROL_PROCEEDING);
}
/*
/* change state */
call->state = CHAN_LCR_STATE_OUT_ALERTING;
/* send event to asterisk */
- ast_queue_... todo
+ if (call->ast)
+ ast_queue_control(ast, AST_CONTROL_RINGING);
}
/*
/* change state */
call->state = CHAN_LCR_STATE_CONNECT;
/* copy connectinfo */
- todo
+ memcpy(call->connectinfo, param->connectinfo, sizeof(struct connect_info));
/* send event to asterisk */
- ast_queue_... todo
+ if (call->ast)
+ ast_queue_control(ast, AST_CONTROL_ANSWER);
}
/*
*/
static void lcr_in_disconnect(struct chan_call *call, int message_type, union parameter *param)
{
+ union parameter newparam;
+
/* change state */
call->state = CHAN_LCR_STATE_IN_DISCONNECT;
- /* copy disconnect info */
- todo
- /* send event to asterisk */
- ast_queue_... todo
+ /* save cause */
+ call->cause = param.disconnectinfo.cause;
+ call->location = param.disconnectinfo.location;
+ /* if bridge, forward disconnect and return */
+ if (call->channel)
+ if (call->channel->bridge_channel)
+ if (call->channel->bridge_channel->call)
+ {
+ bridge_message_if_bridged(call, message_type, param);
+ return;
+ }
+ /* release lcr */
+ newparam.disconnectinfo.cause = CAUSE_NORMAL;
+ newparam.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
+ send_message(MESSAGE_RELEASE, ref, &newparam);
+ ref = 0;
+ /* release asterisk */
+ call->ast->hangupcause = call->cause;
+ ast_queue_hangup(call->ast);
+ /* change to release state */
+ call->state = CHAN_LCR_STATE_RELEASE;
}
/*
/* change to release state */
call->state = CHAN_LCR_STATE_RELEASE;
/* copy release info */
- todo
+ if (!call->cause)
+ call->cause = param.disconnectinfo.cause;
/* if we have an asterisk instance, send hangup, else we are done */
if (call->ast)
{
+ call->ast->hangupcause = call->cause;
ast_queue_hangup(call->ast);
} else
{
*/
static void lcr_in_information(struct chan_call *call, int message_type, union parameter *param)
{
+ struct ast_frame fr;
+ char *p;
+
+ if (!call->ast) return;
+
/* copy digits */
- todo and write them, maybe queue them for asterisk
- /* send event to asterisk */
- ast_queue_... todo
+ p = param->dialinginfo.id;
+ if (call->state == CHAN_LCR_STATE_IN_DIALING && *p)
+ {
+ while (*p)
+ {
+ /* send digit to asterisk */
+ memset(&fr, 0, sizeof(fr));
+ fr.frametype = AST_FRAME_DTMF;
+ fr.subclass = *p;
+ fr.delivery = ast_tv(0, 0);
+ ast_queue_frame(call->ast, &fr);
+ p++;
+ }
+ }
+ /* use bridge to forware message not supported by asterisk */
+ if (call->state == CHAN_LCR_STATE_CONNECT)
+ bridge_message_if_bridged(call, message_type, param);
+}
+
+/*
+ * incoming information from LCR
+ */
+static void lcr_in_notify(struct chan_call *call, int message_type, union parameter *param)
+{
+ if (!call->ast) return;
+
+ /* use bridge to forware message not supported by asterisk */
+ bridge_message_if_bridged(call, message_type, param);
}
/*
*/
static void lcr_in_facility(struct chan_call *call, int message_type, union parameter *param)
{
- /* copy progress info */
- todo and write them, maybe queue them for asterisk
- /* send event to asterisk */
- ast_queue_... todo
- or maybe use bride info to forward facility.
+ if (!call->ast) return;
+
+ /* use bridge to forware message not supported by asterisk */
+ bridge_message_if_bridged(call, message_type, param);
}
/*
lcr_in_disconnect(call, message_type, param);
break;
+ case MESSAGE_NOTIFY:
+ lcr_in_notify(call, message_type, param);
+ break;
+
case MESSAGE_FACILITY:
- lcr_in_disconnect(call, message_type, param);
+ lcr_in_facility(call, message_type, param);
break;
case MESSAGE_PATTERN:
*/
static void send_setup_to_lcr(struct chan_call *call)
{
+ union parameter newparam;
+
if (!ast || !call->ref)
return;
/* send setup message to LCR */
memset(&newparam, 0, sizeof(union parameter));
- newparam.setup.xxxxxx =
+ newparam.setup.callerinfo.itype = INFO_ITYPE_CHAN;
+ newparam.setup.callerinfo.ntype = INFO_NTYPE_UNKNOWN;
+ if (ast->cid->cid_num) if (ast->cid->cid_num[0])
+ strncpy(newparam.setup.callerinfo.id, ast->cid->cid_num, sizeof(newparam.setup.callerinfo.id)-1);
+ if (ast->cid->cid_name) if (ast->cid->cid_name[0])
+ strncpy(newparam.setup.callerinfo.name, ast->cid->cid_name, sizeof(newparam.setup.callerinfo.name)-1);
+ if (ast->cid->cid_rdnis) if (ast->cid->cid_rdnis[0])
+ {
+ strncpy(newparam.setup.redirinfo.id, ast->cid->cid_rdnis, sizeof(newparam.setup.redirinfo.id)-1);
+ newparam.setup.redirinfo.itype = INFO_ITYPE_CHAN;
+ newparam.setup.redirinfo.ntype = INFO_NTYPE_UNKNOWN;
+ }
+ switch(ast->cid->cid_pres & AST_PRES_RESTRICTION)
+ {
+ case AST_PRES_ALLOWED:
+ newparam.setup.callerinfo.present = INFO_PRESENT_ALLOWED;
+ break;
+ case AST_PRES_RESTRICTED:
+ newparam.setup.callerinfo.present = INFO_PRESENT_RESTRICTED;
+ break;
+ case AST_PRES_UNAVAILABLE:
+ newparam.setup.callerinfo.present = INFO_PRESENT_NOTAVAIL;
+ break;
+ default:
+ newparam.setup.callerinfo.present = INFO_PRESENT_NULL;
+ }
+ switch(ast->cid->cid_ton)
+ {
+ case AST_wasist:
+ newparam.setup.callerinfo.ntype = INFO_NTYPE_SUBSCRIBER;
+ break;
+ case AST_wasist:
+ newparam.setup.callerinfo.ntype = INFO_NTYPE_NATIONAL;
+ break;
+ case AST_wasist:
+ newparam.setup.callerinfo.ntype = INFO_NTYPE_INTERNATIONAL;
+ break;
+ }
+ newparam.setup.capainfo.bearer_capa = ast->transfercapability;
+ newparam.setup.capainfo.bearer_user = alaw 3, ulaw 2;
+ newparam.setup.capainfo.bearer_mode = INFO_BMODE_CIRCUIT;
+ newparam.setup.capainfo.hlc = INFO_HLC_NONE;
+ newparam.setup.capainfo.exthlc = INFO_HLC_NONE;
send_message(MESSAGE_SETUP, call->ref, &newparam);
+
/* change to outgoing setup state */
call->state = CHAN_LCR_STATE_OUT_SETUP;
}
* this function is called, when setup acknowledge is received and dialing
* info is available.
*/
-static void send_dialing_to_lcr(struct chan_call *call)
+static void send_dialque_to_lcr(struct chan_call *call)
{
+ union parameter newparam;
+
if (!ast || !call->ref || !call->dialque)
return;
*/
static struct ast_channel *lcr_request(const char *type, int format, void *data, int *cause)
{
+ union parameter newparam;
+
pthread_mutex_lock(&chan_lock);
/* create call instance */
/* link together */
ast->tech_pvt = call;
call->ast = ast;
+ ast->tech = &lcr_tech;
+ /* configure channel */
+ ast->state = AST_STATE_RESERVED;
+ snprintf(ast->name, sizeof(ast->name), "%s/%d", lcr_type, ++glob_channel);
+ ast->name[sizeof(ast->name)-1] = '\0';
+ ast->type = lcr_type;
+ ast->nativeformat = configfile->lawformat;
+ ast->readformat = ast->rawreadformat = configfile->lawformat;
+ ast->writeformat = ast->rawwriteformat = configfile->lawformat;
+ ast->hangupcause = 0;
/* send MESSAGE_NEWREF */
memset(&newparam, 0, sizeof(union parameter));
newparam.direction = 0; /* request from app */
*/
static int lcr_call(struct ast_channel *ast, char *dest, int timeout)
{
+ union parameter newparam;
struct chan_call *call=ast->tech_pvt;
char buf[128];
char *port_str, *dad, *p;
static int lcr_digit(struct ast_channel *ast, char digit)
{
+ union parameter newparam;
char buf[]="x";
if (!call) return -1;
/* send information or queue them */
if (call->ref && call->state == CHAN_LCR_STATE_OUT_DIALING)
{
- send_dialing_to_lcr(call);
+ memset(&newparam, 0, sizeof(union parameter));
+ newparam.dialinginfo.id[0] = digit;
+ newparam.dialinginfo.id[1] = '\0';
+ send_message(MESSAGE_INFORMATION, call->ref, &newparam);
} else
if (!call->ref
&& (call->state == CHAN_LCR_STATE_OUT_PREPARE || call->state == CHAN_LCR_STATE_OUT_SETUP));
{
*buf = digit;
strncat(call->dialque, buf, strlen(char->dialque)-1);
- } else
- {
-digits kommen, koennen aber nicht verwendet werden.
- sollen wir sie als info senden (im connect zb.)
}
pthread_mutex_unlock(&chan_lock);
static int lcr_answer(struct ast_channel *c)
{
+ union parameter newparam;
struct chan_call *call=c->tech_pvt;
+
if (!call) return -1;
+
pthread_mutex_lock(&chan_lock);
- pthread_mutex_unlock(&chan_lock);
+
+ /* check bridged connectinfo */
+ if (call->bchannel)
+ if (call->bchannel->bridge_channel)
+ if (call->bchannel->bridge_channel->call)
+ {
+ memcpy(call->connectinfo, call->bchannel->bridge_channel->call->connectinfo, sizeof(struct connect_info));
+ }
+ /* send connect message to lcr */
+ memset(&newparam, 0, sizeof(union parameter));
+ memcpy(param->connectinfo, call->connectinfo, sizeof(struct connect_info));
+ send_message(MESSAGE_CONNECT, call->ref, &newparam);
+ /* change state */
+ call->state = CHAN_LCR_STATE_CONNECT;
+
+ pthread_mutex_unlock(&chan_lock);
return 0;
}
static int lcr_hangup(struct ast_channel *ast)
{
+ union parameter newparam;
struct chan_call *call = ast->tech_pvt;
if (!call)
return 0;
}
-static int lcr_write(struct ast_channel *c, struct ast_frame *f)
+static int lcr_write(struct ast_channel *ast, struct ast_frame *f)
{
- struct chan_call *call= c->tech_pvt;
+ struct chan_call *call= ast->tech_pvt;
if (!call) return 0;
pthread_mutex_lock(&chan_lock);
pthread_mutex_unlock(&chan_lock);
}
-static struct ast_frame *lcr_read(struct ast_channel *c)
+static struct ast_frame *lcr_read(struct ast_channel *ast)
{
- struct chan_call *call = c->tech_pvt;
+ struct chan_call *call = ast->tech_pvt;
if (!call) return 0;
pthread_mutex_lock(&chan_lock);
pthread_mutex_unlock(&chan_lock);
}
-static int lcr_indicate(struct ast_channel *c, int cond, const void *data, size_t datalen)
+static int lcr_indicate(struct ast_channel *ast, int cond, const void *data, size_t datalen)
{
+ union parameter newparam;
int res = -1;
+
if (!call) return -1;
pthread_mutex_lock(&chan_lock);
switch (cond) {
case AST_CONTROL_BUSY:
+ /* send message to lcr */
+ memset(&newparam, 0, sizeof(union parameter));
+ newparam.disconnectinfo.cause = 17;
+ newparam.disconnectinfo.location = 5;
+ send_message(MESSAGE_DISCONNECT, call->ref, &newparam);
+ /* change state */
+ call->state = CHAN_LCR_STATE_OUT_DISCONNECT;
+ /* return */
+ pthread_mutex_unlock(&chan_lock);
+ return 0;
case AST_CONTROL_CONGESTION:
- case AST_CONTROL_RINGING:
+ /* return */
pthread_mutex_unlock(&chan_lock);
return -1;
+ case AST_CONTROL_RINGING:
+ /* send message to lcr */
+ memset(&newparam, 0, sizeof(union parameter));
+ send_message(MESSAGE_ALERTING, call->ref, &newparam);
+ /* change state */
+ call->state = CHAN_LCR_STATE_OUT_ALERTING;
+ /* return */
+ pthread_mutex_unlock(&chan_lock);
+ return 0;
case -1:
+ /* return */
pthread_mutex_unlock(&chan_lock);
return 0;
res = -1;
break;
case AST_CONTROL_HOLD:
- ast_verbose(" << Console Has Been Placed on Hold >> \n");
- //ast_moh_start(c, data, g->mohinterpret);
+ /* send message to lcr */
+ memset(&newparam, 0, sizeof(union parameter));
+ newparam.notifyinfo.notify = INFO_NOTIFY_REMOTE_HOLD;
+ send_message(MESSAGE_NOTIFY, call->ref, &newparam);
break;
case AST_CONTROL_UNHOLD:
- ast_verbose(" << Console Has Been Retrieved from Hold >> \n");
- //ast_moh_stop(c);
+ /* send message to lcr */
+ memset(&newparam, 0, sizeof(union parameter));
+ newparam.notifyinfo.notify = INFO_NOTIFY_REMOTE_RETRIEVAL;
+ send_message(MESSAGE_NOTIFY, call->ref, &newparam);
break;
default:
ast_log(LOG_WARNING, "Don't know how to display condition %d on %s\n", cond, c->name);
+ /* return */
pthread_mutex_unlock(&chan_lock);
return -1;
}
+ /* return */
pthread_mutex_unlock(&chan_lock);
return 0;
}
.requester=lcr_request,
.send_digit=lcr_digit,
.call=lcr_call,
-// .bridge=lcr_bridge,
+ .bridge=lcr_bridge,
.hangup=lcr_hangup,
.answer=lcr_answer,
.read=lcr_read,
#warning das muss mal aus der config datei gelesen werden:
char lcr_context[]="from-lcr";
+
+TODO: muss oben ins lcr_in setup und ins lcr_request
static struct ast_channel *lcr_ast_new(struct chan_call *call, char *exten, char *callerid, int ref)
{
struct ast_channel *tmp;
\*****************************************************************************/
/* structure for all calls */
+struct bchannel;
struct chan_call {
struct chan_call *next; /* link to next call instance */
int state; /* current call state CHAN_LCR_STATE */
unsigned long ref; /* callref for this channel */
struct ast_channel *ast; /* current asterisk channel */
- unsigned long bchannel_handle;
+ struct bchannel *channel;
/* reference to bchannel, if set */
- unsigned short bridge_id; /* 0 = off, equal ids are bridged */
-
- struct ast_channel *ast;
+ int cause, location;
};
enum {
*/
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
+#include "main.h"
#ifdef CRYPTO
#include <openssl/rsa.h>
#endif
-#include "main.h"
/* convert key string to binary key vector
errstr = "No Remote ID";
goto reject;
}
- ret = parse_secrets((char *)e_ext.number, (char *)numberrize_callerinfo(port->p_callerinfo.id, port->p_callerinfo.ntype), &auth_pointer, &crypt_pointer, &key_pointer);
+ ret = parse_secrets((char *)e_ext.number, (char *)numberrize_callerinfo(port->p_callerinfo.id, port->p_callerinfo.ntype, options.national, options.international), &auth_pointer, &crypt_pointer, &key_pointer);
}
if (!ret)
{
** **
\*****************************************************************************/
-#include <stdio.h>
#include "main.h"
unsigned long epoint_serial = 1; /* initial value must be 1, because 0== no epoint */
** **
\*****************************************************************************/
-
-#include <stdio.h>
#include "main.h"
/*
}
if (ifmsn)
{
- start_trace(0, interface, numberrize_callerinfo(id, *type), NULL, DIRECTION_IN, 0, 0, "SCREEN (found in MSN list)");
+ start_trace(0, interface, numberrize_callerinfo(id, *type, options.national, options.international), NULL, DIRECTION_IN, 0, 0, "SCREEN (found in MSN list)");
add_trace("msn", NULL, "%s", id);
end_trace();
}
if (!ifmsn && msn1) // not in list, first msn given
{
- start_trace(0, interface, numberrize_callerinfo(id, *type), NULL, DIRECTION_IN, 0, 0, "SCREEN (not found in MSN list)");
+ start_trace(0, interface, numberrize_callerinfo(id, *type, options.national, options.international), NULL, DIRECTION_IN, 0, 0, "SCREEN (not found in MSN list)");
add_trace("msn", "given", "%s", id);
add_trace("msn", "used", "%s", msn1);
end_trace();
}
if (ifscreen) // match
{
- start_trace(0, interface, numberrize_callerinfo(id, *type), NULL, out?DIRECTION_OUT:DIRECTION_IN, 0, 0, "SCREEN (found in screen list)");
+ start_trace(0, interface, numberrize_callerinfo(id, *type, options.national, options.international), NULL, out?DIRECTION_OUT:DIRECTION_IN, 0, 0, "SCREEN (found in screen list)");
switch(*type)
{
case INFO_NTYPE_UNKNOWN:
** **
\*****************************************************************************/
-#include <stdio.h>
-//#include <string.h>
-//#include <stdlib.h>
-//#include <unistd.h>
-//#include <poll.h>
-//#include <sys/types.h>
-//#include <sys/stat.h>
-//#include <fcntl.h>
#include "main.h"
//#define __u8 unsigned char
//#define __u16 unsigned short
//#define __u32 unsigned long
-//#include "linux/isdnif.h"
unsigned long join_serial = 1; /* must be 1, because 0== no join */
** **
\*****************************************************************************/
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <poll.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
#include "main.h"
-#define __u8 unsigned char
-#define __u16 unsigned short
-#define __u32 unsigned long
-#include "linux/isdnif.h"
+//#define __u8 unsigned char
+//#define __u16 unsigned short
+//#define __u32 unsigned long
/* notify endpoint about state change (if any) */
** **
\*****************************************************************************/
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-//#include <unistd.h>
-//#include <poll.h>
-//#include <sys/types.h>
-//#include <sys/stat.h>
-//#include <fcntl.h>
#include "main.h"
//#define __u8 unsigned char
//#define __u16 unsigned short
//#define __u32 unsigned long
-//#include "linux/isdnif.h"
/*
/* init trace with given values */
start_trace(mISDNport?mISDNport->portnum:0,
(mISDNport)?((mISDNport->ifport)?mISDNport->ifport->interface:NULL):NULL,
- port?numberrize_callerinfo(port->p_callerinfo.id, port->p_callerinfo.ntype):NULL,
+ port?numberrize_callerinfo(port->p_callerinfo.id, port->p_callerinfo.ntype, options.national, options.international):NULL,
port?port->p_dialinginfo.id:NULL,
direction,
CATEGORY_CH,
/* init trace with given values */
start_trace(mISDNport?mISDNport->portnum:0,
mISDNport?mISDNport->ifport->interface:NULL,
- port?numberrize_callerinfo(port->p_callerinfo.id, port->p_callerinfo.ntype):NULL,
+ port?numberrize_callerinfo(port->p_callerinfo.id, port->p_callerinfo.ntype, options.national, options.international):NULL,
port?port->p_dialinginfo.id:NULL,
direction,
CATEGORY_CH,
** **
\*****************************************************************************/
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/resource.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-//#include <poll.h>
#include "main.h"
static char *months[] = {
#include "endpoint.h"
#include "endpointapp.h"
#include "apppbx.h"
+#include "callerid.h"
#include "route.h"
#include "port.h"
#include "mISDN.h"
};
enum { /* number presentation */
- INFO_PRESENT_NULL,
+ INFO_PRESENT_NULL = 0,
INFO_PRESENT_ALLOWED,
INFO_PRESENT_RESTRICTED,
INFO_PRESENT_NOTAVAIL,
};
enum { /* redirection reason */
- INFO_REDIR_UNKNOWN,
+ INFO_REDIR_UNKNOWN = 0,
INFO_REDIR_BUSY,
INFO_REDIR_NORESPONSE,
INFO_REDIR_UNCONDITIONAL,
struct redir_info redirinfo; /* info on redirection (to the calling user) */
struct capa_info capainfo; /* info on l2,l3 capability */
struct useruser_info useruser; /* user-user */
+ char exten[128]; /* asterisk extension */
};
/* call-info structure PARK */
// apply_callerid_restriction(p_record_anon_ignore, callerinfo.id, &callerinfo.ntype, &callerinfo.present, &callerinfo.screen, callerinfo.extension, callerinfo.name);
SCPY(number, p_dialinginfo.id);
- SCPY(callerid, numberrize_callerinfo(callerinfo.id, callerinfo.ntype));
+ SCPY(callerid, numberrize_callerinfo(callerinfo.id, callerinfo.ntype, options.national, options.international));
if (callerid[0] == '\0')
{
if (callerinfo.present == INFO_PRESENT_RESTRICTED)
{ PARAM_APPLICATION,
"application",PARAM_TYPE_STRING,
"application=<name>", "Name of remote application to make call to."},
+ { PARAM_EXTEN,
+ "exten", PARAM_TYPE_STRING,
+ "exten=<extension>", "Give exten parameter to the remote application."},
{ 0, NULL, 0, NULL, NULL}
};
"Same as 'extern'"},
{ ACTION_REMOTE,
"remote", &EndpointAppPBX::action_init_remote, &EndpointAppPBX::action_dialing_remote, &EndpointAppPBX::action_hangup_call,
- PARAM_CONNECT | PARAM_APPLICATION | PARAM_TIMEOUT,
+ PARAM_CONNECT | PARAM_APPLICATION | PARAM_EXTEN | PARAM_TIMEOUT,
"Call is routed to Remote application, like Asterisk."},
{ ACTION_VBOX_RECORD,
"vbox-record",&EndpointAppPBX::action_init_call, &EndpointAppPBX::action_dialing_vbox_record, &EndpointAppPBX::action_hangup_call,
e_match_timeout = 0; /* no timeout */
e_match_to_action = NULL;
- SCPY(callerid, numberrize_callerinfo(e_callerinfo.id, e_callerinfo.ntype));
- SCPY(redirid, numberrize_callerinfo(e_redirinfo.id, e_redirinfo.ntype));
+ SCPY(callerid, numberrize_callerinfo(e_callerinfo.id, e_callerinfo.ntype, options.national, options.international));
+ SCPY(redirid, numberrize_callerinfo(e_redirinfo.id, e_redirinfo.ntype, options.national, options.international));
PDEBUG(DEBUG_ROUTE, "parsing ruleset '%s'\n", ruleset->name);
while(rule)
#define PARAM_NOPASSWORD (1LL<<42)
#define PARAM_STRIP (1LL<<43)
#define PARAM_APPLICATION (1LL<<44)
+#define PARAM_EXTEN (1LL<<45)
/* action index
** **
\*****************************************************************************/
-#include <stdio.h>
-//#include <stdlib.h>
-//#include <string.h>
-#include <sys/types.h>
-//#include <sys/stat.h>
-//#include <unistd.h>
-//#include <signal.h>
-//#include <fcntl.h>
-#include <sys/ioctl.h>
-//#include <sys/file.h>
-//#include <errno.h>
-//#include <sys/mman.h>
-//#include <sys/resource.h>
+#include "main.h"
#include <sys/socket.h>
#include <sys/un.h>
#include <curses.h>
-#include "main.h"
char *socket_name = SOCKET_NAME;
apppbx->release(RELEASE_ALL, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL);
start_trace(0,
NULL,
- numberrize_callerinfo(apppbx->e_callerinfo.id, apppbx->e_callerinfo.ntype),
+ numberrize_callerinfo(apppbx->e_callerinfo.id, apppbx->e_callerinfo.ntype, options.national, options.international),
apppbx->e_dialinginfo.id,
DIRECTION_NONE,
CATEGORY_EP,
FATAL("No memory for Endpoint Application instance\n");
apppbx->e_adminid = admin->sockserial;
admin->epointid = epoint->ep_serial;
- SCPY(apppbx->e_callerinfo.id, nationalize_callerinfo(msg->u.call.callerid, &apppbx->e_callerinfo.ntype));
+ SCPY(apppbx->e_callerinfo.id, nationalize_callerinfo(msg->u.call.callerid, &apppbx->e_callerinfo.ntype, options.national, options.international));
if (msg->u.call.present)
apppbx->e_callerinfo.present = INFO_PRESENT_ALLOWED;
else
call transfer
+doku: remote, exten
+
doku: action execute geht mit fork
doku: rx_vol -> rx_gain
** **
\*****************************************************************************/
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <poll.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
#include "main.h"
/* note: recording log is written at endpoint */
/* init trace with given values */
start_trace(0,
NULL,
- vbox?numberrize_callerinfo(vbox->p_callerinfo.id, vbox->p_callerinfo.ntype):NULL,
+ vbox?numberrize_callerinfo(vbox->p_callerinfo.id, vbox->p_callerinfo.ntype, options.national, options.international):NULL,
vbox?vbox->p_dialinginfo.id:NULL,
direction,
CATEGORY_CH,
/*****************************************************************************\
** **
-** PBX4Linux **
+** Linux-Call-Router **
** **
**---------------------------------------------------------------------------**
** Copyright: Andreas Eversberg **
** **
-** PBX Watchdog with debug function **
+** LCR Watchdog **
** **
\*****************************************************************************/