join_join_dss1();
break;
+ /* VOOTP on */
+ case '1':
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) enable VoOTP.\n", ea_endpoint->ep_serial);
+ vootp_on(1);
+ break;
+
+ /* VOOTP off */
+ case '2':
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) disable VoOTP.\n", ea_endpoint->ep_serial);
+ vootp_on(0);
+ break;
+
#ifdef WITH_CRYPT
/* crypt shared */
case '7':
encrypt_off();
break;
#endif
-
default:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) unsupported keypad digit '%c'.\n", ea_endpoint->ep_serial, digit);
}
/* screen incoming caller id */
if (e_callerinfo.interface[0]) {
do_screen(0, e_callerinfo.id, sizeof(e_callerinfo.id), &e_callerinfo.ntype, &e_callerinfo.present, e_callerinfo.interface);
- do_screen(0, e_callerinfo.id2, sizeof(e_callerinfo.id2), &e_callerinfo.ntype2, &e_callerinfo.present2, e_callerinfo.interface);
- do_screen(0, e_redirinfo.id, sizeof(e_redirinfo.id), &e_redirinfo.ntype, &e_redirinfo.present, e_callerinfo.interface);
+ if (e_callerinfo.id2[0]) do_screen(0, e_callerinfo.id2, sizeof(e_callerinfo.id2), &e_callerinfo.ntype2, &e_callerinfo.present2, e_callerinfo.interface);
+ if (e_redirinfo.id[0]) do_screen(0, e_redirinfo.id, sizeof(e_redirinfo.id), &e_redirinfo.ntype, &e_redirinfo.present, e_callerinfo.interface);
}
/* process extension */
}
+/* port MESSAGE_UPDATEBRIDGE */
+void EndpointAppPBX::port_updatebridge(struct port_list *portlist, int message_type, union parameter *param)
+{
+ struct lcr_msg *message;
+
+ message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_UPDATEBRIDGE);
+ message_put(message);
+}
+
+
+/* port MESSAGE_VOOTP */
+void EndpointAppPBX::port_vootp(struct port_list *portlist, int message_type, union parameter *param)
+{
+ if (param->vootp.failed)
+ set_tone(ea_endpoint->ep_portlist, "crypt_off");
+}
+
+
/* port sends message to the endpoint
*/
void EndpointAppPBX::ea_message_port(unsigned int port_id, int message_type, union parameter *param)
port_disable_dejitter(portlist, message_type, param);
break;
+ case MESSAGE_UPDATEBRIDGE:
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) incoming updatebridge message (terminal '%s', caller id '%s')\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
+ port_updatebridge(portlist, message_type, param);
+ break;
+
+ case MESSAGE_VOOTP:
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) incoming vootp message (terminal '%s', caller id '%s')\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
+ port_vootp(portlist, message_type, param);
+ break;
+
default:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received a wrong message: %d\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id, message_type);
class Join *join;
class JoinPBX *joinpbx;
struct join_relation *relation;
- int vbox;
/* find an endpoint that is ringing internally or vbox with higher priority */
- vbox = 0;
found = NULL;
eapp = apppbx_first;
while(eapp) {
if (port->p_type == PORT_TYPE_VBOX_OUT) {
if (match_list(extensions, eapp->e_ext.number)) {
found = eapp;
- vbox = 1;
break;
}
}
return(0);
}
+int EndpointAppPBX::vootp_on(int on)
+{
+#ifndef WITH_VOOTP
+ set_tone(ea_endpoint->ep_portlist, "crypt_off");
+#else
+ if (!e_ext.otp_ident[0]) {
+ set_tone(ea_endpoint->ep_portlist, "crypt_off");
+ return -EINVAL;
+ }
+ if(ea_endpoint->ep_portlist) {
+ struct lcr_msg *message;
+
+ message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_portlist->port_id, EPOINT_TO_PORT, MESSAGE_VOOTP);
+ message->param.vootp.enable = on;
+ SCPY(message->param.vootp.id, e_ext.otp_ident);
+ message_put(message);
+ }
+ if (!on)
+ set_tone(ea_endpoint->ep_portlist, "crypt_off");
+#endif
+
+ return 0;
+}
+
void EndpointAppPBX::logmessage(int message_type, union parameter *param, unsigned int port_id, int dir)
{
const char *logtext = "unknown";