summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a28dde2)
Usage: Dial(LCR/<interface>/<digits>/<options>)
The interface must match the interface name in interface.conf. If omitted,
the first remote interface is used.
Example:
Dial(LCR/ast/123) will send a call to LCR and select remote interface
'ast'.
Dial(LCR//123) will send a call to LCR and select the first remote
interface.
Now it is possible to have multiple remote interfaces.
strncpy(newparam.setup.dialinginfo.keypad, call->dialstring, sizeof(newparam.setup.dialinginfo.keypad)-1);
else
strncpy(newparam.setup.dialinginfo.id, call->dialstring, sizeof(newparam.setup.dialinginfo.id)-1);
strncpy(newparam.setup.dialinginfo.keypad, call->dialstring, sizeof(newparam.setup.dialinginfo.keypad)-1);
else
strncpy(newparam.setup.dialinginfo.id, call->dialstring, sizeof(newparam.setup.dialinginfo.id)-1);
- if (!!strcmp(call->interface, "pbx"))
- strncpy(newparam.setup.dialinginfo.interfaces, call->interface, sizeof(newparam.setup.dialinginfo.interfaces)-1);
newparam.setup.callerinfo.itype = INFO_ITYPE_CHAN;
newparam.setup.callerinfo.ntype = INFO_NTYPE_UNKNOWN;
strncpy(newparam.setup.callerinfo.display, call->display, sizeof(newparam.setup.callerinfo.display)-1);
newparam.setup.callerinfo.itype = INFO_ITYPE_CHAN;
newparam.setup.callerinfo.ntype = INFO_NTYPE_UNKNOWN;
strncpy(newparam.setup.callerinfo.display, call->display, sizeof(newparam.setup.callerinfo.display)-1);
/* send MESSAGE_NEWREF */
memset(&newparam, 0, sizeof(union parameter));
newparam.newref.direction = 0; /* request from app */
/* send MESSAGE_NEWREF */
memset(&newparam, 0, sizeof(union parameter));
newparam.newref.direction = 0; /* request from app */
+ strncpy(newparam.newref.interface, call->interface, sizeof(newparam.newref.interface) - 1);
send_message(MESSAGE_NEWREF, 0, &newparam);
/* set hdlc if capability requires hdlc */
send_message(MESSAGE_NEWREF, 0, &newparam);
/* set hdlc if capability requires hdlc */
struct param_newref {
int direction; /* who requests a refe? */
struct param_newref {
int direction; /* who requests a refe? */
+ char interface[32]; /* interface name for selecting remote interface */
};
struct param_traffic {
};
struct param_traffic {
+extern unsigned int new_remote;
/* GSM port class */
class Premote : public Port
/* GSM port class */
class Premote : public Port
- /* new join. the reply (NEWREF assignment) is sent from constructor */
+ /* new remote instance. the reply (NEWREF assignment) is sent from constructor */
if (msg->type == MESSAGE_NEWREF) {
char name[32];
/* find remote port */
interface = interface_first;
while(interface) {
if (msg->type == MESSAGE_NEWREF) {
char name[32];
/* find remote port */
interface = interface_first;
while(interface) {
- if (interface->remote && !strcmp(interface->remote_app, admin->remote_name))
- break;
+ /* interface must match the remote application */
+ if (interface->remote && !strcmp(interface->remote_app, admin->remote_name)) {
+ /* interface must match the name, if given */
+ if (!msg->param.newref.interface[0] || !strcmp(msg->param.newref.interface, interface->name))
+ break;
+ }
interface = interface->next;
}
if (!interface) {
union parameter param;
interface = interface->next;
}
if (!interface) {
union parameter param;
+ unsigned int ref = new_remote++;
+ start_trace(-1,
+ NULL,
+ NULL,
+ NULL,
+ DIRECTION_NONE,
+ 0,
+ 0,
+ "REMOTE APP illegal interface");
+ add_trace("app", "name", "%s", admin->remote_name);
+ add_trace("interface", "name", "%s", msg->param.newref.interface);
+ end_trace();
+ memset(¶m, 0, sizeof(union parameter));
+ param.newref.direction = 0;
+ admin_message_from_lcr(admin->sock, ref, MESSAGE_NEWREF, ¶m);
memset(¶m, 0, sizeof(union parameter));
param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
param.disconnectinfo.cause = CAUSE_RESSOURCEUNAVAIL;
memset(¶m, 0, sizeof(union parameter));
param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
param.disconnectinfo.cause = CAUSE_RESSOURCEUNAVAIL;
- admin_message_from_lcr(admin->sock, 0, MESSAGE_RELEASE, ¶m);
+ admin_message_from_lcr(admin->sock, ref, MESSAGE_RELEASE, ¶m);
return 0;
}
/* creating port object, transparent until setup with hdlc */
return 0;
}
/* creating port object, transparent until setup with hdlc */