86 #include <sys/socket.h> 88 #include <arpa/inet.h> 90 #include <sys/ioctl.h> 93 #include <semaphore.h> 164 #if defined(AST_MISDN_ENHANCEMENTS) 169 #define MISDN_CC_RECORD_AGE_MAX (6UL * 60 * 60) 171 #define MISDN_CC_REQUEST_WAIT_MAX 5 183 struct misdn_cc_caller {
188 struct misdn_cc_notify {
200 struct misdn_cc_record {
233 int requested_retention;
238 int retention_enabled;
261 int outstanding_message;
264 int activation_requested;
274 enum FacErrorCode error_code;
277 enum FacRejectCode reject_code;
291 struct Q931_Bc_Hlc_Llc setup_bc_hlc_llc;
301 struct misdn_cc_notify remote_user_free;
304 struct misdn_cc_notify b_free;
310 static __u16 misdn_cc_record_id;
312 static __s16 misdn_invoke_id;
314 static const char misdn_no_response_from_network[] =
"No response from network";
315 static const char misdn_cc_record_not_found[] =
"Call completion record not found";
318 #define MISDN_CC_RECORD_ID "MISDN_CC_RECORD_ID" 319 #define MISDN_CC_STATUS "MISDN_CC_STATUS" 320 #define MISDN_ERROR_MSG "MISDN_ERROR_MSG" 371 #define chan_list_ref(obj, debug) ao2_t_ref((obj), +1, (debug)) 372 #define chan_list_unref(obj, debug) ao2_t_ref((obj), -1, (debug)) 449 char ast_rd_buf[4096];
473 struct timeval faxdetect_tv;
522 #if defined(AST_MISDN_ENHANCEMENTS) 526 struct misdn_cc_caller *peer;
603 struct timeval overlap_tv;
634 for (r = robin, robin =
NULL; r; r =
next) {
645 for (; iter; iter = iter->
next) {
646 if (!strcasecmp(iter->
group, group)) {
676 __attribute__((
format(printf, 3, 4)));
683 #define MISDN_ASTERISK_TECH_PVT(ast) ast_channel_tech_pvt(ast) 684 #define MISDN_ASTERISK_TECH_PVT_SET(ast, value) ast_channel_tech_pvt_set(ast, value) 723 #if defined(AST_MISDN_ENHANCEMENTS) 724 static const char misdn_command_name[] =
"misdn_command";
725 static int misdn_command_exec(
struct ast_channel *chan,
const char *data);
754 for (list = cl_te; list; list = list->
next) {
765 #if defined(mISDN_NATIVE_BRIDGING) 772 for (tmp = cl_te;
tmp; tmp = tmp->
next) {
773 if (tmp->
ast == ast) {
791 for (tmp = cl_te;
tmp; tmp = tmp->
next) {
803 #if defined(AST_MISDN_ENHANCEMENTS) 827 static void misdn_cc_ds_destroy(
void *data)
829 struct misdn_cc_caller *cc_caller = data;
832 cc_caller->chan =
NULL;
839 #if defined(AST_MISDN_ENHANCEMENTS) 851 static void *misdn_cc_ds_duplicate(
void *data)
853 struct misdn_cc_caller *cc_caller = data;
861 #if defined(AST_MISDN_ENHANCEMENTS) 864 .destroy = misdn_cc_ds_destroy,
865 .duplicate = misdn_cc_ds_duplicate,
869 #if defined(AST_MISDN_ENHANCEMENTS) 883 static void misdn_cc_set_peer_var(
struct misdn_cc_caller *peer,
const char *
var,
904 #if defined(AST_MISDN_ENHANCEMENTS) 909 static struct misdn_cc_caller *misdn_cc_caller_get(
struct ast_channel *chan)
912 struct misdn_cc_caller *cc_caller;
922 cc_caller = datastore->
data;
930 #if defined(AST_MISDN_ENHANCEMENTS) 942 static struct misdn_cc_record *misdn_cc_find_by_id(
long record_id)
944 struct misdn_cc_record *current;
947 if (current->record_id == record_id) {
957 #if defined(AST_MISDN_ENHANCEMENTS) 970 static struct misdn_cc_record *misdn_cc_find_by_linkage(
int port,
int linkage_id)
972 struct misdn_cc_record *current;
975 if (current->port == port
977 && current->mode.ptmp.linkage_id == linkage_id) {
987 #if defined(AST_MISDN_ENHANCEMENTS) 1000 static struct misdn_cc_record *misdn_cc_find_by_invoke(
int port,
int invoke_id)
1002 struct misdn_cc_record *current;
1005 if (current->outstanding_message
1006 && current->invoke_id == invoke_id
1007 && current->port == port) {
1017 #if defined(AST_MISDN_ENHANCEMENTS) 1030 static struct misdn_cc_record *misdn_cc_find_by_reference(
int port,
int reference_id)
1032 struct misdn_cc_record *current;
1035 if (current->activated
1036 && current->port == port
1038 && current->mode.ptmp.reference_id == reference_id) {
1048 #if defined(AST_MISDN_ENHANCEMENTS) 1060 static struct misdn_cc_record *misdn_cc_find_by_bc(
const struct misdn_bchannel *
bc)
1062 struct misdn_cc_record *current;
1067 && current->mode.ptp.bc == bc) {
1080 #if defined(AST_MISDN_ENHANCEMENTS) 1091 static void misdn_cc_delete(
struct misdn_cc_record *doomed)
1093 struct misdn_cc_record *current;
1096 if (current == doomed) {
1108 #if defined(AST_MISDN_ENHANCEMENTS) 1117 static void misdn_cc_remove_old(
void)
1119 struct misdn_cc_record *current;
1124 if (MISDN_CC_RECORD_AGE_MAX < now - current->time_created) {
1125 if (current->ptp && current->mode.ptp.bc) {
1127 current->mode.ptp.bc->fac_out.Function = Fac_None;
1141 #if defined(AST_MISDN_ENHANCEMENTS) 1151 static long misdn_cc_record_id_new(
void)
1156 record_id = ++misdn_cc_record_id;
1157 first_id = record_id;
1158 while (misdn_cc_find_by_id(record_id)) {
1159 record_id = ++misdn_cc_record_id;
1160 if (record_id == first_id) {
1165 chan_misdn_log(0, 0,
" --> ERROR Too many call completion records!\n");
1175 #if defined(AST_MISDN_ENHANCEMENTS) 1185 static struct misdn_cc_record *misdn_cc_new(
void)
1187 struct misdn_cc_record *cc_record;
1190 misdn_cc_remove_old();
1192 cc_record =
ast_calloc(1,
sizeof(*cc_record));
1194 record_id = misdn_cc_record_id_new();
1195 if (record_id < 0) {
1201 cc_record->record_id = record_id;
1202 cc_record->port = -1;
1203 cc_record->invoke_id = ++misdn_invoke_id;
1204 cc_record->party_a_free = 1;
1205 cc_record->error_code = FacError_None;
1206 cc_record->reject_code = FacReject_None;
1207 cc_record->time_created = time(
NULL);
1216 #if defined(AST_MISDN_ENHANCEMENTS) 1223 static void misdn_cc_destroy(
void)
1225 struct misdn_cc_record *current;
1234 #if defined(AST_MISDN_ENHANCEMENTS) 1241 static void misdn_cc_init(
void)
1243 misdn_cc_record_id = 0;
1247 #if defined(AST_MISDN_ENHANCEMENTS) 1257 static int misdn_cc_response_check(
void *data)
1260 struct misdn_cc_record *cc_record;
1263 cc_record = misdn_cc_find_by_id(*(
long *) data);
1265 if (cc_record->outstanding_message) {
1276 return not_responded;
1280 #if defined(AST_MISDN_ENHANCEMENTS) 1292 static void misdn_cc_response_wait(
struct ast_channel *chan,
int wait_seconds,
long record_id)
1296 for (count = 2 * MISDN_CC_REQUEST_WAIT_MAX; count--;) {
1306 #if defined(AST_MISDN_ENHANCEMENTS) 1315 static const char *misdn_to_str_reject_code(
enum FacRejectCode code)
1317 static const struct {
1318 enum FacRejectCode code;
1322 { FacReject_None,
"No reject occurred" },
1323 { FacReject_Unknown,
"Unknown reject code" },
1325 { FacReject_Gen_UnrecognizedComponent,
"General: Unrecognized Component" },
1326 { FacReject_Gen_MistypedComponent,
"General: Mistyped Component" },
1327 { FacReject_Gen_BadlyStructuredComponent,
"General: Badly Structured Component" },
1329 { FacReject_Inv_DuplicateInvocation,
"Invoke: Duplicate Invocation" },
1330 { FacReject_Inv_UnrecognizedOperation,
"Invoke: Unrecognized Operation" },
1331 { FacReject_Inv_MistypedArgument,
"Invoke: Mistyped Argument" },
1332 { FacReject_Inv_ResourceLimitation,
"Invoke: Resource Limitation" },
1333 { FacReject_Inv_InitiatorReleasing,
"Invoke: Initiator Releasing" },
1334 { FacReject_Inv_UnrecognizedLinkedID,
"Invoke: Unrecognized Linked ID" },
1335 { FacReject_Inv_LinkedResponseUnexpected,
"Invoke: Linked Response Unexpected" },
1336 { FacReject_Inv_UnexpectedChildOperation,
"Invoke: Unexpected Child Operation" },
1338 { FacReject_Res_UnrecognizedInvocation,
"Result: Unrecognized Invocation" },
1339 { FacReject_Res_ResultResponseUnexpected,
"Result: Result Response Unexpected" },
1340 { FacReject_Res_MistypedResult,
"Result: Mistyped Result" },
1342 { FacReject_Err_UnrecognizedInvocation,
"Error: Unrecognized Invocation" },
1343 { FacReject_Err_ErrorResponseUnexpected,
"Error: Error Response Unexpected" },
1344 { FacReject_Err_UnrecognizedError,
"Error: Unrecognized Error" },
1345 { FacReject_Err_UnexpectedError,
"Error: Unexpected Error" },
1346 { FacReject_Err_MistypedParameter,
"Error: Mistyped Parameter" },
1352 for (index = 0; index <
ARRAY_LEN(arr); ++index) {
1353 if (arr[index].code == code) {
1354 return arr[index].name;
1362 #if defined(AST_MISDN_ENHANCEMENTS) 1371 static const char *misdn_to_str_error_code(
enum FacErrorCode code)
1373 static const struct {
1374 enum FacErrorCode code;
1378 { FacError_None,
"No error occurred" },
1379 { FacError_Unknown,
"Unknown OID error code" },
1381 { FacError_Gen_NotSubscribed,
"General: Not Subscribed" },
1382 { FacError_Gen_NotAvailable,
"General: Not Available" },
1383 { FacError_Gen_NotImplemented,
"General: Not Implemented" },
1384 { FacError_Gen_InvalidServedUserNr,
"General: Invalid Served User Number" },
1385 { FacError_Gen_InvalidCallState,
"General: Invalid Call State" },
1386 { FacError_Gen_BasicServiceNotProvided,
"General: Basic Service Not Provided" },
1387 { FacError_Gen_NotIncomingCall,
"General: Not Incoming Call" },
1388 { FacError_Gen_SupplementaryServiceInteractionNotAllowed,
"General: Supplementary Service Interaction Not Allowed" },
1389 { FacError_Gen_ResourceUnavailable,
"General: Resource Unavailable" },
1391 { FacError_Div_InvalidDivertedToNr,
"Diversion: Invalid Diverted To Number" },
1392 { FacError_Div_SpecialServiceNr,
"Diversion: Special Service Number" },
1393 { FacError_Div_DiversionToServedUserNr,
"Diversion: Diversion To Served User Number" },
1394 { FacError_Div_IncomingCallAccepted,
"Diversion: Incoming Call Accepted" },
1395 { FacError_Div_NumberOfDiversionsExceeded,
"Diversion: Number Of Diversions Exceeded" },
1396 { FacError_Div_NotActivated,
"Diversion: Not Activated" },
1397 { FacError_Div_RequestAlreadyAccepted,
"Diversion: Request Already Accepted" },
1399 { FacError_AOC_NoChargingInfoAvailable,
"AOC: No Charging Info Available" },
1401 { FacError_CCBS_InvalidCallLinkageID,
"CCBS: Invalid Call Linkage ID" },
1402 { FacError_CCBS_InvalidCCBSReference,
"CCBS: Invalid CCBS Reference" },
1403 { FacError_CCBS_LongTermDenial,
"CCBS: Long Term Denial" },
1404 { FacError_CCBS_ShortTermDenial,
"CCBS: Short Term Denial" },
1405 { FacError_CCBS_IsAlreadyActivated,
"CCBS: Is Already Activated" },
1406 { FacError_CCBS_AlreadyAccepted,
"CCBS: Already Accepted" },
1407 { FacError_CCBS_OutgoingCCBSQueueFull,
"CCBS: Outgoing CCBS Queue Full" },
1408 { FacError_CCBS_CallFailureReasonNotBusy,
"CCBS: Call Failure Reason Not Busy" },
1409 { FacError_CCBS_NotReadyForCall,
"CCBS: Not Ready For Call" },
1411 { FacError_CCBS_T_LongTermDenial,
"CCBS-T: Long Term Denial" },
1412 { FacError_CCBS_T_ShortTermDenial,
"CCBS-T: Short Term Denial" },
1414 { FacError_ECT_LinkIdNotAssignedByNetwork,
"ECT: Link ID Not Assigned By Network" },
1420 for (index = 0; index <
ARRAY_LEN(arr); ++index) {
1421 if (arr[index].code == code) {
1422 return arr[index].name;
1430 #if defined(AST_MISDN_ENHANCEMENTS) 1441 unsigned diversion_reason;
1445 diversion_reason = 1;
1448 diversion_reason = 2;
1451 diversion_reason = 3;
1454 diversion_reason = 0;
1458 return diversion_reason;
1462 #if defined(AST_MISDN_ENHANCEMENTS) 1475 switch (diversion_reason) {
1494 #if defined(AST_MISDN_ENHANCEMENTS) 1504 static unsigned misdn_to_PresentedNumberUnscreened_type(
int presentation,
int number_present)
1508 switch (presentation) {
1510 if (number_present) {
1517 if (number_present) {
1532 #if defined(AST_MISDN_ENHANCEMENTS) 1541 static int PresentedNumberUnscreened_to_misdn_pres(
unsigned type)
1561 return presentation;
1565 #if defined(AST_MISDN_ENHANCEMENTS) 1576 unsigned party_plan;
1578 switch (number_plan) {
1609 #if defined(AST_MISDN_ENHANCEMENTS) 1622 switch (party_plan) {
1648 #if defined(AST_MISDN_ENHANCEMENTS) 1692 #if defined(AST_MISDN_ENHANCEMENTS) 1701 static enum mISDN_NUMBER_TYPE PartyNumber_to_misdn_ton_public(
unsigned party_ton)
1705 switch (party_ton) {
1736 #if defined(AST_MISDN_ENHANCEMENTS) 1780 #if defined(AST_MISDN_ENHANCEMENTS) 1789 static enum mISDN_NUMBER_TYPE PartyNumber_to_misdn_ton_private(
unsigned party_ton)
1793 switch (party_ton) {
1836 switch (number_type) {
1843 str =
"International";
1851 str =
"Network Specific";
1859 str =
"Abbreviated";
1876 int ast_number_type;
1878 switch (number_type) {
1905 return ast_number_type;
1920 switch ((ast_number_type >> 4) & 0x07) {
1962 switch (number_plan) {
2002 int ast_number_plan;
2004 switch (number_plan) {
2031 return ast_number_plan;
2046 switch (ast_number_plan & 0x0F) {
2088 switch (presentation) {
2098 str =
"Unavailable";
2119 switch (presentation) {
2134 return presentation;
2162 return presentation;
2177 switch (screening) {
2183 str =
"Passed Screen";
2187 str =
"Failed Screen";
2191 str =
"Network Number";
2212 switch (screening) {
2278 static const struct misdn_reasons {
2281 } misdn_reason_table[] = {
2298 for (index = 0; index <
ARRAY_LEN(misdn_reason_table); ++index) {
2299 if (misdn_reason_table[index].ast == ast) {
2300 return misdn_reason_table[index].q931;
2377 for (index = 0; index <
ARRAY_LEN(allowed_bearers_array); ++index) {
2378 if (allowed_bearers_array[index].cap == cap) {
2379 return allowed_bearers_array[index].
display;
2383 return "Unknown Bearer";
2386 #if defined(AST_MISDN_ENHANCEMENTS) 2396 static void misdn_PartyNumber_fill(
struct FacPartyNumber *party,
const struct misdn_party_id *
id)
2399 party->LengthOfNumber = strlen((
char *) party->Number);
2400 party->Type = misdn_to_PartyNumber_plan(id->
number_plan);
2401 switch (party->Type) {
2403 party->TypeOfNumber = misdn_to_PartyNumber_ton_public(id->
number_type);
2406 party->TypeOfNumber = misdn_to_PartyNumber_ton_private(id->
number_type);
2409 party->TypeOfNumber = 0;
2415 #if defined(AST_MISDN_ENHANCEMENTS) 2425 static void misdn_PartyNumber_extract(
struct misdn_party_id *
id,
const struct FacPartyNumber *party)
2427 if (party->LengthOfNumber) {
2429 id->number_plan = PartyNumber_to_misdn_plan(party->Type);
2430 switch (party->Type) {
2432 id->number_type = PartyNumber_to_misdn_ton_public(party->TypeOfNumber);
2435 id->number_type = PartyNumber_to_misdn_ton_private(party->TypeOfNumber);
2450 #if defined(AST_MISDN_ENHANCEMENTS) 2460 static void misdn_Address_fill(
struct FacAddress *Address,
const struct misdn_party_id *
id)
2462 misdn_PartyNumber_fill(&Address->Party,
id);
2465 Address->Subaddress.Length = 0;
2469 #if defined(AST_MISDN_ENHANCEMENTS) 2479 static void misdn_PresentedNumberUnscreened_fill(
struct FacPresentedNumberUnscreened *presented,
const struct misdn_party_id *
id)
2481 presented->Type = misdn_to_PresentedNumberUnscreened_type(id->
presentation, id->
number[0] ? 1 : 0);
2482 misdn_PartyNumber_fill(&presented->Unscreened,
id);
2486 #if defined(AST_MISDN_ENHANCEMENTS) 2496 static void misdn_PresentedNumberUnscreened_extract(
struct misdn_party_id *
id,
const struct FacPresentedNumberUnscreened *presented)
2498 id->presentation = PresentedNumberUnscreened_to_misdn_pres(presented->Type);
2500 switch (presented->Type) {
2503 misdn_PartyNumber_extract(
id, &presented->Unscreened);
2517 #if defined(AST_MISDN_ENHANCEMENTS) 2518 static const char Level_Spacing[] =
" ";
2521 #if defined(AST_MISDN_ENHANCEMENTS) 2522 static void print_facility_PartyNumber(
unsigned Level,
const struct FacPartyNumber *Party,
const struct misdn_bchannel *bc)
2524 if (Party->LengthOfNumber) {
2525 const char *Spacing;
2527 Spacing = &Level_Spacing[
sizeof(Level_Spacing) - 1 - Level];
2529 Spacing, Party->Type);
2530 switch (Party->Type) {
2533 Spacing, Party->Number);
2537 Spacing, Party->TypeOfNumber, Party->Number);
2541 Spacing, Party->Number);
2545 Spacing, Party->Number);
2549 Spacing, Party->Number);
2553 Spacing, Party->TypeOfNumber, Party->Number);
2557 Spacing, Party->Number);
2566 #if defined(AST_MISDN_ENHANCEMENTS) 2567 static void print_facility_Subaddress(
unsigned Level,
const struct FacPartySubaddress *Subaddress,
const struct misdn_bchannel *bc)
2569 if (Subaddress->Length) {
2570 const char *Spacing;
2572 Spacing = &Level_Spacing[
sizeof(Level_Spacing) - 1 - Level];
2574 Spacing, Subaddress->Type);
2575 switch (Subaddress->Type) {
2577 if (Subaddress->u.UserSpecified.OddCountPresent) {
2579 Spacing, Subaddress->u.UserSpecified.OddCount, Subaddress->Length);
2582 Spacing, Subaddress->u.UserSpecified.Information);
2587 Spacing, Subaddress->u.Nsap);
2596 #if defined(AST_MISDN_ENHANCEMENTS) 2597 static void print_facility_Address(
unsigned Level,
const struct FacAddress *Address,
const struct misdn_bchannel *bc)
2599 print_facility_PartyNumber(Level, &Address->Party, bc);
2600 print_facility_Subaddress(Level, &Address->Subaddress, bc);
2604 #if defined(AST_MISDN_ENHANCEMENTS) 2605 static void print_facility_PresentedNumberUnscreened(
unsigned Level,
const struct FacPresentedNumberUnscreened *Presented,
const struct misdn_bchannel *bc)
2607 const char *Spacing;
2609 Spacing = &Level_Spacing[
sizeof(Level_Spacing) - 1 - Level];
2610 chan_misdn_log(1, bc->
port,
" -->%s Unscreened Type:%d\n", Spacing, Presented->Type);
2611 switch (Presented->Type) {
2614 print_facility_PartyNumber(Level + 2, &Presented->Unscreened, bc);
2624 print_facility_PartyNumber(Level + 2, &Presented->Unscreened, bc);
2632 #if defined(AST_MISDN_ENHANCEMENTS) 2633 static void print_facility_AddressScreened(
unsigned Level,
const struct FacAddressScreened *Address,
const struct misdn_bchannel *bc)
2635 const char *Spacing;
2637 Spacing = &Level_Spacing[
sizeof(Level_Spacing) - 1 - Level];
2638 chan_misdn_log(1, bc->
port,
" -->%s ScreeningIndicator:%d\n", Spacing, Address->ScreeningIndicator);
2639 print_facility_PartyNumber(Level, &Address->Party, bc);
2640 print_facility_Subaddress(Level, &Address->Subaddress, bc);
2644 #if defined(AST_MISDN_ENHANCEMENTS) 2645 static void print_facility_PresentedAddressScreened(
unsigned Level,
const struct FacPresentedAddressScreened *Presented,
const struct misdn_bchannel *bc)
2647 const char *Spacing;
2649 Spacing = &Level_Spacing[
sizeof(Level_Spacing) - 1 - Level];
2651 switch (Presented->Type) {
2654 print_facility_AddressScreened(Level + 2, &Presented->Address, bc);
2664 print_facility_AddressScreened(Level + 2, &Presented->Address, bc);
2672 #if defined(AST_MISDN_ENHANCEMENTS) 2673 static void print_facility_Q931_Bc_Hlc_Llc(
unsigned Level,
const struct Q931_Bc_Hlc_Llc *Q931ie,
const struct misdn_bchannel *bc)
2675 const char *Spacing;
2677 Spacing = &Level_Spacing[
sizeof(Level_Spacing) - 1 - Level];
2679 if (Q931ie->Bc.Length) {
2682 if (Q931ie->Hlc.Length) {
2685 if (Q931ie->Llc.Length) {
2691 #if defined(AST_MISDN_ENHANCEMENTS) 2692 static void print_facility_Q931_Bc_Hlc_Llc_Uu(
unsigned Level,
const struct Q931_Bc_Hlc_Llc_Uu *Q931ie,
const struct misdn_bchannel *bc)
2694 const char *Spacing;
2696 Spacing = &Level_Spacing[
sizeof(Level_Spacing) - 1 - Level];
2698 if (Q931ie->Bc.Length) {
2701 if (Q931ie->Hlc.Length) {
2704 if (Q931ie->Llc.Length) {
2707 if (Q931ie->UserInfo.Length) {
2708 chan_misdn_log(1, bc->
port,
" -->%s UserInfo Len:%d\n", Spacing, Q931ie->UserInfo.Length);
2713 #if defined(AST_MISDN_ENHANCEMENTS) 2714 static void print_facility_CallInformation(
unsigned Level,
const struct FacCallInformation *CallInfo,
const struct misdn_bchannel *bc)
2716 const char *Spacing;
2718 Spacing = &Level_Spacing[
sizeof(Level_Spacing) - 1 - Level];
2720 Spacing, CallInfo->CCBSReference);
2722 print_facility_Address(Level + 1, &CallInfo->AddressOfB, bc);
2723 print_facility_Q931_Bc_Hlc_Llc(Level, &CallInfo->Q931ie, bc);
2724 if (CallInfo->SubaddressOfA.Length) {
2726 print_facility_Subaddress(Level + 1, &CallInfo->SubaddressOfA, bc);
2731 #if defined(AST_MISDN_ENHANCEMENTS) 2732 static void print_facility_ServedUserNr(
unsigned Level,
const struct FacPartyNumber *Party,
const struct misdn_bchannel *bc)
2734 const char *Spacing;
2736 Spacing = &Level_Spacing[
sizeof(Level_Spacing) - 1 - Level];
2737 if (Party->LengthOfNumber) {
2738 print_facility_PartyNumber(Level, Party, bc);
2745 #if defined(AST_MISDN_ENHANCEMENTS) 2746 static void print_facility_IntResult(
unsigned Level,
const struct FacForwardingRecord *ForwardingRecord,
const struct misdn_bchannel *bc)
2748 const char *Spacing;
2750 Spacing = &Level_Spacing[
sizeof(Level_Spacing) - 1 - Level];
2753 ForwardingRecord->Procedure,
2754 ForwardingRecord->BasicService);
2756 print_facility_Address(Level + 1, &ForwardingRecord->ForwardedTo, bc);
2758 print_facility_ServedUserNr(Level + 1, &ForwardingRecord->ServedUser, bc);
2764 #if defined(AST_MISDN_ENHANCEMENTS) 2768 switch (fac->Function) {
2769 #if defined(AST_MISDN_ENHANCEMENTS) 2770 case Fac_ActivationDiversion:
2772 fac->u.ActivationDiversion.InvokeID);
2773 switch (fac->u.ActivationDiversion.ComponentType) {
2774 case FacComponent_Invoke:
2776 fac->u.ActivationDiversion.Component.Invoke.Procedure,
2777 fac->u.ActivationDiversion.Component.Invoke.BasicService);
2779 print_facility_Address(3, &fac->u.ActivationDiversion.Component.Invoke.ForwardedTo, bc);
2781 print_facility_ServedUserNr(3, &fac->u.ActivationDiversion.Component.Invoke.ServedUser, bc);
2783 case FacComponent_Result:
2790 case Fac_DeactivationDiversion:
2792 fac->u.DeactivationDiversion.InvokeID);
2793 switch (fac->u.DeactivationDiversion.ComponentType) {
2794 case FacComponent_Invoke:
2796 fac->u.DeactivationDiversion.Component.Invoke.Procedure,
2797 fac->u.DeactivationDiversion.Component.Invoke.BasicService);
2799 print_facility_ServedUserNr(3, &fac->u.DeactivationDiversion.Component.Invoke.ServedUser, bc);
2801 case FacComponent_Result:
2808 case Fac_ActivationStatusNotificationDiv:
2809 chan_misdn_log(1, bc->
port,
" --> ActivationStatusNotificationDiv: InvokeID:%d Procedure:%d BasicService:%d\n",
2810 fac->u.ActivationStatusNotificationDiv.InvokeID,
2811 fac->u.ActivationStatusNotificationDiv.Procedure,
2812 fac->u.ActivationStatusNotificationDiv.BasicService);
2814 print_facility_Address(2, &fac->u.ActivationStatusNotificationDiv.ForwardedTo, bc);
2816 print_facility_ServedUserNr(2, &fac->u.ActivationStatusNotificationDiv.ServedUser, bc);
2818 case Fac_DeactivationStatusNotificationDiv:
2819 chan_misdn_log(1, bc->
port,
" --> DeactivationStatusNotificationDiv: InvokeID:%d Procedure:%d BasicService:%d\n",
2820 fac->u.DeactivationStatusNotificationDiv.InvokeID,
2821 fac->u.DeactivationStatusNotificationDiv.Procedure,
2822 fac->u.DeactivationStatusNotificationDiv.BasicService);
2824 print_facility_ServedUserNr(2, &fac->u.DeactivationStatusNotificationDiv.ServedUser, bc);
2826 case Fac_InterrogationDiversion:
2828 fac->u.InterrogationDiversion.InvokeID);
2829 switch (fac->u.InterrogationDiversion.ComponentType) {
2830 case FacComponent_Invoke:
2832 fac->u.InterrogationDiversion.Component.Invoke.Procedure,
2833 fac->u.InterrogationDiversion.Component.Invoke.BasicService);
2835 print_facility_ServedUserNr(3, &fac->u.InterrogationDiversion.Component.Invoke.ServedUser, bc);
2837 case FacComponent_Result:
2839 if (fac->u.InterrogationDiversion.Component.Result.NumRecords) {
2840 for (Index = 0; Index < fac->u.InterrogationDiversion.Component.Result.NumRecords; ++Index) {
2842 print_facility_IntResult(3, &fac->u.InterrogationDiversion.Component.Result.List[Index], bc);
2850 case Fac_DiversionInformation:
2851 chan_misdn_log(1, bc->
port,
" --> DiversionInformation: InvokeID:%d Reason:%d BasicService:%d\n",
2852 fac->u.DiversionInformation.InvokeID,
2853 fac->u.DiversionInformation.DiversionReason,
2854 fac->u.DiversionInformation.BasicService);
2855 if (fac->u.DiversionInformation.ServedUserSubaddress.Length) {
2857 print_facility_Subaddress(2, &fac->u.DiversionInformation.ServedUserSubaddress, bc);
2859 if (fac->u.DiversionInformation.CallingAddressPresent) {
2861 print_facility_PresentedAddressScreened(2, &fac->u.DiversionInformation.CallingAddress, bc);
2863 if (fac->u.DiversionInformation.OriginalCalledPresent) {
2865 print_facility_PresentedNumberUnscreened(2, &fac->u.DiversionInformation.OriginalCalled, bc);
2867 if (fac->u.DiversionInformation.LastDivertingPresent) {
2869 print_facility_PresentedNumberUnscreened(2, &fac->u.DiversionInformation.LastDiverting, bc);
2871 if (fac->u.DiversionInformation.LastDivertingReasonPresent) {
2872 chan_misdn_log(1, bc->
port,
" --> LastDivertingReason:%d\n", fac->u.DiversionInformation.LastDivertingReason);
2874 if (fac->u.DiversionInformation.UserInfo.Length) {
2875 chan_misdn_log(1, bc->
port,
" --> UserInfo Length:%d\n", fac->u.DiversionInformation.UserInfo.Length);
2878 case Fac_CallDeflection:
2880 fac->u.CallDeflection.InvokeID);
2881 switch (fac->u.CallDeflection.ComponentType) {
2882 case FacComponent_Invoke:
2884 if (fac->u.CallDeflection.Component.Invoke.PresentationAllowedToDivertedToUserPresent) {
2886 fac->u.CallDeflection.Component.Invoke.PresentationAllowedToDivertedToUser);
2889 print_facility_Address(3, &fac->u.CallDeflection.Component.Invoke.Deflection, bc);
2891 case FacComponent_Result:
2898 case Fac_CallRerouteing:
2900 fac->u.CallRerouteing.InvokeID);
2901 switch (fac->u.CallRerouteing.ComponentType) {
2902 case FacComponent_Invoke:
2904 fac->u.CallRerouteing.Component.Invoke.ReroutingReason,
2905 fac->u.CallRerouteing.Component.Invoke.ReroutingCounter);
2907 print_facility_Address(3, &fac->u.CallRerouteing.Component.Invoke.CalledAddress, bc);
2908 print_facility_Q931_Bc_Hlc_Llc_Uu(2, &fac->u.CallRerouteing.Component.Invoke.Q931ie, bc);
2910 print_facility_PresentedNumberUnscreened(3, &fac->u.CallRerouteing.Component.Invoke.LastRerouting, bc);
2912 fac->u.CallRerouteing.Component.Invoke.SubscriptionOption);
2913 if (fac->u.CallRerouteing.Component.Invoke.CallingPartySubaddress.Length) {
2915 print_facility_Subaddress(3, &fac->u.CallRerouteing.Component.Invoke.CallingPartySubaddress, bc);
2918 case FacComponent_Result:
2925 case Fac_InterrogateServedUserNumbers:
2927 fac->u.InterrogateServedUserNumbers.InvokeID);
2928 switch (fac->u.InterrogateServedUserNumbers.ComponentType) {
2929 case FacComponent_Invoke:
2932 case FacComponent_Result:
2934 if (fac->u.InterrogateServedUserNumbers.Component.Result.NumRecords) {
2935 for (Index = 0; Index < fac->u.InterrogateServedUserNumbers.Component.Result.NumRecords; ++Index) {
2937 print_facility_PartyNumber(3, &fac->u.InterrogateServedUserNumbers.Component.Result.List[Index], bc);
2945 case Fac_DivertingLegInformation1:
2946 chan_misdn_log(1, bc->
port,
" --> DivertingLegInformation1: InvokeID:%d Reason:%d SubscriptionOption:%d\n",
2947 fac->u.DivertingLegInformation1.InvokeID,
2948 fac->u.DivertingLegInformation1.DiversionReason,
2949 fac->u.DivertingLegInformation1.SubscriptionOption);
2950 if (fac->u.DivertingLegInformation1.DivertedToPresent) {
2952 print_facility_PresentedNumberUnscreened(2, &fac->u.DivertingLegInformation1.DivertedTo, bc);
2955 case Fac_DivertingLegInformation2:
2956 chan_misdn_log(1, bc->
port,
" --> DivertingLegInformation2: InvokeID:%d Reason:%d Count:%d\n",
2957 fac->u.DivertingLegInformation2.InvokeID,
2958 fac->u.DivertingLegInformation2.DiversionReason,
2959 fac->u.DivertingLegInformation2.DiversionCounter);
2960 if (fac->u.DivertingLegInformation2.DivertingPresent) {
2962 print_facility_PresentedNumberUnscreened(2, &fac->u.DivertingLegInformation2.Diverting, bc);
2964 if (fac->u.DivertingLegInformation2.OriginalCalledPresent) {
2966 print_facility_PresentedNumberUnscreened(2, &fac->u.DivertingLegInformation2.OriginalCalled, bc);
2969 case Fac_DivertingLegInformation3:
2970 chan_misdn_log(1, bc->
port,
" --> DivertingLegInformation3: InvokeID:%d PresentationAllowed:%d\n",
2971 fac->u.DivertingLegInformation3.InvokeID,
2972 fac->u.DivertingLegInformation3.PresentationAllowedIndicator);
2978 chan_misdn_log(1, bc->
port,
" --> calldeflect to: %s, presentable: %s\n", fac->u.CDeflection.DeflectedToNumber,
2979 fac->u.CDeflection.PresentationAllowed ?
"yes" :
"no");
2982 case Fac_AOCDCurrency:
2983 if (fac->u.AOCDcur.chargeNotAvailable) {
2985 }
else if (fac->u.AOCDcur.freeOfCharge) {
2987 }
else if (fac->u.AOCDchu.billingId >= 0) {
2988 chan_misdn_log(1, bc->
port,
" --> AOCD currency: currency:%s amount:%d multiplier:%d typeOfChargingInfo:%s billingId:%d\n",
2989 fac->u.AOCDcur.currency, fac->u.AOCDcur.currencyAmount, fac->u.AOCDcur.multiplier,
2990 (fac->u.AOCDcur.typeOfChargingInfo == 0) ?
"subTotal" :
"total", fac->u.AOCDcur.billingId);
2992 chan_misdn_log(1, bc->
port,
" --> AOCD currency: currency:%s amount:%d multiplier:%d typeOfChargingInfo:%s\n",
2993 fac->u.AOCDcur.currency, fac->u.AOCDcur.currencyAmount, fac->u.AOCDcur.multiplier,
2994 (fac->u.AOCDcur.typeOfChargingInfo == 0) ?
"subTotal" :
"total");
2997 case Fac_AOCDChargingUnit:
2998 if (fac->u.AOCDchu.chargeNotAvailable) {
3000 }
else if (fac->u.AOCDchu.freeOfCharge) {
3002 }
else if (fac->u.AOCDchu.billingId >= 0) {
3003 chan_misdn_log(1, bc->
port,
" --> AOCD charging unit: recordedUnits:%d typeOfChargingInfo:%s billingId:%d\n",
3004 fac->u.AOCDchu.recordedUnits, (fac->u.AOCDchu.typeOfChargingInfo == 0) ?
"subTotal" :
"total", fac->u.AOCDchu.billingId);
3006 chan_misdn_log(1, bc->
port,
" --> AOCD charging unit: recordedUnits:%d typeOfChargingInfo:%s\n",
3007 fac->u.AOCDchu.recordedUnits, (fac->u.AOCDchu.typeOfChargingInfo == 0) ?
"subTotal" :
"total");
3010 #if defined(AST_MISDN_ENHANCEMENTS) 3013 fac->u.ERROR.invokeId, fac->u.ERROR.errorValue);
3017 fac->u.RESULT.InvokeID);
3020 if (fac->u.REJECT.InvokeIDPresent) {
3022 fac->u.REJECT.InvokeID, fac->u.REJECT.Code);
3025 fac->u.REJECT.Code);
3028 case Fac_EctExecute:
3030 fac->u.EctExecute.InvokeID);
3032 case Fac_ExplicitEctExecute:
3034 fac->u.ExplicitEctExecute.InvokeID,
3035 fac->u.ExplicitEctExecute.LinkID);
3037 case Fac_RequestSubaddress:
3039 fac->u.RequestSubaddress.InvokeID);
3041 case Fac_SubaddressTransfer:
3043 fac->u.SubaddressTransfer.InvokeID);
3044 print_facility_Subaddress(1, &fac->u.SubaddressTransfer.Subaddress, bc);
3046 case Fac_EctLinkIdRequest:
3048 fac->u.EctLinkIdRequest.InvokeID);
3049 switch (fac->u.EctLinkIdRequest.ComponentType) {
3050 case FacComponent_Invoke:
3053 case FacComponent_Result:
3055 fac->u.EctLinkIdRequest.Component.Result.LinkID);
3063 fac->u.EctInform.InvokeID,
3064 fac->u.EctInform.Status);
3065 if (fac->u.EctInform.RedirectionPresent) {
3067 print_facility_PresentedNumberUnscreened(2, &fac->u.EctInform.Redirection, bc);
3070 case Fac_EctLoopTest:
3072 fac->u.EctLoopTest.InvokeID);
3073 switch (fac->u.EctLoopTest.ComponentType) {
3074 case FacComponent_Invoke:
3076 fac->u.EctLoopTest.Component.Invoke.CallTransferID);
3078 case FacComponent_Result:
3080 fac->u.EctLoopTest.Component.Result.LoopResult);
3086 case Fac_StatusRequest:
3088 fac->u.StatusRequest.InvokeID);
3089 switch (fac->u.StatusRequest.ComponentType) {
3090 case FacComponent_Invoke:
3092 fac->u.StatusRequest.Component.Invoke.CompatibilityMode);
3094 case FacComponent_Result:
3096 fac->u.StatusRequest.Component.Result.Status);
3102 case Fac_CallInfoRetain:
3104 fac->u.CallInfoRetain.InvokeID, fac->u.CallInfoRetain.CallLinkageID);
3106 case Fac_CCBSDeactivate:
3108 fac->u.CCBSDeactivate.InvokeID);
3109 switch (fac->u.CCBSDeactivate.ComponentType) {
3110 case FacComponent_Invoke:
3112 fac->u.CCBSDeactivate.Component.Invoke.CCBSReference);
3114 case FacComponent_Result:
3122 chan_misdn_log(1, bc->
port,
" --> CCBSErase: InvokeID:%d, CCBSReference:%d RecallMode:%d, Reason:%d\n",
3123 fac->u.CCBSErase.InvokeID, fac->u.CCBSErase.CCBSReference,
3124 fac->u.CCBSErase.RecallMode, fac->u.CCBSErase.Reason);
3126 print_facility_Address(2, &fac->u.CCBSErase.AddressOfB, bc);
3127 print_facility_Q931_Bc_Hlc_Llc(1, &fac->u.CCBSErase.Q931ie, bc);
3129 case Fac_CCBSRemoteUserFree:
3130 chan_misdn_log(1, bc->
port,
" --> CCBSRemoteUserFree: InvokeID:%d, CCBSReference:%d RecallMode:%d\n",
3131 fac->u.CCBSRemoteUserFree.InvokeID, fac->u.CCBSRemoteUserFree.CCBSReference,
3132 fac->u.CCBSRemoteUserFree.RecallMode);
3134 print_facility_Address(2, &fac->u.CCBSRemoteUserFree.AddressOfB, bc);
3135 print_facility_Q931_Bc_Hlc_Llc(1, &fac->u.CCBSRemoteUserFree.Q931ie, bc);
3139 fac->u.CCBSCall.InvokeID, fac->u.CCBSCall.CCBSReference);
3141 case Fac_CCBSStatusRequest:
3143 fac->u.CCBSStatusRequest.InvokeID);
3144 switch (fac->u.CCBSStatusRequest.ComponentType) {
3145 case FacComponent_Invoke:
3147 fac->u.CCBSStatusRequest.Component.Invoke.CCBSReference,
3148 fac->u.CCBSStatusRequest.Component.Invoke.RecallMode);
3149 print_facility_Q931_Bc_Hlc_Llc(2, &fac->u.CCBSStatusRequest.Component.Invoke.Q931ie, bc);
3151 case FacComponent_Result:
3153 fac->u.CCBSStatusRequest.Component.Result.Free);
3160 chan_misdn_log(1, bc->
port,
" --> CCBSBFree: InvokeID:%d, CCBSReference:%d RecallMode:%d\n",
3161 fac->u.CCBSBFree.InvokeID, fac->u.CCBSBFree.CCBSReference,
3162 fac->u.CCBSBFree.RecallMode);
3164 print_facility_Address(2, &fac->u.CCBSBFree.AddressOfB, bc);
3165 print_facility_Q931_Bc_Hlc_Llc(1, &fac->u.CCBSBFree.Q931ie, bc);
3167 case Fac_EraseCallLinkageID:
3169 fac->u.EraseCallLinkageID.InvokeID, fac->u.EraseCallLinkageID.CallLinkageID);
3171 case Fac_CCBSStopAlerting:
3172 chan_misdn_log(1, bc->
port,
" --> CCBSStopAlerting: InvokeID:%d, CCBSReference:%d\n",
3173 fac->u.CCBSStopAlerting.InvokeID, fac->u.CCBSStopAlerting.CCBSReference);
3175 case Fac_CCBSRequest:
3177 fac->u.CCBSRequest.InvokeID);
3178 switch (fac->u.CCBSRequest.ComponentType) {
3179 case FacComponent_Invoke:
3181 fac->u.CCBSRequest.Component.Invoke.CallLinkageID);
3183 case FacComponent_Result:
3185 fac->u.CCBSRequest.Component.Result.CCBSReference,
3186 fac->u.CCBSRequest.Component.Result.RecallMode);
3192 case Fac_CCBSInterrogate:
3194 fac->u.CCBSInterrogate.InvokeID);
3195 switch (fac->u.CCBSInterrogate.ComponentType) {
3196 case FacComponent_Invoke:
3198 if (fac->u.CCBSInterrogate.Component.Invoke.CCBSReferencePresent) {
3200 fac->u.CCBSInterrogate.Component.Invoke.CCBSReference);
3202 if (fac->u.CCBSInterrogate.Component.Invoke.AParty.LengthOfNumber) {
3204 print_facility_PartyNumber(3, &fac->u.CCBSInterrogate.Component.Invoke.AParty, bc);
3207 case FacComponent_Result:
3209 fac->u.CCBSInterrogate.Component.Result.RecallMode);
3210 if (fac->u.CCBSInterrogate.Component.Result.NumRecords) {
3211 for (Index = 0; Index < fac->u.CCBSInterrogate.Component.Result.NumRecords; ++Index) {
3213 print_facility_CallInformation(3, &fac->u.CCBSInterrogate.Component.Result.CallDetails[Index], bc);
3221 case Fac_CCNRRequest:
3223 fac->u.CCNRRequest.InvokeID);
3224 switch (fac->u.CCNRRequest.ComponentType) {
3225 case FacComponent_Invoke:
3227 fac->u.CCNRRequest.Component.Invoke.CallLinkageID);
3229 case FacComponent_Result:
3231 fac->u.CCNRRequest.Component.Result.CCBSReference,
3232 fac->u.CCNRRequest.Component.Result.RecallMode);
3238 case Fac_CCNRInterrogate:
3240 fac->u.CCNRInterrogate.InvokeID);
3241 switch (fac->u.CCNRInterrogate.ComponentType) {
3242 case FacComponent_Invoke:
3244 if (fac->u.CCNRInterrogate.Component.Invoke.CCBSReferencePresent) {
3246 fac->u.CCNRInterrogate.Component.Invoke.CCBSReference);
3248 if (fac->u.CCNRInterrogate.Component.Invoke.AParty.LengthOfNumber) {
3250 print_facility_PartyNumber(3, &fac->u.CCNRInterrogate.Component.Invoke.AParty, bc);
3253 case FacComponent_Result:
3255 fac->u.CCNRInterrogate.Component.Result.RecallMode);
3256 if (fac->u.CCNRInterrogate.Component.Result.NumRecords) {
3257 for (Index = 0; Index < fac->u.CCNRInterrogate.Component.Result.NumRecords; ++Index) {
3259 print_facility_CallInformation(3, &fac->u.CCNRInterrogate.Component.Result.CallDetails[Index], bc);
3267 case Fac_CCBS_T_Call:
3269 fac->u.CCBS_T_Call.InvokeID);
3271 case Fac_CCBS_T_Suspend:
3273 fac->u.CCBS_T_Suspend.InvokeID);
3275 case Fac_CCBS_T_Resume:
3277 fac->u.CCBS_T_Resume.InvokeID);
3279 case Fac_CCBS_T_RemoteUserFree:
3281 fac->u.CCBS_T_RemoteUserFree.InvokeID);
3283 case Fac_CCBS_T_Available:
3285 fac->u.CCBS_T_Available.InvokeID);
3287 case Fac_CCBS_T_Request:
3289 fac->u.CCBS_T_Request.InvokeID);
3290 switch (fac->u.CCBS_T_Request.ComponentType) {
3291 case FacComponent_Invoke:
3294 print_facility_Address(3, &fac->u.CCBS_T_Request.Component.Invoke.Destination, bc);
3295 print_facility_Q931_Bc_Hlc_Llc(2, &fac->u.CCBS_T_Request.Component.Invoke.Q931ie, bc);
3296 if (fac->u.CCBS_T_Request.Component.Invoke.RetentionSupported) {
3299 if (fac->u.CCBS_T_Request.Component.Invoke.PresentationAllowedIndicatorPresent) {
3301 fac->u.CCBS_T_Request.Component.Invoke.PresentationAllowedIndicator);
3303 if (fac->u.CCBS_T_Request.Component.Invoke.Originating.Party.LengthOfNumber) {
3305 print_facility_Address(3, &fac->u.CCBS_T_Request.Component.Invoke.Originating, bc);
3308 case FacComponent_Result:
3310 fac->u.CCBS_T_Request.Component.Result.RetentionSupported);
3316 case Fac_CCNR_T_Request:
3318 fac->u.CCNR_T_Request.InvokeID);
3319 switch (fac->u.CCNR_T_Request.ComponentType) {
3320 case FacComponent_Invoke:
3323 print_facility_Address(3, &fac->u.CCNR_T_Request.Component.Invoke.Destination, bc);
3324 print_facility_Q931_Bc_Hlc_Llc(2, &fac->u.CCNR_T_Request.Component.Invoke.Q931ie, bc);
3325 if (fac->u.CCNR_T_Request.Component.Invoke.RetentionSupported) {
3328 if (fac->u.CCNR_T_Request.Component.Invoke.PresentationAllowedIndicatorPresent) {
3330 fac->u.CCNR_T_Request.Component.Invoke.PresentationAllowedIndicator);
3332 if (fac->u.CCNR_T_Request.Component.Invoke.Originating.Party.LengthOfNumber) {
3334 print_facility_Address(3, &fac->u.CCNR_T_Request.Component.Invoke.Originating, bc);
3337 case FacComponent_Result:
3339 fac->u.CCNR_T_Request.Component.Result.RetentionSupported);
3388 len_prefix = strlen(str_prefix);
3393 len_main = strlen(str_main);
3394 len_total = len_prefix + len_main;
3395 if (size <= len_total) {
3397 len_over = len_total + 1 -
size;
3398 if (len_over <= len_main) {
3399 len_main -= len_over;
3401 len_over -= len_main;
3403 len_prefix -= len_over;
3407 memmove(str_main + len_prefix, str_main, len_main);
3409 memcpy(str_main, str_prefix, len_prefix);
3410 str_main[len_prefix + len_main] =
'\0';
3430 switch (number_type) {
3453 misdn_cfg_get(port, type_prefix, num_prefix,
sizeof(num_prefix));
3477 case Fac_AOCDCurrency:
3489 if (bc->
AOCD.
currency.billingId >= 0 && snprintf(buf,
sizeof(buf),
"%d", bc->
AOCD.
currency.billingId) <
sizeof(buf)) {
3496 case Fac_AOCDChargingUnit:
3506 if (snprintf(buf,
sizeof(buf),
"%d", bc->
AOCD.
chargingUnit.recordedUnits) <
sizeof(buf)) {
3531 struct sigaction sa;
3534 sa.sa_flags = SA_NODEFER;
3535 sigemptyset(&sa.sa_mask);
3536 sigaddset(&sa.sa_mask, SIGUSR1);
3537 sigaction(SIGUSR1, &sa,
NULL);
3539 sem_post((sem_t *)data);
3546 if (poll(
NULL, 0, wait) < 0) {
3559 if (sem_init(&blocker, 0, 0)) {
3560 perror(
"chan_misdn: Failed to initialize semaphore!");
3569 while (sem_wait(&blocker) && --i) {
3571 sem_destroy(&blocker);
3579 cb_log(4, 0,
"Joining misdn_tasks thread\n");
3621 const int *data = vdata;
3630 struct timeval tv_end, tv_now;
3668 goto misdn_overlap_dial_task_disconnect;
3671 misdn_overlap_dial_task_disconnect:
3683 static const char *
const dtmf_tones[] = {
3685 "!941+1336/100,!0/100",
3686 "!697+1209/100,!0/100",
3687 "!697+1336/100,!0/100",
3688 "!697+1477/100,!0/100",
3689 "!770+1209/100,!0/100",
3690 "!770+1336/100,!0/100",
3691 "!770+1477/100,!0/100",
3692 "!852+1209/100,!0/100",
3693 "!852+1336/100,!0/100",
3694 "!852+1477/100,!0/100",
3695 "!697+1633/100,!0/100",
3696 "!770+1633/100,!0/100",
3697 "!852+1633/100,!0/100",
3698 "!941+1633/100,!0/100",
3699 "!941+1209/100,!0/100",
3700 "!941+1477/100,!0/100",
3705 if (digit >=
'0' && digit <=
'9') {
3707 }
else if (digit >=
'A' && digit <=
'D') {
3709 }
else if (digit ==
'*') {
3711 }
else if (digit ==
'#') {
3726 e->
command =
"misdn set debug [on|off]";
3728 "Usage: misdn set debug {on|off|<level>} [only] | [port <port> [only]]\n" 3729 " Set the debug level of the mISDN channel.\n";
3739 if (!strcasecmp(a->
argv[3],
"on")) {
3741 }
else if (!strcasecmp(a->
argv[3],
"off")) {
3743 }
else if (isdigit(a->
argv[3][0])) {
3744 level = atoi(a->
argv[3]);
3756 if (strncasecmp(a->
argv[4],
"only", strlen(a->
argv[4]))) {
3764 misdn_debug[i] = level;
3765 misdn_debug_only[i] = only;
3767 ast_cli(a->
fd,
"changing debug level for all ports to %d%s\n", misdn_debug[0], only ?
" (only)" :
"");
3774 if (strncasecmp(a->
argv[4],
"port", strlen(a->
argv[4])))
3776 port = atoi(a->
argv[5]);
3777 if (port <= 0 || port > max_ports) {
3778 switch (max_ports) {
3780 ast_cli(a->
fd,
"port number not valid! no ports available so you won't get lucky with any number here...\n");
3783 ast_cli(a->
fd,
"port number not valid! only port 1 is available.\n");
3786 ast_cli(a->
fd,
"port number not valid! only ports 1 to %d are available.\n", max_ports);
3791 if (strncasecmp(a->
argv[6],
"only", strlen(a->
argv[6]))) {
3794 misdn_debug_only[port] = 1;
3797 misdn_debug_only[port] = 0;
3799 misdn_debug[port] = level;
3800 ast_cli(a->
fd,
"changing debug level to %d%s for port %d\n", misdn_debug[port], misdn_debug_only[port] ?
" (only)" :
"", port);
3811 e->
command =
"misdn set crypt debug";
3813 "Usage: misdn set crypt debug <level>\n" 3814 " Set the crypt debug level of the mISDN channel. Level\n" 3815 " must be 1 or 2.\n";
3834 e->
command =
"misdn port block";
3836 "Usage: misdn port block <port>\n" 3837 " Block the specified port by <port>.\n";
3856 e->
command =
"misdn port unblock";
3858 "Usage: misdn port unblock <port>\n" 3859 " Unblock the port specified by <port>.\n";
3878 e->
command =
"misdn restart port";
3880 "Usage: misdn restart port <port>\n" 3881 " Restart the given port.\n";
3900 e->
command =
"misdn restart pid";
3902 "Usage: misdn restart pid <pid>\n" 3903 " Restart the given pid\n";
3924 "Usage: misdn port up <port>\n" 3925 " Try to establish L1 on the given port.\n";
3944 e->
command =
"misdn port down";
3946 "Usage: misdn port down <port>\n" 3947 " Try to deactivate the L1 on the given port.\n";
3981 ast_cli(fd,
"[%s] %s (Default: %s)\n\t%s\n", section, name, def, desc);
3983 ast_cli(fd,
"[%s] %s\n\t%s\n", section, name, desc);
3997 e->
command =
"misdn show config";
3999 "Usage: misdn show config [<port> | description <config element> | descriptions [general|ports]]\n" 4000 " Use 0 for <port> to only print the general config.\n";
4007 if (!strcmp(a->
argv[3],
"description")) {
4018 }
else if (!strcmp(a->
argv[3],
"descriptions")) {
4019 if ((a->
argc == 4) || ((a->
argc == 5) && !strcmp(a->
argv[4],
"general"))) {
4026 if ((a->
argc == 4) || ((a->
argc == 5) && !strcmp(a->
argv[4],
"ports"))) {
4034 }
else if (!sscanf(a->
argv[3],
"%5d", &onlyport) || onlyport < 0) {
4040 if (a->
argc == 3 || onlyport == 0) {
4041 ast_cli(a->
fd,
"mISDN General-Config:\n");
4044 ast_cli(a->
fd,
"%-36s%s", buffer, !(linebreak % 2) ?
"\n" :
"");
4056 ast_cli(a->
fd,
"%-36s%s", buffer, !(linebreak % 2) ?
"\n" :
"");
4064 ast_cli(a->
fd,
"[PORT %d]\n", onlyport);
4067 ast_cli(a->
fd,
"%-36s%s", buffer, !(linebreak % 2) ?
"\n" :
"");
4071 ast_cli(a->
fd,
"Port %d is not active!\n", onlyport);
4105 static char state[8];
4111 for (i = 0; i <
ARRAY_LEN(state_array); i++) {
4112 if (state_array[i].state == p->
state) {
4113 return state_array[i].
txt;
4117 snprintf(state,
sizeof(state),
"%d", p->
state) ;
4139 misdn_debug[i] = cfg_debug;
4140 misdn_debug_only[i] = 0;
4150 "Usage: misdn reload\n" 4151 " Reload internal mISDN config, read from the config\n" 4162 ast_cli(a->
fd,
"Reloading mISDN configuration\n");
4172 "* Pid:%d Port:%d Ch:%d Mode:%s Orig:%s dialed:%s\n" 4173 " --> caller:\"%s\" <%s>\n" 4174 " --> redirecting-from:\"%s\" <%s>\n" 4175 " --> redirecting-to:\"%s\" <%s>\n" 4176 " --> context:%s state:%s\n",
4180 bc->
nt ?
"NT" :
"TE",
4193 if (misdn_debug[bc->
port] > 0) {
4195 " --> astname: %s\n" 4196 " --> ch_l3id: %x\n" 4197 " --> ch_addr: %x\n" 4198 " --> bc_addr: %x\n" 4199 " --> bc_l3id: %x\n" 4200 " --> display: %s\n" 4201 " --> activated: %d\n" 4203 " --> capability: %s\n" 4205 " --> pipeline: %s\n" 4207 " --> echo_cancel: %d\n" 4209 " --> notone : rx %d tx:%d\n" 4210 " --> bc_hold: %d\n",
4236 e->
command =
"misdn show channels";
4238 "Usage: misdn show channels\n" 4239 " Show the internal mISDN channel list\n";
4249 ast_cli(a->
fd,
"Channel List: %p\n", cl_te);
4258 for (help = cl_te; help; help = help->
next) {
4263 ast_cli(a->
fd,
"chan_list obj. with l3id:%x has no bc and no ast Leg\n", help->
l3id);
4266 ast_cli(a->
fd,
"bc with pid:%d has no Ast Leg\n", bc->
pid);
4269 if (misdn_debug[0] > 2) {
4270 ast_cli(a->
fd,
"Bc:%p Ast:%p\n", bc, ast);
4276 ast_cli(a->
fd,
"ITS A HELD CALL BC:\n");
4279 " --> caller:\"%s\" <%s>\n" 4280 " --> hold_port: %d\n" 4281 " --> hold_channel: %d\n",
4290 ast_cli(a->
fd,
"* Channel in unknown STATE !!! Exten:%s, Callerid:%s\n",
4309 e->
command =
"misdn show channel";
4311 "Usage: misdn show channel <channel>\n" 4312 " Show an internal mISDN channel\n.";
4323 for (help = cl_te; help; help = help->
next) {
4343 e->
command =
"misdn set tics";
4345 "Usage: misdn set tics <value>\n";
4367 e->
command =
"misdn show stacks";
4369 "Usage: misdn show stacks\n" 4370 " Show internal mISDN stack_list.\n";
4386 ast_cli(a->
fd,
" %s Debug:%d%s\n", buf, misdn_debug[port], misdn_debug_only[port] ?
"(only)" :
"");
4398 e->
command =
"misdn show ports stats";
4400 "Usage: misdn show ports stats\n" 4401 " Show mISDNs channel's call statistics per port.\n";
4411 ast_cli(a->
fd,
"Port\tin_calls\tout_calls\n");
4414 ast_cli(a->
fd,
"%d\t%d\t\t%d\n", port, misdn_in_calls[port], misdn_out_calls[port]);
4428 e->
command =
"misdn show port";
4430 "Usage: misdn show port <port>\n" 4431 " Show detailed information for given port.\n";
4441 port = atoi(a->
argv[3]);
4445 ast_cli(a->
fd,
" %s Debug:%d%s\n", buf, misdn_debug[port], misdn_debug_only[port] ?
"(only)" :
"");
4450 #if defined(AST_MISDN_ENHANCEMENTS) && defined(CCBS_TEST_MESSAGES) 4451 static const struct FacParm Fac_Msgs[] = {
4453 [0].Function = Fac_ERROR,
4454 [0].u.ERROR.invokeId = 8,
4455 [0].u.ERROR.errorValue = FacError_CCBS_AlreadyAccepted,
4457 [1].Function = Fac_RESULT,
4458 [1].u.RESULT.InvokeID = 9,
4460 [2].Function = Fac_REJECT,
4461 [2].u.REJECT.Code = FacReject_Gen_BadlyStructuredComponent,
4463 [3].Function = Fac_REJECT,
4464 [3].u.REJECT.InvokeIDPresent = 1,
4465 [3].u.REJECT.InvokeID = 10,
4466 [3].u.REJECT.Code = FacReject_Inv_InitiatorReleasing,
4468 [4].Function = Fac_REJECT,
4469 [4].u.REJECT.InvokeIDPresent = 1,
4470 [4].u.REJECT.InvokeID = 11,
4471 [4].u.REJECT.Code = FacReject_Res_MistypedResult,
4473 [5].Function = Fac_REJECT,
4474 [5].u.REJECT.InvokeIDPresent = 1,
4475 [5].u.REJECT.InvokeID = 12,
4476 [5].u.REJECT.Code = FacReject_Err_ErrorResponseUnexpected,
4478 [6].Function = Fac_StatusRequest,
4479 [6].u.StatusRequest.InvokeID = 13,
4480 [6].u.StatusRequest.ComponentType = FacComponent_Invoke,
4481 [6].u.StatusRequest.Component.Invoke.Q931ie.Bc.Length = 2,
4482 [6].u.StatusRequest.Component.Invoke.Q931ie.Bc.Contents =
"AB",
4483 [6].u.StatusRequest.Component.Invoke.Q931ie.Llc.Length = 3,
4484 [6].u.StatusRequest.Component.Invoke.Q931ie.Llc.Contents =
"CDE",
4485 [6].u.StatusRequest.Component.Invoke.Q931ie.Hlc.Length = 4,
4486 [6].u.StatusRequest.Component.Invoke.Q931ie.Hlc.Contents =
"FGHI",
4487 [6].u.StatusRequest.Component.Invoke.CompatibilityMode = 1,
4489 [7].Function = Fac_StatusRequest,
4490 [7].u.StatusRequest.InvokeID = 14,
4491 [7].u.StatusRequest.ComponentType = FacComponent_Result,
4492 [7].u.StatusRequest.Component.Result.Status = 2,
4494 [8].Function = Fac_CallInfoRetain,
4495 [8].u.CallInfoRetain.InvokeID = 15,
4496 [8].u.CallInfoRetain.CallLinkageID = 115,
4498 [9].Function = Fac_EraseCallLinkageID,
4499 [9].u.EraseCallLinkageID.InvokeID = 16,
4500 [9].u.EraseCallLinkageID.CallLinkageID = 105,
4502 [10].Function = Fac_CCBSDeactivate,
4503 [10].u.CCBSDeactivate.InvokeID = 17,
4504 [10].u.CCBSDeactivate.ComponentType = FacComponent_Invoke,
4505 [10].u.CCBSDeactivate.Component.Invoke.CCBSReference = 2,
4507 [11].Function = Fac_CCBSDeactivate,
4508 [11].u.CCBSDeactivate.InvokeID = 18,
4509 [11].u.CCBSDeactivate.ComponentType = FacComponent_Result,
4511 [12].Function = Fac_CCBSErase,
4512 [12].u.CCBSErase.InvokeID = 19,
4513 [12].u.CCBSErase.Q931ie.Bc.Length = 2,
4514 [12].u.CCBSErase.Q931ie.Bc.Contents =
"JK",
4515 [12].u.CCBSErase.AddressOfB.Party.Type = 0,
4516 [12].u.CCBSErase.AddressOfB.Party.LengthOfNumber = 5,
4517 [12].u.CCBSErase.AddressOfB.Party.Number =
"33403",
4518 [12].u.CCBSErase.AddressOfB.Subaddress.Type = 0,
4519 [12].u.CCBSErase.AddressOfB.Subaddress.Length = 4,
4520 [12].u.CCBSErase.AddressOfB.Subaddress.u.UserSpecified.Information =
"3748",
4521 [12].u.CCBSErase.RecallMode = 1,
4522 [12].u.CCBSErase.CCBSReference = 102,
4523 [12].u.CCBSErase.Reason = 3,
4525 [13].Function = Fac_CCBSErase,
4526 [13].u.CCBSErase.InvokeID = 20,
4527 [13].u.CCBSErase.Q931ie.Bc.Length = 2,
4528 [13].u.CCBSErase.Q931ie.Bc.Contents =
"JK",
4529 [13].u.CCBSErase.AddressOfB.Party.Type = 1,
4530 [13].u.CCBSErase.AddressOfB.Party.LengthOfNumber = 11,
4531 [13].u.CCBSErase.AddressOfB.Party.TypeOfNumber = 1,
4532 [13].u.CCBSErase.AddressOfB.Party.Number =
"18003020102",
4533 [13].u.CCBSErase.AddressOfB.Subaddress.Type = 0,
4534 [13].u.CCBSErase.AddressOfB.Subaddress.Length = 4,
4535 [13].u.CCBSErase.AddressOfB.Subaddress.u.UserSpecified.OddCountPresent = 1,
4536 [13].u.CCBSErase.AddressOfB.Subaddress.u.UserSpecified.OddCount = 1,
4537 [13].u.CCBSErase.AddressOfB.Subaddress.u.UserSpecified.Information =
"3748",
4538 [13].u.CCBSErase.RecallMode = 1,
4539 [13].u.CCBSErase.CCBSReference = 102,
4540 [13].u.CCBSErase.Reason = 3,
4542 [14].Function = Fac_CCBSErase,
4543 [14].u.CCBSErase.InvokeID = 21,
4544 [14].u.CCBSErase.Q931ie.Bc.Length = 2,
4545 [14].u.CCBSErase.Q931ie.Bc.Contents =
"JK",
4546 [14].u.CCBSErase.AddressOfB.Party.Type = 2,
4547 [14].u.CCBSErase.AddressOfB.Party.LengthOfNumber = 4,
4548 [14].u.CCBSErase.AddressOfB.Party.Number =
"1803",
4549 [14].u.CCBSErase.AddressOfB.Subaddress.Type = 1,
4550 [14].u.CCBSErase.AddressOfB.Subaddress.Length = 4,
4551 [14].u.CCBSErase.AddressOfB.Subaddress.u.Nsap =
"6492",
4552 [14].u.CCBSErase.RecallMode = 1,
4553 [14].u.CCBSErase.CCBSReference = 102,
4554 [14].u.CCBSErase.Reason = 3,
4556 [15].Function = Fac_CCBSErase,
4557 [15].u.CCBSErase.InvokeID = 22,
4558 [15].u.CCBSErase.Q931ie.Bc.Length = 2,
4559 [15].u.CCBSErase.Q931ie.Bc.Contents =
"JK",
4560 [15].u.CCBSErase.AddressOfB.Party.Type = 3,
4561 [15].u.CCBSErase.AddressOfB.Party.LengthOfNumber = 4,
4562 [15].u.CCBSErase.AddressOfB.Party.Number =
"1803",
4563 [15].u.CCBSErase.RecallMode = 1,
4564 [15].u.CCBSErase.CCBSReference = 102,
4565 [15].u.CCBSErase.Reason = 3,
4567 [16].Function = Fac_CCBSErase,
4568 [16].u.CCBSErase.InvokeID = 23,
4569 [16].u.CCBSErase.Q931ie.Bc.Length = 2,
4570 [16].u.CCBSErase.Q931ie.Bc.Contents =
"JK",
4571 [16].u.CCBSErase.AddressOfB.Party.Type = 4,
4572 [16].u.CCBSErase.AddressOfB.Party.LengthOfNumber = 4,
4573 [16].u.CCBSErase.AddressOfB.Party.Number =
"1803",
4574 [16].u.CCBSErase.RecallMode = 1,
4575 [16].u.CCBSErase.CCBSReference = 102,
4576 [16].u.CCBSErase.Reason = 3,
4578 [17].Function = Fac_CCBSErase,
4579 [17].u.CCBSErase.InvokeID = 24,
4580 [17].u.CCBSErase.Q931ie.Bc.Length = 2,
4581 [17].u.CCBSErase.Q931ie.Bc.Contents =
"JK",
4582 [17].u.CCBSErase.AddressOfB.Party.Type = 5,
4583 [17].u.CCBSErase.AddressOfB.Party.LengthOfNumber = 11,
4584 [17].u.CCBSErase.AddressOfB.Party.TypeOfNumber = 4,
4585 [17].u.CCBSErase.AddressOfB.Party.Number =
"18003020102",
4586 [17].u.CCBSErase.RecallMode = 1,
4587 [17].u.CCBSErase.CCBSReference = 102,
4588 [17].u.CCBSErase.Reason = 3,
4590 [18].Function = Fac_CCBSErase,
4591 [18].u.CCBSErase.InvokeID = 25,
4592 [18].u.CCBSErase.Q931ie.Bc.Length = 2,
4593 [18].u.CCBSErase.Q931ie.Bc.Contents =
"JK",
4594 [18].u.CCBSErase.AddressOfB.Party.Type = 8,
4595 [18].u.CCBSErase.AddressOfB.Party.LengthOfNumber = 4,
4596 [18].u.CCBSErase.AddressOfB.Party.Number =
"1803",
4597 [18].u.CCBSErase.RecallMode = 1,
4598 [18].u.CCBSErase.CCBSReference = 102,
4599 [18].u.CCBSErase.Reason = 3,
4601 [19].Function = Fac_CCBSRemoteUserFree,
4602 [19].u.CCBSRemoteUserFree.InvokeID = 26,
4603 [19].u.CCBSRemoteUserFree.Q931ie.Bc.Length = 2,
4604 [19].u.CCBSRemoteUserFree.Q931ie.Bc.Contents =
"JK",
4605 [19].u.CCBSRemoteUserFree.AddressOfB.Party.Type = 8,
4606 [19].u.CCBSRemoteUserFree.AddressOfB.Party.LengthOfNumber = 4,
4607 [19].u.CCBSRemoteUserFree.AddressOfB.Party.Number =
"1803",
4608 [19].u.CCBSRemoteUserFree.RecallMode = 1,
4609 [19].u.CCBSRemoteUserFree.CCBSReference = 102,
4611 [20].Function = Fac_CCBSCall,
4612 [20].u.CCBSCall.InvokeID = 27,
4613 [20].u.CCBSCall.CCBSReference = 115,
4615 [21].Function = Fac_CCBSStatusRequest,
4616 [21].u.CCBSStatusRequest.InvokeID = 28,
4617 [21].u.CCBSStatusRequest.ComponentType = FacComponent_Invoke,
4618 [21].u.CCBSStatusRequest.Component.Invoke.Q931ie.Bc.Length = 2,
4619 [21].u.CCBSStatusRequest.Component.Invoke.Q931ie.Bc.Contents =
"JK",
4620 [21].u.CCBSStatusRequest.Component.Invoke.RecallMode = 1,
4621 [21].u.CCBSStatusRequest.Component.Invoke.CCBSReference = 102,
4623 [22].Function = Fac_CCBSStatusRequest,
4624 [22].u.CCBSStatusRequest.InvokeID = 29,
4625 [22].u.CCBSStatusRequest.ComponentType = FacComponent_Result,
4626 [22].u.CCBSStatusRequest.Component.Result.Free = 1,
4628 [23].Function = Fac_CCBSBFree,
4629 [23].u.CCBSBFree.InvokeID = 30,
4630 [23].u.CCBSBFree.Q931ie.Bc.Length = 2,
4631 [23].u.CCBSBFree.Q931ie.Bc.Contents =
"JK",
4632 [23].u.CCBSBFree.AddressOfB.Party.Type = 8,
4633 [23].u.CCBSBFree.AddressOfB.Party.LengthOfNumber = 4,
4634 [23].u.CCBSBFree.AddressOfB.Party.Number =
"1803",
4635 [23].u.CCBSBFree.RecallMode = 1,
4636 [23].u.CCBSBFree.CCBSReference = 14,
4638 [24].Function = Fac_CCBSStopAlerting,
4639 [24].u.CCBSStopAlerting.InvokeID = 31,
4640 [24].u.CCBSStopAlerting.CCBSReference = 37,
4642 [25].Function = Fac_CCBSRequest,
4643 [25].u.CCBSRequest.InvokeID = 32,
4644 [25].u.CCBSRequest.ComponentType = FacComponent_Invoke,
4645 [25].u.CCBSRequest.Component.Invoke.CallLinkageID = 57,
4647 [26].Function = Fac_CCBSRequest,
4648 [26].u.CCBSRequest.InvokeID = 33,
4649 [26].u.CCBSRequest.ComponentType = FacComponent_Result,
4650 [26].u.CCBSRequest.Component.Result.RecallMode = 1,
4651 [26].u.CCBSRequest.Component.Result.CCBSReference = 102,
4653 [27].Function = Fac_CCBSInterrogate,
4654 [27].u.CCBSInterrogate.InvokeID = 34,
4655 [27].u.CCBSInterrogate.ComponentType = FacComponent_Invoke,
4656 [27].u.CCBSInterrogate.Component.Invoke.AParty.Type = 8,
4657 [27].u.CCBSInterrogate.Component.Invoke.AParty.LengthOfNumber = 4,
4658 [27].u.CCBSInterrogate.Component.Invoke.AParty.Number =
"1803",
4659 [27].u.CCBSInterrogate.Component.Invoke.CCBSReferencePresent = 1,
4660 [27].u.CCBSInterrogate.Component.Invoke.CCBSReference = 76,
4662 [28].Function = Fac_CCBSInterrogate,
4663 [28].u.CCBSInterrogate.InvokeID = 35,
4664 [28].u.CCBSInterrogate.ComponentType = FacComponent_Invoke,
4665 [28].u.CCBSInterrogate.Component.Invoke.AParty.Type = 8,
4666 [28].u.CCBSInterrogate.Component.Invoke.AParty.LengthOfNumber = 4,
4667 [28].u.CCBSInterrogate.Component.Invoke.AParty.Number =
"1803",
4669 [29].Function = Fac_CCBSInterrogate,
4670 [29].u.CCBSInterrogate.InvokeID = 36,
4671 [29].u.CCBSInterrogate.ComponentType = FacComponent_Invoke,
4672 [29].u.CCBSInterrogate.Component.Invoke.CCBSReferencePresent = 1,
4673 [29].u.CCBSInterrogate.Component.Invoke.CCBSReference = 76,
4675 [30].Function = Fac_CCBSInterrogate,
4676 [30].u.CCBSInterrogate.InvokeID = 37,
4677 [30].u.CCBSInterrogate.ComponentType = FacComponent_Invoke,
4679 [31].Function = Fac_CCBSInterrogate,
4680 [31].u.CCBSInterrogate.InvokeID = 38,
4681 [31].u.CCBSInterrogate.ComponentType = FacComponent_Result,
4682 [31].u.CCBSInterrogate.Component.Result.RecallMode = 1,
4684 [32].Function = Fac_CCBSInterrogate,
4685 [32].u.CCBSInterrogate.InvokeID = 39,
4686 [32].u.CCBSInterrogate.ComponentType = FacComponent_Result,
4687 [32].u.CCBSInterrogate.Component.Result.RecallMode = 1,
4688 [32].u.CCBSInterrogate.Component.Result.NumRecords = 1,
4689 [32].u.CCBSInterrogate.Component.Result.CallDetails[0].CCBSReference = 12,
4690 [32].u.CCBSInterrogate.Component.Result.CallDetails[0].Q931ie.Bc.Length = 2,
4691 [32].u.CCBSInterrogate.Component.Result.CallDetails[0].Q931ie.Bc.Contents =
"JK",
4692 [32].u.CCBSInterrogate.Component.Result.CallDetails[0].AddressOfB.Party.Type = 8,
4693 [32].u.CCBSInterrogate.Component.Result.CallDetails[0].AddressOfB.Party.LengthOfNumber = 4,
4694 [32].u.CCBSInterrogate.Component.Result.CallDetails[0].AddressOfB.Party.Number =
"1803",
4695 [32].u.CCBSInterrogate.Component.Result.CallDetails[0].SubaddressOfA.Type = 1,
4696 [32].u.CCBSInterrogate.Component.Result.CallDetails[0].SubaddressOfA.Length = 4,
4697 [32].u.CCBSInterrogate.Component.Result.CallDetails[0].SubaddressOfA.u.Nsap =
"6492",
4699 [33].Function = Fac_CCBSInterrogate,
4700 [33].u.CCBSInterrogate.InvokeID = 40,
4701 [33].u.CCBSInterrogate.ComponentType = FacComponent_Result,
4702 [33].u.CCBSInterrogate.Component.Result.RecallMode = 1,
4703 [33].u.CCBSInterrogate.Component.Result.NumRecords = 2,
4704 [33].u.CCBSInterrogate.Component.Result.CallDetails[0].CCBSReference = 12,
4705 [33].u.CCBSInterrogate.Component.Result.CallDetails[0].Q931ie.Bc.Length = 2,
4706 [33].u.CCBSInterrogate.Component.Result.CallDetails[0].Q931ie.Bc.Contents =
"JK",
4707 [33].u.CCBSInterrogate.Component.Result.CallDetails[0].AddressOfB.Party.Type = 8,
4708 [33].u.CCBSInterrogate.Component.Result.CallDetails[0].AddressOfB.Party.LengthOfNumber = 4,
4709 [33].u.CCBSInterrogate.Component.Result.CallDetails[0].AddressOfB.Party.Number =
"1803",
4710 [33].u.CCBSInterrogate.Component.Result.CallDetails[1].CCBSReference = 102,
4711 [33].u.CCBSInterrogate.Component.Result.CallDetails[1].Q931ie.Bc.Length = 2,
4712 [33].u.CCBSInterrogate.Component.Result.CallDetails[1].Q931ie.Bc.Contents =
"LM",
4713 [33].u.CCBSInterrogate.Component.Result.CallDetails[1].AddressOfB.Party.Type = 8,
4714 [33].u.CCBSInterrogate.Component.Result.CallDetails[1].AddressOfB.Party.LengthOfNumber = 4,
4715 [33].u.CCBSInterrogate.Component.Result.CallDetails[1].AddressOfB.Party.Number =
"6229",
4716 [33].u.CCBSInterrogate.Component.Result.CallDetails[1].AddressOfB.Subaddress.Type = 1,
4717 [33].u.CCBSInterrogate.Component.Result.CallDetails[1].AddressOfB.Subaddress.Length = 4,
4718 [33].u.CCBSInterrogate.Component.Result.CallDetails[1].AddressOfB.Subaddress.u.Nsap =
"8592",
4719 [33].u.CCBSInterrogate.Component.Result.CallDetails[1].SubaddressOfA.Type = 1,
4720 [33].u.CCBSInterrogate.Component.Result.CallDetails[1].SubaddressOfA.Length = 4,
4721 [33].u.CCBSInterrogate.Component.Result.CallDetails[1].SubaddressOfA.u.Nsap =
"6492",
4723 [34].Function = Fac_CCNRRequest,
4724 [34].u.CCNRRequest.InvokeID = 512,
4725 [34].u.CCNRRequest.ComponentType = FacComponent_Invoke,
4726 [34].u.CCNRRequest.Component.Invoke.CallLinkageID = 57,
4728 [35].Function = Fac_CCNRRequest,
4729 [35].u.CCNRRequest.InvokeID = 150,
4730 [35].u.CCNRRequest.ComponentType = FacComponent_Result,
4731 [35].u.CCNRRequest.Component.Result.RecallMode = 1,
4732 [35].u.CCNRRequest.Component.Result.CCBSReference = 102,
4734 [36].Function = Fac_CCNRInterrogate,
4735 [36].u.CCNRInterrogate.InvokeID = -129,
4736 [36].u.CCNRInterrogate.ComponentType = FacComponent_Invoke,
4738 [37].Function = Fac_CCNRInterrogate,
4739 [37].u.CCNRInterrogate.InvokeID = -3,
4740 [37].u.CCNRInterrogate.ComponentType = FacComponent_Result,
4741 [37].u.CCNRInterrogate.Component.Result.RecallMode = 1,
4743 [38].Function = Fac_CCBS_T_Call,
4744 [38].u.EctExecute.InvokeID = 41,
4746 [39].Function = Fac_CCBS_T_Suspend,
4747 [39].u.EctExecute.InvokeID = 42,
4749 [40].Function = Fac_CCBS_T_Resume,
4750 [40].u.EctExecute.InvokeID = 43,
4752 [41].Function = Fac_CCBS_T_RemoteUserFree,
4753 [41].u.EctExecute.InvokeID = 44,
4755 [42].Function = Fac_CCBS_T_Available,
4756 [42].u.EctExecute.InvokeID = 45,
4758 [43].Function = Fac_CCBS_T_Request,
4759 [43].u.CCBS_T_Request.InvokeID = 46,
4760 [43].u.CCBS_T_Request.ComponentType = FacComponent_Invoke,
4761 [43].u.CCBS_T_Request.Component.Invoke.Destination.Party.Type = 8,
4762 [43].u.CCBS_T_Request.Component.Invoke.Destination.Party.LengthOfNumber = 4,
4763 [43].u.CCBS_T_Request.Component.Invoke.Destination.Party.Number =
"6229",
4764 [43].u.CCBS_T_Request.Component.Invoke.Q931ie.Bc.Length = 2,
4765 [43].u.CCBS_T_Request.Component.Invoke.Q931ie.Bc.Contents =
"LM",
4766 [43].u.CCBS_T_Request.Component.Invoke.RetentionSupported = 1,
4767 [43].u.CCBS_T_Request.Component.Invoke.PresentationAllowedIndicatorPresent = 1,
4768 [43].u.CCBS_T_Request.Component.Invoke.PresentationAllowedIndicator = 1,
4769 [43].u.CCBS_T_Request.Component.Invoke.Originating.Party.Type = 8,
4770 [43].u.CCBS_T_Request.Component.Invoke.Originating.Party.LengthOfNumber = 4,
4771 [43].u.CCBS_T_Request.Component.Invoke.Originating.Party.Number =
"9864",
4773 [44].Function = Fac_CCBS_T_Request,
4774 [44].u.CCBS_T_Request.InvokeID = 47,
4775 [44].u.CCBS_T_Request.ComponentType = FacComponent_Invoke,
4776 [44].u.CCBS_T_Request.Component.Invoke.Destination.Party.Type = 8,
4777 [44].u.CCBS_T_Request.Component.Invoke.Destination.Party.LengthOfNumber = 4,
4778 [44].u.CCBS_T_Request.Component.Invoke.Destination.Party.Number =
"6229",
4779 [44].u.CCBS_T_Request.Component.Invoke.Q931ie.Bc.Length = 2,
4780 [44].u.CCBS_T_Request.Component.Invoke.Q931ie.Bc.Contents =
"LM",
4781 [44].u.CCBS_T_Request.Component.Invoke.PresentationAllowedIndicatorPresent = 1,
4782 [44].u.CCBS_T_Request.Component.Invoke.PresentationAllowedIndicator = 1,
4783 [44].u.CCBS_T_Request.Component.Invoke.Originating.Party.Type = 8,
4784 [44].u.CCBS_T_Request.Component.Invoke.Originating.Party.LengthOfNumber = 4,
4785 [44].u.CCBS_T_Request.Component.Invoke.Originating.Party.Number =
"9864",
4787 [45].Function = Fac_CCBS_T_Request,
4788 [45].u.CCBS_T_Request.InvokeID = 48,
4789 [45].u.CCBS_T_Request.ComponentType = FacComponent_Invoke,
4790 [45].u.CCBS_T_Request.Component.Invoke.Destination.Party.Type = 8,
4791 [45].u.CCBS_T_Request.Component.Invoke.Destination.Party.LengthOfNumber = 4,
4792 [45].u.CCBS_T_Request.Component.Invoke.Destination.Party.Number =
"6229",
4793 [45].u.CCBS_T_Request.Component.Invoke.Q931ie.Bc.Length = 2,
4794 [45].u.CCBS_T_Request.Component.Invoke.Q931ie.Bc.Contents =
"LM",
4795 [45].u.CCBS_T_Request.Component.Invoke.Originating.Party.Type = 8,
4796 [45].u.CCBS_T_Request.Component.Invoke.Originating.Party.LengthOfNumber = 4,
4797 [45].u.CCBS_T_Request.Component.Invoke.Originating.Party.Number =
"9864",
4799 [46].Function = Fac_CCBS_T_Request,
4800 [46].u.CCBS_T_Request.InvokeID = 49,
4801 [46].u.CCBS_T_Request.ComponentType = FacComponent_Invoke,
4802 [46].u.CCBS_T_Request.Component.Invoke.Destination.Party.Type = 8,
4803 [46].u.CCBS_T_Request.Component.Invoke.Destination.Party.LengthOfNumber = 4,
4804 [46].u.CCBS_T_Request.Component.Invoke.Destination.Party.Number =
"6229",
4805 [46].u.CCBS_T_Request.Component.Invoke.Q931ie.Bc.Length = 2,
4806 [46].u.CCBS_T_Request.Component.Invoke.Q931ie.Bc.Contents =
"LM",
4807 [46].u.CCBS_T_Request.Component.Invoke.PresentationAllowedIndicatorPresent = 1,
4808 [46].u.CCBS_T_Request.Component.Invoke.PresentationAllowedIndicator = 1,
4810 [47].Function = Fac_CCBS_T_Request,
4811 [47].u.CCBS_T_Request.InvokeID = 50,
4812 [47].u.CCBS_T_Request.ComponentType = FacComponent_Invoke,
4813 [47].u.CCBS_T_Request.Component.Invoke.Destination.Party.Type = 8,
4814 [47].u.CCBS_T_Request.Component.Invoke.Destination.Party.LengthOfNumber = 4,
4815 [47].u.CCBS_T_Request.Component.Invoke.Destination.Party.Number =
"6229",
4816 [47].u.CCBS_T_Request.Component.Invoke.Q931ie.Bc.Length = 2,
4817 [47].u.CCBS_T_Request.Component.Invoke.Q931ie.Bc.Contents =
"LM",
4819 [48].Function = Fac_CCBS_T_Request,
4820 [48].u.CCBS_T_Request.InvokeID = 51,
4821 [48].u.CCBS_T_Request.ComponentType = FacComponent_Result,
4822 [48].u.CCBS_T_Request.Component.Result.RetentionSupported = 1,
4824 [49].Function = Fac_CCNR_T_Request,
4825 [49].u.CCNR_T_Request.InvokeID = 52,
4826 [49].u.CCNR_T_Request.ComponentType = FacComponent_Invoke,
4827 [49].u.CCNR_T_Request.Component.Invoke.Destination.Party.Type = 8,
4828 [49].u.CCNR_T_Request.Component.Invoke.Destination.Party.LengthOfNumber = 4,
4829 [49].u.CCNR_T_Request.Component.Invoke.Destination.Party.Number =
"6229",
4830 [49].u.CCNR_T_Request.Component.Invoke.Q931ie.Bc.Length = 2,
4831 [49].u.CCNR_T_Request.Component.Invoke.Q931ie.Bc.Contents =
"LM",
4833 [50].Function = Fac_CCNR_T_Request,
4834 [50].u.CCNR_T_Request.InvokeID = 53,
4835 [50].u.CCNR_T_Request.ComponentType = FacComponent_Result,
4836 [50].u.CCNR_T_Request.Component.Result.RetentionSupported = 1,
4838 [51].Function = Fac_EctExecute,
4839 [51].u.EctExecute.InvokeID = 54,
4841 [52].Function = Fac_ExplicitEctExecute,
4842 [52].u.ExplicitEctExecute.InvokeID = 55,
4843 [52].u.ExplicitEctExecute.LinkID = 23,
4845 [53].Function = Fac_RequestSubaddress,
4846 [53].u.RequestSubaddress.InvokeID = 56,
4848 [54].Function = Fac_SubaddressTransfer,
4849 [54].u.SubaddressTransfer.InvokeID = 57,
4850 [54].u.SubaddressTransfer.Subaddress.Type = 1,
4851 [54].u.SubaddressTransfer.Subaddress.Length = 4,
4852 [54].u.SubaddressTransfer.Subaddress.u.Nsap =
"6492",
4854 [55].Function = Fac_EctLinkIdRequest,
4855 [55].u.EctLinkIdRequest.InvokeID = 58,
4856 [55].u.EctLinkIdRequest.ComponentType = FacComponent_Invoke,
4858 [56].Function = Fac_EctLinkIdRequest,
4859 [56].u.EctLinkIdRequest.InvokeID = 59,
4860 [56].u.EctLinkIdRequest.ComponentType = FacComponent_Result,
4861 [56].u.EctLinkIdRequest.Component.Result.LinkID = 76,
4863 [57].Function = Fac_EctInform,
4864 [57].u.EctInform.InvokeID = 60,
4865 [57].u.EctInform.Status = 1,
4866 [57].u.EctInform.RedirectionPresent = 1,
4867 [57].u.EctInform.Redirection.Type = 0,
4868 [57].u.EctInform.Redirection.Unscreened.Type = 8,
4869 [57].u.EctInform.Redirection.Unscreened.LengthOfNumber = 4,
4870 [57].u.EctInform.Redirection.Unscreened.Number =
"6229",
4872 [58].Function = Fac_EctInform,
4873 [58].u.EctInform.InvokeID = 61,
4874 [58].u.EctInform.Status = 1,
4875 [58].u.EctInform.RedirectionPresent = 1,
4876 [58].u.EctInform.Redirection.Type = 1,
4878 [59].Function = Fac_EctInform,
4879 [59].u.EctInform.InvokeID = 62,
4880 [59].u.EctInform.Status = 1,
4881 [59].u.EctInform.RedirectionPresent = 1,
4882 [59].u.EctInform.Redirection.Type = 2,
4884 [60].Function = Fac_EctInform,
4885 [60].u.EctInform.InvokeID = 63,
4886 [60].u.EctInform.Status = 1,
4887 [60].u.EctInform.RedirectionPresent = 1,
4888 [60].u.EctInform.Redirection.Type = 3,
4889 [60].u.EctInform.Redirection.Unscreened.Type = 8,
4890 [60].u.EctInform.Redirection.Unscreened.LengthOfNumber = 4,
4891 [60].u.EctInform.Redirection.Unscreened.Number =
"3340",
4893 [61].Function = Fac_EctInform,
4894 [61].u.EctInform.InvokeID = 64,
4895 [61].u.EctInform.Status = 1,
4896 [61].u.EctInform.RedirectionPresent = 0,
4898 [62].Function = Fac_EctLoopTest,
4899 [62].u.EctLoopTest.InvokeID = 65,
4900 [62].u.EctLoopTest.ComponentType = FacComponent_Invoke,
4901 [62].u.EctLoopTest.Component.Invoke.CallTransferID = 7,
4903 [63].Function = Fac_EctLoopTest,
4904 [63].u.EctLoopTest.InvokeID = 66,
4905 [63].u.EctLoopTest.ComponentType = FacComponent_Result,
4906 [63].u.EctLoopTest.Component.Result.LoopResult = 2,
4908 [64].Function = Fac_ActivationDiversion,
4909 [64].u.ActivationDiversion.InvokeID = 67,
4910 [64].u.ActivationDiversion.ComponentType = FacComponent_Invoke,
4911 [64].u.ActivationDiversion.Component.Invoke.Procedure = 2,
4912 [64].u.ActivationDiversion.Component.Invoke.BasicService = 3,
4913 [64].u.ActivationDiversion.Component.Invoke.ForwardedTo.Party.Type = 4,
4914 [64].u.ActivationDiversion.Component.Invoke.ForwardedTo.Party.LengthOfNumber = 4,
4915 [64].u.ActivationDiversion.Component.Invoke.ForwardedTo.Party.Number =
"1803",
4916 [64].u.ActivationDiversion.Component.Invoke.ServedUser.Type = 4,
4917 [64].u.ActivationDiversion.Component.Invoke.ServedUser.LengthOfNumber = 4,
4918 [64].u.ActivationDiversion.Component.Invoke.ServedUser.Number =
"5398",
4920 [65].Function = Fac_ActivationDiversion,
4921 [65].u.ActivationDiversion.InvokeID = 68,
4922 [65].u.ActivationDiversion.ComponentType = FacComponent_Invoke,
4923 [65].u.ActivationDiversion.Component.Invoke.Procedure = 1,
4924 [65].u.ActivationDiversion.Component.Invoke.BasicService = 5,
4925 [65].u.ActivationDiversion.Component.Invoke.ForwardedTo.Party.Type = 4,
4926 [65].u.ActivationDiversion.Component.Invoke.ForwardedTo.Party.LengthOfNumber = 4,
4927 [65].u.ActivationDiversion.Component.Invoke.ForwardedTo.Party.Number =
"1803",
4929 [66].Function = Fac_ActivationDiversion,
4930 [66].u.ActivationDiversion.InvokeID = 69,
4931 [66].u.ActivationDiversion.ComponentType = FacComponent_Result,
4933 [67].Function = Fac_DeactivationDiversion,
4934 [67].u.DeactivationDiversion.InvokeID = 70,
4935 [67].u.DeactivationDiversion.ComponentType = FacComponent_Invoke,
4936 [67].u.DeactivationDiversion.Component.Invoke.Procedure = 1,
4937 [67].u.DeactivationDiversion.Component.Invoke.BasicService = 5,
4939 [68].Function = Fac_DeactivationDiversion,
4940 [68].u.DeactivationDiversion.InvokeID = 71,
4941 [68].u.DeactivationDiversion.ComponentType = FacComponent_Result,
4943 [69].Function = Fac_ActivationStatusNotificationDiv,
4944 [69].u.ActivationStatusNotificationDiv.InvokeID = 72,
4945 [69].u.ActivationStatusNotificationDiv.Procedure = 1,
4946 [69].u.ActivationStatusNotificationDiv.BasicService = 5,
4947 [69].u.ActivationStatusNotificationDiv.ForwardedTo.Party.Type = 4,
4948 [69].u.ActivationStatusNotificationDiv.ForwardedTo.Party.LengthOfNumber = 4,
4949 [69].u.ActivationStatusNotificationDiv.ForwardedTo.Party.Number =
"1803",
4951 [70].Function = Fac_DeactivationStatusNotificationDiv,
4952 [70].u.DeactivationStatusNotificationDiv.InvokeID = 73,
4953 [70].u.DeactivationStatusNotificationDiv.Procedure = 1,
4954 [70].u.DeactivationStatusNotificationDiv.BasicService = 5,
4956 [71].Function = Fac_InterrogationDiversion,
4957 [71].u.InterrogationDiversion.InvokeID = 74,
4958 [71].u.InterrogationDiversion.ComponentType = FacComponent_Invoke,
4959 [71].u.InterrogationDiversion.Component.Invoke.Procedure = 1,
4960 [71].u.InterrogationDiversion.Component.Invoke.BasicService = 5,
4962 [72].Function = Fac_InterrogationDiversion,
4963 [72].u.InterrogationDiversion.InvokeID = 75,
4964 [72].u.InterrogationDiversion.ComponentType = FacComponent_Invoke,
4965 [72].u.InterrogationDiversion.Component.Invoke.Procedure = 1,
4967 [73].Function = Fac_InterrogationDiversion,
4968 [73].u.InterrogationDiversion.InvokeID = 76,
4969 [73].u.InterrogationDiversion.ComponentType = FacComponent_Result,
4970 [73].u.InterrogationDiversion.Component.Result.NumRecords = 2,
4971 [73].u.InterrogationDiversion.Component.Result.List[0].Procedure = 2,
4972 [73].u.InterrogationDiversion.Component.Result.List[0].BasicService = 5,
4973 [73].u.InterrogationDiversion.Component.Result.List[0].ForwardedTo.Party.Type = 4,
4974 [73].u.InterrogationDiversion.Component.Result.List[0].ForwardedTo.Party.LengthOfNumber = 4,
4975 [73].u.InterrogationDiversion.Component.Result.List[0].ForwardedTo.Party.Number =
"1803",
4976 [73].u.InterrogationDiversion.Component.Result.List[1].Procedure = 1,
4977 [73].u.InterrogationDiversion.Component.Result.List[1].BasicService = 3,
4978 [73].u.InterrogationDiversion.Component.Result.List[1].ForwardedTo.Party.Type = 4,
4979 [73].u.InterrogationDiversion.Component.Result.List[1].ForwardedTo.Party.LengthOfNumber = 4,
4980 [73].u.InterrogationDiversion.Component.Result.List[1].ForwardedTo.Party.Number =
"1903",
4981 [73].u.InterrogationDiversion.Component.Result.List[1].ServedUser.Type = 4,
4982 [73].u.InterrogationDiversion.Component.Result.List[1].ServedUser.LengthOfNumber = 4,
4983 [73].u.InterrogationDiversion.Component.Result.List[1].ServedUser.Number =
"5398",
4985 [74].Function = Fac_DiversionInformation,
4986 [74].u.DiversionInformation.InvokeID = 77,
4987 [74].u.DiversionInformation.DiversionReason = 3,
4988 [74].u.DiversionInformation.BasicService = 5,
4989 [74].u.DiversionInformation.ServedUserSubaddress.Type = 1,
4990 [74].u.DiversionInformation.ServedUserSubaddress.Length = 4,
4991 [74].u.DiversionInformation.ServedUserSubaddress.u.Nsap =
"6492",
4992 [74].u.DiversionInformation.CallingAddressPresent = 1,
4993 [74].u.DiversionInformation.CallingAddress.Type = 0,
4994 [74].u.DiversionInformation.CallingAddress.Address.ScreeningIndicator = 3,
4995 [74].u.DiversionInformation.CallingAddress.Address.Party.Type = 4,
4996 [74].u.DiversionInformation.CallingAddress.Address.Party.LengthOfNumber = 4,
4997 [74].u.DiversionInformation.CallingAddress.Address.Party.Number =
"1803",
4998 [74].u.DiversionInformation.OriginalCalledPresent = 1,
4999 [74].u.DiversionInformation.OriginalCalled.Type = 1,
5000 [74].u.DiversionInformation.LastDivertingPresent = 1,
5001 [74].u.DiversionInformation.LastDiverting.Type = 2,
5002 [74].u.DiversionInformation.LastDivertingReasonPresent = 1,
5003 [74].u.DiversionInformation.LastDivertingReason = 3,
5004 [74].u.DiversionInformation.UserInfo.Length = 5,
5005 [74].u.DiversionInformation.UserInfo.Contents =
"79828",
5007 [75].Function = Fac_DiversionInformation,
5008 [75].u.DiversionInformation.InvokeID = 78,
5009 [75].u.DiversionInformation.DiversionReason = 3,
5010 [75].u.DiversionInformation.BasicService = 5,
5011 [75].u.DiversionInformation.CallingAddressPresent = 1,
5012 [75].u.DiversionInformation.CallingAddress.Type = 1,
5013 [75].u.DiversionInformation.OriginalCalledPresent = 1,
5014 [75].u.DiversionInformation.OriginalCalled.Type = 2,
5015 [75].u.DiversionInformation.LastDivertingPresent = 1,
5016 [75].u.DiversionInformation.LastDiverting.Type = 1,
5018 [76].Function = Fac_DiversionInformation,
5019 [76].u.DiversionInformation.InvokeID = 79,
5020 [76].u.DiversionInformation.DiversionReason = 2,
5021 [76].u.DiversionInformation.BasicService = 3,
5022 [76].u.DiversionInformation.CallingAddressPresent = 1,
5023 [76].u.DiversionInformation.CallingAddress.Type = 2,
5025 [77].Function = Fac_DiversionInformation,
5026 [77].u.DiversionInformation.InvokeID = 80,
5027 [77].u.DiversionInformation.DiversionReason = 3,
5028 [77].u.DiversionInformation.BasicService = 5,
5029 [77].u.DiversionInformation.CallingAddressPresent = 1,
5030 [77].u.DiversionInformation.CallingAddress.Type = 3,
5031 [77].u.DiversionInformation.CallingAddress.Address.ScreeningIndicator = 2,
5032 [77].u.DiversionInformation.CallingAddress.Address.Party.Type = 4,
5033 [77].u.DiversionInformation.CallingAddress.Address.Party.LengthOfNumber = 4,
5034 [77].u.DiversionInformation.CallingAddress.Address.Party.Number =
"1803",
5036 [78].Function = Fac_DiversionInformation,
5037 [78].u.DiversionInformation.InvokeID = 81,
5038 [78].u.DiversionInformation.DiversionReason = 2,
5039 [78].u.DiversionInformation.BasicService = 4,
5040 [78].u.DiversionInformation.UserInfo.Length = 5,
5041 [78].u.DiversionInformation.UserInfo.Contents =
"79828",
5043 [79].Function = Fac_DiversionInformation,
5044 [79].u.DiversionInformation.InvokeID = 82,
5045 [79].u.DiversionInformation.DiversionReason = 2,
5046 [79].u.DiversionInformation.BasicService = 4,
5048 [80].Function = Fac_CallDeflection,
5049 [80].u.CallDeflection.InvokeID = 83,
5050 [80].u.CallDeflection.ComponentType = FacComponent_Invoke,
5051 [80].u.CallDeflection.Component.Invoke.Deflection.Party.Type = 4,
5052 [80].u.CallDeflection.Component.Invoke.Deflection.Party.LengthOfNumber = 4,
5053 [80].u.CallDeflection.Component.Invoke.Deflection.Party.Number =
"1803",
5054 [80].u.CallDeflection.Component.Invoke.PresentationAllowedToDivertedToUserPresent = 1,
5055 [80].u.CallDeflection.Component.Invoke.PresentationAllowedToDivertedToUser = 1,
5057 [81].Function = Fac_CallDeflection,
5058 [81].u.CallDeflection.InvokeID = 84,
5059 [81].u.CallDeflection.ComponentType = FacComponent_Invoke,
5060 [81].u.CallDeflection.Component.Invoke.Deflection.Party.Type = 4,
5061 [81].u.CallDeflection.Component.Invoke.Deflection.Party.LengthOfNumber = 4,
5062 [81].u.CallDeflection.Component.Invoke.Deflection.Party.Number =
"1803",
5063 [81].u.CallDeflection.Component.Invoke.PresentationAllowedToDivertedToUserPresent = 1,
5064 [81].u.CallDeflection.Component.Invoke.PresentationAllowedToDivertedToUser = 0,
5066 [82].Function = Fac_CallDeflection,
5067 [82].u.CallDeflection.InvokeID = 85,
5068 [82].u.CallDeflection.ComponentType = FacComponent_Invoke,
5069 [82].u.CallDeflection.Component.Invoke.Deflection.Party.Type = 4,
5070 [82].u.CallDeflection.Component.Invoke.Deflection.Party.LengthOfNumber = 4,
5071 [82].u.CallDeflection.Component.Invoke.Deflection.Party.Number =
"1803",
5073 [83].Function = Fac_CallDeflection,
5074 [83].u.CallDeflection.InvokeID = 86,
5075 [83].u.CallDeflection.ComponentType = FacComponent_Result,
5077 [84].Function = Fac_CallRerouteing,
5078 [84].u.CallRerouteing.InvokeID = 87,
5079 [84].u.CallRerouteing.ComponentType = FacComponent_Invoke,
5080 [84].u.CallRerouteing.Component.Invoke.ReroutingReason = 3,
5081 [84].u.CallRerouteing.Component.Invoke.ReroutingCounter = 2,
5082 [84].u.CallRerouteing.Component.Invoke.CalledAddress.Party.Type = 4,
5083 [84].u.CallRerouteing.Component.Invoke.CalledAddress.Party.LengthOfNumber = 4,
5084 [84].u.CallRerouteing.Component.Invoke.CalledAddress.Party.Number =
"1803",
5085 [84].u.CallRerouteing.Component.Invoke.Q931ie.Bc.Length = 2,
5086 [84].u.CallRerouteing.Component.Invoke.Q931ie.Bc.Contents =
"RT",
5087 [84].u.CallRerouteing.Component.Invoke.Q931ie.Hlc.Length = 3,
5088 [84].u.CallRerouteing.Component.Invoke.Q931ie.Hlc.Contents =
"RTG",
5089 [84].u.CallRerouteing.Component.Invoke.Q931ie.Llc.Length = 2,
5090 [84].u.CallRerouteing.Component.Invoke.Q931ie.Llc.Contents =
"MY",
5091 [84].u.CallRerouteing.Component.Invoke.Q931ie.UserInfo.Length = 5,
5092 [84].u.CallRerouteing.Component.Invoke.Q931ie.UserInfo.Contents =
"YEHAW",
5093 [84].u.CallRerouteing.Component.Invoke.LastRerouting.Type = 1,
5094 [84].u.CallRerouteing.Component.Invoke.SubscriptionOption = 2,
5095 [84].u.CallRerouteing.Component.Invoke.CallingPartySubaddress.Type = 1,
5096 [84].u.CallRerouteing.Component.Invoke.CallingPartySubaddress.Length = 4,
5097 [84].u.CallRerouteing.Component.Invoke.CallingPartySubaddress.u.Nsap =
"6492",
5099 [85].Function = Fac_CallRerouteing,
5100 [85].u.CallRerouteing.InvokeID = 88,
5101 [85].u.CallRerouteing.ComponentType = FacComponent_Invoke,
5102 [85].u.CallRerouteing.Component.Invoke.ReroutingReason = 3,
5103 [85].u.CallRerouteing.Component.Invoke.ReroutingCounter = 2,
5104 [85].u.CallRerouteing.Component.Invoke.CalledAddress.Party.Type = 4,
5105 [85].u.CallRerouteing.Component.Invoke.CalledAddress.Party.LengthOfNumber = 4,
5106 [85].u.CallRerouteing.Component.Invoke.CalledAddress.Party.Number =
"1803",
5107 [85].u.CallRerouteing.Component.Invoke.Q931ie.Bc.Length = 2,
5108 [85].u.CallRerouteing.Component.Invoke.Q931ie.Bc.Contents =
"RT",
5109 [85].u.CallRerouteing.Component.Invoke.LastRerouting.Type = 1,
5110 [85].u.CallRerouteing.Component.Invoke.SubscriptionOption = 2,
5112 [86].Function = Fac_CallRerouteing,
5113 [86].u.CallRerouteing.InvokeID = 89,
5114 [86].u.CallRerouteing.ComponentType = FacComponent_Invoke,
5115 [86].u.CallRerouteing.Component.Invoke.ReroutingReason = 3,
5116 [86].u.CallRerouteing.Component.Invoke.ReroutingCounter = 2,
5117 [86].u.CallRerouteing.Component.Invoke.CalledAddress.Party.Type = 4,
5118 [86].u.CallRerouteing.Component.Invoke.CalledAddress.Party.LengthOfNumber = 4,
5119 [86].u.CallRerouteing.Component.Invoke.CalledAddress.Party.Number =
"1803",
5120 [86].u.CallRerouteing.Component.Invoke.Q931ie.Bc.Length = 2,
5121 [86].u.CallRerouteing.Component.Invoke.Q931ie.Bc.Contents =
"RT",
5122 [86].u.CallRerouteing.Component.Invoke.LastRerouting.Type = 2,
5124 [87].Function = Fac_CallRerouteing,
5125 [87].u.CallRerouteing.InvokeID = 90,
5126 [87].u.CallRerouteing.ComponentType = FacComponent_Result,
5128 [88].Function = Fac_InterrogateServedUserNumbers,
5129 [88].u.InterrogateServedUserNumbers.InvokeID = 91,
5130 [88].u.InterrogateServedUserNumbers.ComponentType = FacComponent_Invoke,
5132 [89].Function = Fac_InterrogateServedUserNumbers,
5133 [89].u.InterrogateServedUserNumbers.InvokeID = 92,
5134 [89].u.InterrogateServedUserNumbers.ComponentType = FacComponent_Result,
5135 [89].u.InterrogateServedUserNumbers.Component.Result.NumRecords = 2,
5136 [89].u.InterrogateServedUserNumbers.Component.Result.List[0].Type = 4,
5137 [89].u.InterrogateServedUserNumbers.Component.Result.List[0].LengthOfNumber = 4,
5138 [89].u.InterrogateServedUserNumbers.Component.Result.List[0].Number =
"1803",
5139 [89].u.InterrogateServedUserNumbers.Component.Result.List[1].Type = 4,
5140 [89].u.InterrogateServedUserNumbers.Component.Result.List[1].LengthOfNumber = 4,
5141 [89].u.InterrogateServedUserNumbers.Component.Result.List[1].Number =
"5786",
5143 [90].Function = Fac_DivertingLegInformation1,
5144 [90].u.DivertingLegInformation1.InvokeID = 93,
5145 [90].u.DivertingLegInformation1.DiversionReason = 4,
5146 [90].u.DivertingLegInformation1.SubscriptionOption = 1,
5147 [90].u.DivertingLegInformation1.DivertedToPresent = 1,
5148 [90].u.DivertingLegInformation1.DivertedTo.Type = 2,
5150 [91].Function = Fac_DivertingLegInformation1,
5151 [91].u.DivertingLegInformation1.InvokeID = 94,
5152 [91].u.DivertingLegInformation1.DiversionReason = 4,
5153 [91].u.DivertingLegInformation1.SubscriptionOption = 1,
5155 [92].Function = Fac_DivertingLegInformation2,
5156 [92].u.DivertingLegInformation2.InvokeID = 95,
5157 [92].u.DivertingLegInformation2.DiversionCounter = 3,
5158 [92].u.DivertingLegInformation2.DiversionReason = 2,
5159 [92].u.DivertingLegInformation2.DivertingPresent = 1,
5160 [92].u.DivertingLegInformation2.Diverting.Type = 2,
5161 [92].u.DivertingLegInformation2.OriginalCalledPresent = 1,
5162 [92].u.DivertingLegInformation2.OriginalCalled.Type = 1,
5164 [93].Function = Fac_DivertingLegInformation2,
5165 [93].u.DivertingLegInformation2.InvokeID = 96,
5166 [93].u.DivertingLegInformation2.DiversionCounter = 3,
5167 [93].u.DivertingLegInformation2.DiversionReason = 2,
5168 [93].u.DivertingLegInformation2.OriginalCalledPresent = 1,
5169 [93].u.DivertingLegInformation2.OriginalCalled.Type = 1,
5171 [94].Function = Fac_DivertingLegInformation2,
5172 [94].u.DivertingLegInformation2.InvokeID = 97,
5173 [94].u.DivertingLegInformation2.DiversionCounter = 1,
5174 [94].u.DivertingLegInformation2.DiversionReason = 2,
5176 [95].Function = Fac_DivertingLegInformation3,
5177 [95].u.DivertingLegInformation3.InvokeID = 98,
5178 [95].u.DivertingLegInformation3.PresentationAllowedIndicator = 1,
5185 const char *channame;
5189 const char *served_nr;
5195 e->
command =
"misdn send facility";
5196 e->
usage =
"Usage: misdn send facility <type> <channel|port> \"<args>\" \n" 5197 "\t type is one of:\n" 5198 "\t - calldeflect\n" 5199 #if defined(AST_MISDN_ENHANCEMENTS) 5200 "\t - callrerouting\n" 5203 "\t - CFDeactivate\n";
5214 if (strstr(a->
argv[3],
"calldeflect")) {
5216 ast_verbose(
"calldeflect requires 1 arg: ToNumber\n\n");
5219 channame = a->
argv[4];
5222 ast_verbose(
"Sending Calldeflection (%s) to %s\n", nr, channame);
5225 ast_verbose(
"Sending CD with nr %s to %s failed: Channel does not exist.\n", nr, channame);
5230 #if defined(AST_MISDN_ENHANCEMENTS) 5231 max_len =
sizeof(tmp->
bc->
fac_out.u.CallDeflection.Component.Invoke.Deflection.Party.Number) - 1;
5232 if (max_len < strlen(nr)) {
5233 ast_verbose(
"Sending CD with nr %s to %s failed: Number too long (up to %u digits are allowed).\n",
5234 nr, channame, max_len);
5239 tmp->
bc->
fac_out.Function = Fac_CallDeflection;
5240 tmp->
bc->
fac_out.u.CallDeflection.InvokeID = ++misdn_invoke_id;
5241 tmp->
bc->
fac_out.u.CallDeflection.ComponentType = FacComponent_Invoke;
5242 tmp->
bc->
fac_out.u.CallDeflection.Component.Invoke.PresentationAllowedToDivertedToUserPresent = 1;
5243 tmp->
bc->
fac_out.u.CallDeflection.Component.Invoke.PresentationAllowedToDivertedToUser = 0;
5244 tmp->
bc->
fac_out.u.CallDeflection.Component.Invoke.Deflection.Party.Type = 0;
5245 tmp->
bc->
fac_out.u.CallDeflection.Component.Invoke.Deflection.Party.LengthOfNumber = strlen(nr);
5246 strcpy((
char *) tmp->
bc->
fac_out.u.CallDeflection.Component.Invoke.Deflection.Party.Number, nr);
5247 tmp->
bc->
fac_out.u.CallDeflection.Component.Invoke.Deflection.Subaddress.Length = 0;
5251 max_len =
sizeof(tmp->
bc->
fac_out.u.CDeflection.DeflectedToNumber) - 1;
5252 if (max_len < strlen(nr)) {
5253 ast_verbose(
"Sending CD with nr %s to %s failed: Number too long (up to %u digits are allowed).\n",
5254 nr, channame, max_len);
5260 tmp->
bc->
fac_out.u.CDeflection.PresentationAllowed = 0;
5262 strcpy((
char *) tmp->
bc->
fac_out.u.CDeflection.DeflectedToNumber, nr);
5270 #if defined(AST_MISDN_ENHANCEMENTS) 5271 }
else if (strstr(a->
argv[3],
"callrerouteing") || strstr(a->
argv[3],
"callrerouting")) {
5273 ast_verbose(
"callrerouting requires 1 arg: ToNumber\n\n");
5276 channame = a->
argv[4];
5279 ast_verbose(
"Sending Callrerouting (%s) to %s\n", nr, channame);
5282 ast_verbose(
"Sending Call Rerouting with nr %s to %s failed: Channel does not exist.\n", nr, channame);
5287 max_len =
sizeof(tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.CalledAddress.Party.Number) - 1;
5288 if (max_len < strlen(nr)) {
5289 ast_verbose(
"Sending Call Rerouting with nr %s to %s failed: Number too long (up to %u digits are allowed).\n",
5290 nr, channame, max_len);
5295 tmp->
bc->
fac_out.Function = Fac_CallRerouteing;
5296 tmp->
bc->
fac_out.u.CallRerouteing.InvokeID = ++misdn_invoke_id;
5297 tmp->
bc->
fac_out.u.CallRerouteing.ComponentType = FacComponent_Invoke;
5299 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.ReroutingReason = 0;
5300 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.ReroutingCounter = 1;
5302 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.CalledAddress.Party.Type = 0;
5303 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.CalledAddress.Party.LengthOfNumber = strlen(nr);
5304 strcpy((
char *) tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.CalledAddress.Party.Number, nr);
5305 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.CalledAddress.Subaddress.Length = 0;
5307 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.CallingPartySubaddress.Length = 0;
5310 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.Q931ie.Bc.Length = 3;
5311 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.Q931ie.Bc.Contents[0] = 0x90;
5312 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.Q931ie.Bc.Contents[1] = 0x90;
5313 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.Q931ie.Bc.Contents[2] = 0xa3;
5314 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.Q931ie.Hlc.Length = 0;
5315 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.Q931ie.Llc.Length = 0;
5316 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.Q931ie.UserInfo.Length = 0;
5318 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.LastRerouting.Type = 1;
5319 tmp->
bc->
fac_out.u.CallRerouteing.Component.Invoke.SubscriptionOption = 0;
5327 }
else if (strstr(a->
argv[3],
"CFActivate")) {
5329 ast_verbose(
"CFActivate requires 2 args: 1.FromNumber, 2.ToNumber\n\n");
5332 port = atoi(a->
argv[4]);
5333 served_nr = a->
argv[5];
5338 ast_verbose(
"Sending CFActivate Port:(%d) FromNr. (%s) to Nr. (%s)\n", port, served_nr, nr);
5340 #if defined(AST_MISDN_ENHANCEMENTS) 5341 bc->
fac_out.Function = Fac_ActivationDiversion;
5342 bc->
fac_out.u.ActivationDiversion.InvokeID = ++misdn_invoke_id;
5343 bc->
fac_out.u.ActivationDiversion.ComponentType = FacComponent_Invoke;
5344 bc->
fac_out.u.ActivationDiversion.Component.Invoke.BasicService = 0;
5345 bc->
fac_out.u.ActivationDiversion.Component.Invoke.Procedure = 0;
5347 served_nr,
sizeof(bc->
fac_out.u.ActivationDiversion.Component.Invoke.ServedUser.Number));
5348 bc->
fac_out.u.ActivationDiversion.Component.Invoke.ServedUser.LengthOfNumber =
5349 strlen((
char *) bc->
fac_out.u.ActivationDiversion.Component.Invoke.ServedUser.Number);
5350 bc->
fac_out.u.ActivationDiversion.Component.Invoke.ServedUser.Type = 0;
5352 nr,
sizeof(bc->
fac_out.u.ActivationDiversion.Component.Invoke.ForwardedTo.Party.Number));
5353 bc->
fac_out.u.ActivationDiversion.Component.Invoke.ForwardedTo.Party.LengthOfNumber =
5354 strlen((
char *) bc->
fac_out.u.ActivationDiversion.Component.Invoke.ForwardedTo.Party.Number);
5355 bc->
fac_out.u.ActivationDiversion.Component.Invoke.ForwardedTo.Party.Type = 0;
5356 bc->
fac_out.u.ActivationDiversion.Component.Invoke.ForwardedTo.Subaddress.Length = 0;
5360 bc->
fac_out.Function = Fac_CFActivate;
5361 bc->
fac_out.u.CFActivate.BasicService = 0;
5362 bc->
fac_out.u.CFActivate.Procedure = 0;
5370 }
else if (strstr(a->
argv[3],
"CFDeactivate")) {
5372 ast_verbose(
"CFDeactivate requires 1 arg: FromNumber\n\n");
5375 port = atoi(a->
argv[4]);
5376 served_nr = a->
argv[5];
5379 ast_verbose(
"Sending CFDeactivate Port:(%d) FromNr. (%s)\n", port, served_nr);
5381 #if defined(AST_MISDN_ENHANCEMENTS) 5382 bc->
fac_out.Function = Fac_DeactivationDiversion;
5383 bc->
fac_out.u.DeactivationDiversion.InvokeID = ++misdn_invoke_id;
5384 bc->
fac_out.u.DeactivationDiversion.ComponentType = FacComponent_Invoke;
5385 bc->
fac_out.u.DeactivationDiversion.Component.Invoke.BasicService = 0;
5386 bc->
fac_out.u.DeactivationDiversion.Component.Invoke.Procedure = 0;
5388 served_nr,
sizeof(bc->
fac_out.u.DeactivationDiversion.Component.Invoke.ServedUser.Number));
5389 bc->
fac_out.u.DeactivationDiversion.Component.Invoke.ServedUser.LengthOfNumber =
5390 strlen((
char *) bc->
fac_out.u.DeactivationDiversion.Component.Invoke.ServedUser.Number);
5391 bc->
fac_out.u.DeactivationDiversion.Component.Invoke.ServedUser.Type = 0;
5395 bc->
fac_out.Function = Fac_CFDeactivate;
5396 bc->
fac_out.u.CFDeactivate.BasicService = 0;
5397 bc->
fac_out.u.CFDeactivate.Procedure = 0;
5404 #if defined(AST_MISDN_ENHANCEMENTS) && defined(CCBS_TEST_MESSAGES) 5405 }
else if (strstr(a->
argv[3],
"test")) {
5409 ast_verbose(
"test (<port> [<msg#>]) | (<channel-name> <msg#>)\n\n");
5412 port = atoi(a->
argv[4]);
5414 channame = a->
argv[4];
5418 msg_number = atoi(a->
argv[5]);
5421 tmp->
bc->
fac_out = Fac_Msgs[msg_number];
5431 }
else if (a->
argc < 6) {
5432 for (msg_number = 0; msg_number <
ARRAY_LEN(Fac_Msgs); ++msg_number) {
5434 bc->
fac_out = Fac_Msgs[msg_number];
5442 msg_number = atoi(a->
argv[5]);
5445 bc->
fac_out = Fac_Msgs[msg_number];
5454 }
else if (strstr(a->
argv[3],
"register")) {
5459 port = atoi(a->
argv[4]);
5461 bc = misdn_lib_get_register_bc(port);
5463 ast_verbose(
"Could not allocate REGISTER bc struct\n\n");
5484 e->
command =
"misdn send restart";
5486 "Usage: misdn send restart [port [channel]]\n" 5487 " Send a restart for every bchannel on the given port.\n";
5497 port = atoi(a->
argv[3]);
5500 channel = atoi(a->
argv[4]);
5511 const char *channame;
5518 e->
command =
"misdn send digit";
5520 "Usage: misdn send digit <channel> \"<msg>\" \n" 5521 " Send <digit> to <channel> as DTMF Tone\n" 5522 " when channel is a mISDN channel\n";
5532 channame = a->
argv[3];
5534 msglen = strlen(msg);
5536 ast_cli(a->
fd,
"Sending %s to %s\n", msg, channame);
5540 ast_cli(a->
fd,
"Sending %s to %s failed Channel does not exist\n", msg, channame);
5544 for (i = 0; i < msglen; i++) {
5548 ast_cli(a->
fd,
"Sending: %c\n", msg[i]);
5566 const char *channame;
5571 e->
command =
"misdn toggle echocancel";
5573 "Usage: misdn toggle echocancel <channel>\n" 5574 " Toggle EchoCancel on mISDN Channel.\n";
5584 channame = a->
argv[3];
5586 ast_cli(a->
fd,
"Toggling EchoCancel on %s\n", channame);
5590 ast_cli(a->
fd,
"Toggling EchoCancel %s failed Channel does not exist\n", channame);
5598 update_pipeline_config(tmp->
bc);
5613 const char *channame;
5619 e->
command =
"misdn send display";
5621 "Usage: misdn send display <channel> \"<msg>\" \n" 5622 " Send <msg> to <channel> as Display Message\n" 5623 " when channel is a mISDN channel\n";
5633 channame = a->
argv[3];
5636 ast_cli(a->
fd,
"Sending %s to %s\n", msg, channame);
5639 if (tmp && tmp->
bc) {
5647 ast_cli(a->
fd,
"No such channel %s\n", channame);
5667 if (a->
word[0] ==
'p') {
5669 }
else if (a->
word[0] ==
'o') {
5674 if (a->
word[0] ==
'o') {
5686 int wordlen = strlen(a->
word);
5692 if ((!strncmp(a->
word,
"description", wordlen)) && (++which > a->
n)) {
5695 if ((!strncmp(a->
word,
"descriptions", wordlen)) && (++which > a->
n)) {
5698 if ((!strncmp(a->
word,
"0", wordlen)) && (++which > a->
n)) {
5702 snprintf(buffer,
sizeof(buffer),
"%d", port);
5703 if ((!strncmp(a->
word, buffer, wordlen)) && (++which > a->
n)) {
5709 if (strstr(a->
line,
"description ")) {
5715 if (!wordlen || !strncmp(a->
word, buffer, wordlen)) {
5716 if (++which > a->
n) {
5721 }
else if (strstr(a->
line,
"descriptions ")) {
5722 if ((!wordlen || !strncmp(a->
word,
"general", wordlen)) && (++which > a->
n)) {
5725 if ((!wordlen || !strncmp(a->
word,
"ports", wordlen)) && (++which > a->
n)) {
5777 if (! ast || ! bc) {
5800 chan_misdn_log(2, port,
" --> pres: %d screen: %d\n", pres, screen);
5802 if (pres < 0 || screen < 0) {