57 #if defined(__NetBSD__) || defined(__FreeBSD__) 60 #include <sys/sysmacros.h> 76 #error "Upgrade your libpri" 82 #if !defined(LIBSS7_ABI_COMPATIBILITY) 83 #error "Upgrade your libss7" 84 #elif LIBSS7_ABI_COMPATIBILITY != 2 85 #error "Your installed libss7 is not compatible" 89 #if defined(HAVE_OPENR2) 91 #define SIG_MFCR2_MAX_CHANNELS 672 482 #define SMDI_MD_WAIT_TIMEOUT 1500 485 "0 db (CSU)/0-133 feet (DSX-1)",
486 "133-266 feet (DSX-1)",
487 "266-399 feet (DSX-1)",
488 "399-533 feet (DSX-1)",
489 "533-655 feet (DSX-1)",
501 .resync_threshold = 1000,
519 #define DEFAULT_CIDRINGS 1 521 #define AST_LAW(p) (((p)->law == DAHDI_LAW_ALAW) ? ast_format_alaw : ast_format_ulaw) 525 #define NEED_MFDETECT(p) (((p)->sig == SIG_FEATDMF) || ((p)->sig == SIG_FEATDMF_TA) || ((p)->sig == SIG_E911) || ((p)->sig == SIG_FGC_CAMA) || ((p)->sig == SIG_FGC_CAMAMF) || ((p)->sig == SIG_FEATB)) 527 static const char tdesc[] =
"DAHDI Telephony" 528 #if defined(HAVE_PRI) || defined(HAVE_SS7) || defined(HAVE_OPENR2) 530 #if defined(HAVE_PRI) 533 #if defined(HAVE_SS7) 534 #if defined(HAVE_PRI) 539 #if defined(HAVE_OPENR2) 540 #if defined(HAVE_PRI) || defined(HAVE_SS7) 548 static const char config[] =
"chan_dahdi.conf";
551 #define NUM_SPANS DAHDI_MAX_SPANS 556 #define CHAN_PSEUDO -2 558 #define CALLPROGRESS_PROGRESS 1 559 #define CALLPROGRESS_FAX_OUTGOING 2 560 #define CALLPROGRESS_FAX_INCOMING 4 561 #define CALLPROGRESS_FAX (CALLPROGRESS_FAX_INCOMING | CALLPROGRESS_FAX_OUTGOING) 563 #define NUM_CADENCE_MAX 25 570 { { 125, 125, 2000, 4000 } },
571 { { 250, 250, 500, 1000, 250, 250, 500, 4000 } },
572 { { 125, 125, 125, 125, 125, 4000 } },
573 { { 1000, 500, 2500, 5000 } },
590 #define ISTRUNK(p) ((p->sig == SIG_FXSLS) || (p->sig == SIG_FXSKS) || \ 591 (p->sig == SIG_FXSGS) || (p->sig == SIG_PRI)) 593 #define CANBUSYDETECT(p) (ISTRUNK(p) || (p->sig & (SIG_EM | SIG_EM_E1 | SIG_SF)) ) 594 #define CANPROGRESSDETECT(p) (ISTRUNK(p) || (p->sig & (SIG_EM | SIG_EM_E1 | SIG_SF)) ) 601 #ifndef HAVE_DAHDI_LINEREVERSE_VMWI 615 #define REPORT_CHANNEL_ALARMS 1 616 #define REPORT_SPAN_ALARMS 2 620 static int pridebugfd = -1;
621 static char pridebugfilename[1024] =
"";
655 if (ioctl(fd, DAHDI_GETEVENT, &j) == -1)
664 i = DAHDI_IOMUX_SIGEVENT;
665 if (ioctl(fd, DAHDI_IOMUX, &i) == -1)
667 if (ioctl(fd, DAHDI_GETEVENT, &j) == -1)
673 #define READ_SIZE 160 675 #define MASK_AVAIL (1 << 0) 676 #define MASK_INUSE (1 << 1) 678 #define CALLWAITING_SILENT_SAMPLES ((300 * 8) / READ_SIZE) 679 #define CALLWAITING_REPEAT_SAMPLES ((10000 * 8) / READ_SIZE) 680 #define CALLWAITING_SUPPRESS_SAMPLES ((100 * 8) / READ_SIZE) 681 #define CIDCW_EXPIRE_SAMPLES ((500 * 8) / READ_SIZE) 682 #define MIN_MS_SINCE_FLASH ((2000) ) 683 #define DEFAULT_RINGT ((8000 * 8) / READ_SIZE) 684 #define DEFAULT_DIALTONE_DETECT_TIMEOUT ((10000 * 8) / READ_SIZE) 692 #if defined(HAVE_SS7) 698 static struct dahdi_ss7 linksets[NUM_SPANS];
700 static int cur_ss7type = -1;
701 static int cur_slc = -1;
702 static int cur_linkset = -1;
703 static int cur_pointcode = -1;
704 static int cur_cicbeginswith = -1;
705 static int cur_adjpointcode = -1;
706 static int cur_networkindicator = -1;
707 static int cur_defaultdpc = -1;
711 struct dahdi_mfcr2_conf {
712 openr2_variant_t variant;
714 int metering_pulse_timeout;
717 #if defined(OR2_LIB_INTERFACE) && OR2_LIB_INTERFACE > 2 721 #if defined(OR2_LIB_INTERFACE) && OR2_LIB_INTERFACE > 3 722 int dtmf_end_timeout;
724 signed int get_ani_first:2;
725 #if defined(OR2_LIB_INTERFACE) && OR2_LIB_INTERFACE > 1 726 signed int skip_category_request:2;
728 unsigned int call_files:1;
729 unsigned int allow_collect_calls:1;
730 unsigned int charge_calls:1;
731 unsigned int accept_on_offer:1;
732 unsigned int forced_release:1;
733 unsigned int double_answer:1;
734 signed int immediate_accept:2;
735 #if defined(OR2_LIB_INTERFACE) && OR2_LIB_INTERFACE > 2 736 signed int dtmf_dialing:2;
737 signed int dtmf_detection:2;
739 char logdir[OR2_MAX_PATH];
740 char r2proto_file[OR2_MAX_PATH];
741 openr2_log_level_t loglevel;
742 openr2_calling_party_category_t category;
749 openr2_context_t *protocol_context;
754 struct dahdi_mfcr2_conf conf;
757 struct r2link_entry {
758 struct dahdi_mfcr2 mfcr2;
766 static int r2links_count = 0;
774 int mastertrunkgroup;
779 static struct dahdi_pri pris[NUM_SPANS];
781 #if defined(HAVE_PRI_CCSS) 783 static const char dahdi_pri_cc_type[] =
"DAHDI/PRI";
792 #define POLARITY_IDLE 0 793 #define POLARITY_REV 1 804 #if defined(HAVE_PRI) 813 static struct dahdi_parms_pseudo {
818 } dahdi_pseudo_parms;
834 struct dahdi_pri pri;
837 #if defined(HAVE_SS7) 838 struct dahdi_ss7 ss7;
842 struct dahdi_mfcr2_conf mfcr2;
844 struct dahdi_params timing;
878 .switchtype = PRI_SWITCH_NI2,
879 .dialplan = PRI_UNKNOWN + 1,
880 .localdialplan = PRI_NATIONAL_ISDN + 1,
884 #if defined(HAVE_PRI_CCSS) 885 .cc_ptmp_recall_mode = 1,
886 .cc_qsig_signaling_link_req = 1,
887 .cc_qsig_signaling_link_rsp = 1,
893 .internationalprefix =
"",
894 .nationalprefix =
"",
902 #if defined(HAVE_SS7) 904 .called_nai = SS7_NAI_NATIONAL,
905 .calling_nai = SS7_NAI_NATIONAL,
906 .internationalprefix =
"",
907 .nationalprefix =
"",
908 .subscriberprefix =
"",
910 .networkroutedprefix =
"" 915 .variant = OR2_VAR_ITU,
916 .mfback_timeout = -1,
917 .metering_pulse_timeout = -1,
921 #if defined(OR2_LIB_INTERFACE) && OR2_LIB_INTERFACE > 1 922 .skip_category_request = -1,
925 .allow_collect_calls = 0,
927 .accept_on_offer = 1,
930 .immediate_accept = -1,
931 #if defined(OR2_LIB_INTERFACE) && OR2_LIB_INTERFACE > 2 933 .dtmf_detection = -1,
934 .dtmf_time_on = OR2_DEFAULT_DTMF_ON,
935 .dtmf_time_off = OR2_DEFAULT_DTMF_OFF,
937 #if defined(OR2_LIB_INTERFACE) && OR2_LIB_INTERFACE > 3 938 .dtmf_end_timeout = -1,
942 .loglevel = OR2_LOG_ERROR | OR2_LOG_WARNING,
943 .category = OR2_CALLING_PARTY_CATEGORY_NATIONAL_SUBSCRIBER
947 .context =
"default",
951 .mohinterpret =
"default",
958 .dahditrcallerid = 0,
967 .echocancel.head.tap_length = 1,
975 #ifdef HAVE_DAHDI_LINEREVERSE_VMWI 978 .polarityonanswerdelay = 600,
982 .buf_policy = DAHDI_POLICY_IMMEDIATE,
1001 .ignore_failed_channels = 1,
1002 .smdi_port =
"/dev/ttyS0",
1011 const char *
data,
int *cause);
1032 .description =
tdesc,
1053 #define GET_CHANNEL(p) ((p)->channel) 1110 return DAHDI_TONE_RINGTONE;
1112 return DAHDI_TONE_STUTTER;
1114 return DAHDI_TONE_CONGESTION;
1116 return DAHDI_TONE_DIALTONE;
1118 return DAHDI_TONE_DIALRECALL;
1120 return DAHDI_TONE_INFO;
1130 switch (analogsub) {
1159 struct doomed_pri *
entry;
1165 ast_debug(4,
"Destroying span %d from doomed queue.\n",
1167 pri_destroy_span(entry->pri);
1186 static void pri_queue_for_destruction(
struct sig_pri_span *pri)
1188 struct doomed_pri *
entry;
1192 if (entry->pri == pri) {
1197 entry =
ast_calloc(
sizeof(
struct doomed_pri), 1);
1205 ast_debug(4,
"Queue span %d for destruction.\n", pri->
span);
1228 struct dahdi_dialoperation zo = {
1234 for (offset = 0; offset <
sizeof(zo.dialstr) - 1; ++offset) {
1241 if (offset >=
sizeof(zo.dialstr) - 3) {
1245 zo.dialstr[offset] =
'w';
1247 zo.dialstr[offset] =
'w';
1250 zo.dialstr[offset] = *pos++;
1254 ast_debug(1,
"Channel %d: Dial str '%s' expanded to '%s' sent to DAHDI_DIAL.\n",
1255 pvt->
channel, dial_str, zo.dialstr);
1306 struct pollfd poller;
1310 unsigned char buf[256];
1314 poller.events = POLLPRI | POLLIN;
1317 res = poll(&poller, 1, timeout);
1319 if (poller.revents & POLLPRI) {
1324 if (poller.revents & POLLIN) {
1330 res = read(p->
subs[index].
dfd, buf,
sizeof(buf));
1336 if (analog_p->
ringt > 0) {
1337 if (!(--analog_p->
ringt)) {
1364 ast_debug(1,
"CallerID number: %s, name: %s, flags=%d\n", num, name, flags);
1377 unsigned char buf[256];
1385 int checkaftercid = 0;
1386 const char *matched_context;
1390 if (ringdata ==
NULL) {
1391 ringdata = curRingData;
1399 for (receivedRingT = 0; receivedRingT <
RING_PATTERNS; receivedRingT++)
1400 ringdata[receivedRingT] = 0;
1404 ast_verb(3,
"Detecting post-CID distinctive ring\n");
1408 i = DAHDI_IOMUX_READ | DAHDI_IOMUX_SIGEVENT;
1409 res = ioctl(p->
subs[idx].
dfd, DAHDI_IOMUX, &i);
1415 if (i & DAHDI_IOMUX_SIGEVENT) {
1418 if (res == DAHDI_EVENT_NOALARM) {
1421 }
else if (res == DAHDI_EVENT_RINGOFFHOOK) {
1423 ringdata[receivedRingT] = analog_p->
ringt;
1430 if (++receivedRingT == RING_PATTERNS) {
1434 }
else if (i & DAHDI_IOMUX_READ) {
1435 res = read(p->
subs[idx].
dfd, buf,
sizeof(buf));
1437 if (
errno != ELAST) {
1444 if (analog_p->
ringt > 0) {
1445 if (!(--analog_p->
ringt)) {
1454 ast_verb(3,
"Detected ring pattern: %d,%d,%d\n", ringdata[0], ringdata[1], ringdata[2]);
1456 for (counter = 0; counter < 3; counter++) {
1460 ast_verb(3,
"Checking %d,%d,%d with +/- %d range\n",
1465 for (counter1 = 0; counter1 < 3; counter1++) {
1469 ast_verb(3,
"Pattern ignore (-1) detected, so matching pattern %d regardless.\n",
1470 ringdata[counter1]);
1472 }
else if (ring - range <= ringdata[counter1] && ringdata[counter1] <= ring + range) {
1473 ast_verb(3,
"Ring pattern %d is in range: %d to %d\n",
1474 ringdata[counter1], ring - range, ring + range);
1482 if (distMatches == 3) {
1485 ast_verb(3,
"Matched Distinctive Ring context %s\n", matched_context);
1491 if (strcmp(p->
context, matched_context) != 0) {
1565 ast_verb(3,
"CPE supports Call Waiting Caller*ID. Sending '%s/%s'\n",
1637 ast_log(
LOG_ERROR,
"We used a sub other than SUB_REAL (incorrect assumption sir)\n");
1654 ast_debug(1,
"%s DTMF digit: 0x%02X '%c' on %s\n",
1664 struct dahdi_bufferinfo bi = {
1671 if ((res = ioctl(p->
subs[idx].
dfd, DAHDI_SET_BUFINFO, &bi)) < 0) {
1709 ast_debug(1,
"Already in a fax extension, not redirecting\n");
1718 *dest = &p->
subs[idx].
f;
1748 if (!channel_string) {
1758 "DAHDIGroup: %llu\r\n" 1760 "DAHDIChannel: %s\r\n",
1781 "channel", dahdi_channel);
1807 snprintf(ch_name,
sizeof(ch_name),
"no-media (%d)", p->
channel);
1810 strcpy(ch_name,
"pseudo");
1813 snprintf(ch_name,
sizeof(ch_name),
"%d", p->
channel);
1829 static void my_ami_channel_event(
void *pvt,
struct ast_channel *chan)
1889 return p->
subs[dahdi_sub].
dfd;
1929 #if defined(HAVE_PRI) || defined(HAVE_SS7) 1930 static void my_set_digital(
void *pvt,
int is_digital)
1938 #if defined(HAVE_SS7) 1939 static void my_set_inservice(
void *pvt,
int is_inservice)
1947 #if defined(HAVE_SS7) 1948 static void my_set_locallyblocked(
void *pvt,
int is_blocked)
1956 #if defined(HAVE_SS7) 1957 static void my_set_remotelyblocked(
void *pvt,
int is_blocked)
2041 p->
owner = new_owner;
2092 for (i = 0; i < 3; i++) {
2129 int needconf = needconference;
2235 #if defined(HAVE_PRI) || defined(HAVE_SS7) 2236 static int dahdi_setlaw(
int dfd,
int law)
2239 res = ioctl(dfd, DAHDI_SETLAW, &law);
2246 #if defined(HAVE_PRI) 2285 newlaw = DAHDI_LAW_ALAW;
2288 newlaw = DAHDI_LAW_MULAW;
2298 #if defined(HAVE_PRI) || defined(HAVE_SS7) 2308 static void my_pri_ss7_open_media(
void *p)
2319 res = ioctl(dfd, DAHDI_AUDIOMODE, &set_val);
2326 res = dahdi_setlaw(dfd, pvt->
law);
2348 #if defined(HAVE_PRI) 2361 static void my_pri_dial_digits(
void *p,
const char *dial_string)
2363 char dial_str[DAHDI_MAX_DTMF_BUF];
2367 snprintf(dial_str,
sizeof(dial_str),
"T%s", dial_string);
2417 case DAHDI_EVENT_ONHOOK:
2420 case DAHDI_EVENT_RINGOFFHOOK:
2423 case DAHDI_EVENT_WINKFLASH:
2426 case DAHDI_EVENT_ALARM:
2429 case DAHDI_EVENT_NOALARM:
2432 case DAHDI_EVENT_DIALCOMPLETE:
2435 case DAHDI_EVENT_RINGERON:
2438 case DAHDI_EVENT_RINGEROFF:
2441 case DAHDI_EVENT_HOOKCOMPLETE:
2444 case DAHDI_EVENT_PULSE_START:
2447 case DAHDI_EVENT_POLARITY:
2450 case DAHDI_EVENT_RINGBEGIN:
2453 case DAHDI_EVENT_EC_DISABLED:
2456 case DAHDI_EVENT_REMOVED:
2459 case DAHDI_EVENT_NEONMWI_ACTIVE:
2462 case DAHDI_EVENT_NEONMWI_INACTIVE:
2465 #ifdef HAVE_DAHDI_ECHOCANCEL_FAX_MODE 2466 case DAHDI_EVENT_TX_CED_DETECTED:
2469 case DAHDI_EVENT_RX_CED_DETECTED:
2472 case DAHDI_EVENT_EC_NLP_DISABLED:
2475 case DAHDI_EVENT_EC_NLP_ENABLED:
2479 case DAHDI_EVENT_PULSEDIGIT:
2482 case DAHDI_EVENT_DTMFDOWN:
2485 case DAHDI_EVENT_DTMFUP:
2489 switch(event & 0xFFFF0000) {
2490 case DAHDI_EVENT_PULSEDIGIT:
2491 case DAHDI_EVENT_DTMFDOWN:
2492 case DAHDI_EVENT_DTMFUP:
2534 struct dahdi_params par;
2536 memset(&par, 0,
sizeof(par));
2543 par.rxisoffhook = 0;
2553 return (par.rxbits > -1) || par.rxisoffhook;
2556 return par.rxisoffhook;
2583 int func = DAHDI_FLASH;
2650 int x = DAHDI_START;
2665 ast_log(
LOG_ERROR,
"Trying to dial_digits '%s' on channel %d subchannel %u\n",
2692 if (ioctl(p->
subs[index].
dfd, DAHDI_DIALING, &x)) {
2693 ast_debug(1,
"DAHDI_DIALING ioctl failed!\n");
2706 #if defined(HAVE_PRI) 2707 static void my_pri_fixup_chans(
void *chan_old,
void *chan_new)
2714 if (new_chan->
owner) {
2721 new_chan->
dsp = old_chan->
dsp;
2735 new_chan->
law = old_chan->
law;
2740 #if defined(HAVE_PRI) 2741 static int sig_pri_tone_to_dahditone(
enum sig_pri_tone tone)
2745 return DAHDI_TONE_RINGTONE;
2747 return DAHDI_TONE_STUTTER;
2749 return DAHDI_TONE_CONGESTION;
2751 return DAHDI_TONE_DIALTONE;
2753 return DAHDI_TONE_DIALRECALL;
2755 return DAHDI_TONE_INFO;
2757 return DAHDI_TONE_BUSY;
2764 #if defined(HAVE_PRI) 2765 static void my_handle_dchan_exception(
struct sig_pri_span *pri,
int index)
2769 ioctl(pri->
fds[index], DAHDI_GETEVENT, &x);
2771 case DAHDI_EVENT_NONE:
2773 case DAHDI_EVENT_ALARM:
2774 case DAHDI_EVENT_NOALARM:
2786 case DAHDI_EVENT_ALARM:
2789 case DAHDI_EVENT_NOALARM:
2792 case DAHDI_EVENT_REMOVED:
2793 pri_queue_for_destruction(pri);
2801 #if defined(HAVE_PRI) 2802 static int my_pri_play_tone(
void *pvt,
enum sig_pri_tone tone)
2806 return tone_zone_play_tone(p->
subs[
SUB_REAL].
dfd, sig_pri_tone_to_dahditone(tone));
2810 #if defined(HAVE_PRI) || defined(HAVE_SS7) 2821 static void my_set_callerid(
void *pvt,
const struct ast_party_caller *caller)
2836 if (caller->
id.
tag) {
2841 sizeof(p->cid_ani));
2846 #if defined(HAVE_PRI) || defined(HAVE_SS7) 2857 static void my_set_dnid(
void *pvt,
const char *
dnid)
2865 #if defined(HAVE_PRI) 2876 static void my_set_rdnis(
void *pvt,
const char *
rdnis)
2884 #if defined(HAVE_PRI) 2909 static void my_pri_make_cc_dialstring(
void *priv,
char *
buf,
size_t buf_size)
2930 snprintf(
buf, buf_size,
"%s/i%d-",
args.tech, pvt->pri->span);
2933 if (isdigit(
args.group[0]) ||
args.group[0] ==
'i' || strchr(
args.group,
'!')) {
2940 snprintf(
buf, buf_size,
"%s/i%d-%s",
args.tech, pvt->pri->span,
args.group);
2944 #if defined(HAVE_PRI) 2956 static void dahdi_pri_update_span_devstate(
struct sig_pri_span *pri)
2959 unsigned num_b_chans;
2968 for (idx = pri->
numchans; idx--;) {
2992 #if defined(THRESHOLD_DEVSTATE_PLACEHOLDER) 2996 }
else if (!in_use) {
2998 }
else if (!pri->user_busy_threshold) {
3004 if (pri->threshold_devstate != new_state) {
3005 pri->threshold_devstate = new_state;
3012 #if defined(HAVE_PRI) 3020 static void my_module_ref(
void)
3026 #if defined(HAVE_PRI) 3034 static void my_module_unref(
void)
3040 #if defined(HAVE_PRI) 3041 #if defined(HAVE_PRI_CALL_WAITING) 3042 static void my_pri_init_config(
void *priv,
struct sig_pri_span *pri);
3044 static int dahdi_new_pri_nobch_channel(
struct sig_pri_span *pri);
3049 .play_tone = my_pri_play_tone,
3055 .new_ast_channel = my_new_pri_ast_channel,
3056 .fixup_chans = my_pri_fixup_chans,
3060 .set_digital = my_set_digital,
3061 .set_callerid = my_set_callerid,
3062 .set_dnid = my_set_dnid,
3063 .set_rdnis = my_set_rdnis,
3064 .new_nobch_intf = dahdi_new_pri_nobch_channel,
3065 #if defined(HAVE_PRI_CALL_WAITING) 3066 .init_config = my_pri_init_config,
3069 .make_cc_dialstring = my_pri_make_cc_dialstring,
3070 .update_span_devstate = dahdi_pri_update_span_devstate,
3071 .module_ref = my_module_ref,
3072 .module_unref = my_module_unref,
3073 .dial_digits = my_pri_dial_digits,
3074 .open_media = my_pri_ss7_open_media,
3075 .ami_channel_event = my_ami_channel_event,
3076 .destroy_later = pri_queue_for_destruction,
3080 #if defined(HAVE_SS7) 3091 static void my_handle_link_exception(
struct sig_ss7_linkset *linkset,
int which)
3095 if (ioctl(linkset->
fds[which], DAHDI_GETEVENT, &event)) {
3097 linkset->
span, which);
3101 case DAHDI_EVENT_NONE:
3103 case DAHDI_EVENT_ALARM:
3108 case DAHDI_EVENT_NOALARM:
3121 #if defined(HAVE_SS7) 3122 static void my_ss7_set_loopback(
void *pvt,
int enable)
3133 #if defined(HAVE_SS7) 3153 if (linksets[idx].ss7.ss7 == ss7) {
3154 return &linksets[idx].ss7;
3161 #if defined(HAVE_SS7) 3203 newlaw = DAHDI_LAW_ALAW;
3206 newlaw = DAHDI_LAW_MULAW;
3213 #if defined(HAVE_SS7) 3214 static int sig_ss7_tone_to_dahditone(
enum sig_ss7_tone tone)
3218 return DAHDI_TONE_RINGTONE;
3220 return DAHDI_TONE_STUTTER;
3222 return DAHDI_TONE_CONGESTION;
3224 return DAHDI_TONE_DIALTONE;
3226 return DAHDI_TONE_DIALRECALL;
3228 return DAHDI_TONE_INFO;
3230 return DAHDI_TONE_BUSY;
3237 #if defined(HAVE_SS7) 3238 static int my_ss7_play_tone(
void *pvt,
enum sig_ss7_tone tone)
3242 return tone_zone_play_tone(p->
subs[
SUB_REAL].
dfd, sig_ss7_tone_to_dahditone(tone));
3246 #if defined(HAVE_SS7) 3254 .set_loopback = my_ss7_set_loopback,
3256 .new_ast_channel = my_new_ss7_ast_channel,
3257 .play_tone = my_ss7_play_tone,
3259 .handle_link_exception = my_handle_link_exception,
3263 .set_digital = my_set_digital,
3264 .set_inservice = my_set_inservice,
3265 .set_locallyblocked = my_set_locallyblocked,
3266 .set_remotelyblocked = my_set_remotelyblocked,
3267 .set_callerid = my_set_callerid,
3268 .set_dnid = my_set_dnid,
3269 .open_media = my_pri_ss7_open_media,
3270 .find_linkset = my_ss7_find_linkset,
3342 #define gen_pvt_field_callback(type, field) \ 3343 static type my_get_##field(void *pvt) \ 3345 struct dahdi_pvt *p = pvt; \ 3353 #undef gen_pvt_field_callback 3423 .get_firstdigit_timeout = my_get_firstdigit_timeout,
3424 .get_matchdigit_timeout = my_get_matchdigit_timeout,
3425 .get_interdigit_timeout = my_get_interdigit_timeout,
3444 "Unable to get index for '%s' on channel %d (%s(), line %lu)\n",
3539 #if defined(HAVE_PRI) 3554 static void mfcr2_queue_for_destruction(
const struct dahdi_pvt *p)
3556 const struct dahdi_mfcr2 *r2link = p->mfcr2;
3557 struct r2link_entry *cur;
3560 if (r2link == &cur->mfcr2) {
3570 static int dahdi_r2_answer(
struct dahdi_pvt *p)
3576 #if defined(OR2_LIB_INTERFACE) && OR2_LIB_INTERFACE > 1 3578 int wants_double_answer =
ast_true(double_answer) ? 1 : 0;
3579 if (!double_answer) {
3582 res = openr2_chan_answer_call(p->r2chan);
3583 }
else if (wants_double_answer) {
3584 res = openr2_chan_answer_call_with_mode(p->r2chan, OR2_ANSWER_DOUBLE);
3586 res = openr2_chan_answer_call_with_mode(p->r2chan, OR2_ANSWER_SIMPLE);
3589 res = openr2_chan_answer_call(p->r2chan);
3597 static openr2_calling_party_category_t dahdi_r2_get_channel_category(
struct ast_channel *c)
3599 openr2_calling_party_category_t cat;
3603 ast_debug(1,
"No MFC/R2 category specified for chan %s, using default %s\n",
3605 return p->mfcr2_category;
3607 if ((cat = openr2_proto_get_category(catstr)) == OR2_CALLING_PARTY_CATEGORY_UNKNOWN) {
3608 ast_log(
LOG_WARNING,
"Invalid category specified '%s' for chan %s, using default %s\n",
3609 catstr,
ast_channel_name(c), openr2_proto_get_category_string(p->mfcr2_category));
3610 return p->mfcr2_category;
3612 ast_debug(1,
"Using category %s\n", catstr);
3616 static void dahdi_r2_on_call_init(openr2_chan_t *r2chan)
3618 struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
3627 ast_log(
LOG_ERROR,
"Collision of calls on chan %d detected!.\n", openr2_chan_get_number(r2chan));
3637 p->mfcr2_ani_index =
'\0';
3638 p->mfcr2_dnis_index =
'\0';
3639 p->mfcr2_dnis_matched = 0;
3640 p->mfcr2_answer_pending = 0;
3641 p->mfcr2_call_accepted = 0;
3643 ast_verbose(
"New MFC/R2 call detected on chan %d.\n", openr2_chan_get_number(r2chan));
3646 static void dahdi_r2_on_hardware_alarm(openr2_chan_t *r2chan,
int alarm)
3649 struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
3654 if (res == DAHDI_ALARM_NOTOPEN) {
3655 mfcr2_queue_for_destruction(p);
3664 static void dahdi_r2_on_os_error(openr2_chan_t *r2chan,
int errorcode)
3666 struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
3668 ast_log(
LOG_ERROR,
"OS error on chan %d: %s\n", openr2_chan_get_number(r2chan), strerror(errorcode));
3671 if (errorcode == ENODEV) {
3672 struct dahdi_mfcr2 *r2link = p->mfcr2;
3681 static void dahdi_r2_on_protocol_error(openr2_chan_t *r2chan, openr2_protocol_error_t reason)
3683 struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
3684 ast_log(
LOG_ERROR,
"MFC/R2 protocol error on chan %d: %s\n", openr2_chan_get_number(r2chan), openr2_proto_get_error(reason));
3694 static void dahdi_r2_disconnect_call(
struct dahdi_pvt *p, openr2_call_disconnect_cause_t cause)
3696 if (openr2_chan_disconnect_call(p->r2chan, cause)) {
3697 ast_log(
LOG_NOTICE,
"Bad! failed to disconnect call on channel %d with reason %s, hope for the best!\n",
3698 p->
channel, openr2_proto_get_disconnect_string(cause));
3700 openr2_chan_set_idle(p->r2chan);
3707 static void dahdi_r2_on_call_offered(openr2_chan_t *r2chan,
const char *ani,
const char *dnis, openr2_calling_party_category_t category)
3713 ast_verbose(
"MFC/R2 call offered on chan %d. ANI = %s, DNIS = %s, Category = %s\n",
3714 openr2_chan_get_number(r2chan), ani ? ani :
"(restricted)", dnis,
3715 openr2_proto_get_category_string(category));
3716 p = openr2_chan_get_client_data(r2chan);
3718 if (!p->mfcr2_allow_collect_calls && category == OR2_CALLING_PARTY_CATEGORY_COLLECT_CALL) {
3720 dahdi_r2_disconnect_call(p, OR2_CAUSE_COLLECT_CALL_REJECTED);
3721 goto dahdi_r2_on_call_offered_cleanup;
3724 p->mfcr2_recvd_category = category;
3727 ast_debug(1,
"No CID allowed in configuration, CID is being cleared!\n");
3732 if (p->
immediate || !openr2_context_get_max_dnis(openr2_chan_get_context(r2chan))) {
3733 ast_debug(1,
"Setting exten => s because of immediate or 0 DNIS configured\n");
3739 ast_log(
LOG_NOTICE,
"MFC/R2 call on channel %d requested non-existent extension '%s' in context '%s'. Rejecting call.\n",
3741 dahdi_r2_disconnect_call(p, OR2_CAUSE_UNALLOCATED_NUMBER);
3742 goto dahdi_r2_on_call_offered_cleanup;
3744 if (!p->mfcr2_accept_on_offer) {
3751 goto dahdi_r2_on_call_offered_cleanup;
3754 dahdi_r2_disconnect_call(p, OR2_CAUSE_OUT_OF_ORDER);
3755 }
else if (p->mfcr2_charge_calls) {
3756 ast_debug(1,
"Accepting MFC/R2 call with charge on chan %d\n", p->
channel);
3757 openr2_chan_accept_call(r2chan, OR2_CALL_WITH_CHARGE);
3759 ast_debug(1,
"Accepting MFC/R2 call with no charge on chan %d\n", p->
channel);
3760 openr2_chan_accept_call(r2chan, OR2_CALL_NO_CHARGE);
3763 dahdi_r2_on_call_offered_cleanup:
3767 static void dahdi_r2_on_call_end(openr2_chan_t *r2chan)
3769 struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
3776 static void dahdi_r2_on_call_accepted(openr2_chan_t *r2chan, openr2_call_mode_t mode)
3782 p = openr2_chan_get_client_data(r2chan);
3784 p->mfcr2_call_accepted = 1;
3786 if (OR2_DIR_BACKWARD == openr2_chan_get_direction(r2chan)) {
3787 ast_verbose(
"MFC/R2 call has been accepted on backward channel %d\n", openr2_chan_get_number(r2chan));
3792 if (!p->mfcr2_accept_on_offer) {
3793 openr2_chan_disable_read(r2chan);
3794 if (p->mfcr2_answer_pending) {
3795 ast_debug(1,
"Answering MFC/R2 call after accepting it on chan %d\n", openr2_chan_get_number(r2chan));
3798 goto dahdi_r2_on_call_accepted_cleanup;
3804 openr2_chan_disable_read(r2chan);
3805 goto dahdi_r2_on_call_accepted_cleanup;
3809 dahdi_r2_disconnect_call(p, OR2_CAUSE_OUT_OF_ORDER);
3810 goto dahdi_r2_on_call_accepted_cleanup;
3817 openr2_chan_disable_read(r2chan);
3819 dahdi_r2_on_call_accepted_cleanup:
3823 static void dahdi_r2_on_call_answered(openr2_chan_t *r2chan)
3825 struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
3826 ast_verbose(
"MFC/R2 call has been answered on channel %d\n", openr2_chan_get_number(r2chan));
3830 static void dahdi_r2_on_call_read(openr2_chan_t *r2chan,
const unsigned char *
buf,
int buflen)
3835 static int dahdi_r2_cause_to_ast_cause(openr2_call_disconnect_cause_t cause)
3838 case OR2_CAUSE_BUSY_NUMBER:
3840 case OR2_CAUSE_NETWORK_CONGESTION:
3842 case OR2_CAUSE_OUT_OF_ORDER:
3844 case OR2_CAUSE_UNALLOCATED_NUMBER:
3846 case OR2_CAUSE_NO_ANSWER:
3848 case OR2_CAUSE_NORMAL_CLEARING:
3850 case OR2_CAUSE_UNSPECIFIED:
3856 static void dahdi_r2_on_call_disconnect(openr2_chan_t *r2chan, openr2_call_disconnect_cause_t cause)
3858 struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
3861 int datalen =
sizeof(*cause_code);
3863 ast_verbose(
"MFC/R2 call disconnected on channel %d\n", openr2_chan_get_number(r2chan));
3868 dahdi_r2_disconnect_call(p, OR2_CAUSE_NORMAL_CLEARING);
3872 snprintf(cause_str,
sizeof(cause_str),
"R2 DISCONNECT (%s)", openr2_proto_get_disconnect_string(cause));
3873 datalen += strlen(cause_str);
3875 memset(cause_code, 0, datalen);
3876 cause_code->
ast_cause = dahdi_r2_cause_to_ast_cause(cause);
3888 }
else if (openr2_chan_get_direction(r2chan) == OR2_DIR_FORWARD) {
3891 case OR2_CAUSE_BUSY_NUMBER:
3894 case OR2_CAUSE_NETWORK_CONGESTION:
3895 case OR2_CAUSE_OUT_OF_ORDER:
3896 case OR2_CAUSE_UNALLOCATED_NUMBER:
3897 case OR2_CAUSE_NO_ANSWER:
3898 case OR2_CAUSE_UNSPECIFIED:
3899 case OR2_CAUSE_NORMAL_CLEARING:
3914 static void dahdi_r2_write_log(openr2_log_level_t level,
char *logmessage)
3917 case OR2_LOG_NOTICE:
3920 case OR2_LOG_WARNING:
3926 case OR2_LOG_STACK_TRACE:
3927 case OR2_LOG_MF_TRACE:
3928 case OR2_LOG_CAS_TRACE:
3930 case OR2_LOG_EX_DEBUG:
3940 static void dahdi_r2_on_line_blocked(openr2_chan_t *r2chan)
3942 struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
3946 ast_log(
LOG_NOTICE,
"Far end blocked on chan %d\n", openr2_chan_get_number(r2chan));
3949 static void dahdi_r2_on_line_idle(openr2_chan_t *r2chan)
3951 struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
3955 ast_log(
LOG_NOTICE,
"Far end unblocked on chan %d\n", openr2_chan_get_number(r2chan));
3958 static void dahdi_r2_on_context_log(openr2_context_t *r2context, openr2_log_level_t level,
const char *fmt, va_list ap)
3959 __attribute__((
format (printf, 3, 0)));
3960 static void dahdi_r2_on_context_log(openr2_context_t *r2context, openr2_log_level_t level,
const char *fmt, va_list ap)
3962 #define CONTEXT_TAG "Context - " 3964 char completemsg[
sizeof(logmsg) +
sizeof(CONTEXT_TAG) - 1];
3965 vsnprintf(logmsg,
sizeof(logmsg), fmt, ap);
3966 snprintf(completemsg,
sizeof(completemsg), CONTEXT_TAG
"%s", logmsg);
3967 dahdi_r2_write_log(level, completemsg);
3971 static void dahdi_r2_on_chan_log(openr2_chan_t *r2chan, openr2_log_level_t level,
const char *fmt, va_list ap)
3972 __attribute__((
format (printf, 3, 0)));
3973 static void dahdi_r2_on_chan_log(openr2_chan_t *r2chan, openr2_log_level_t level,
const char *fmt, va_list ap)
3975 #define CHAN_TAG "Chan " 3977 char completemsg[
sizeof(logmsg) +
sizeof(CHAN_TAG) - 1];
3978 vsnprintf(logmsg,
sizeof(logmsg), fmt, ap);
3979 snprintf(completemsg,
sizeof(completemsg), CHAN_TAG
"%d - %s", openr2_chan_get_number(r2chan), logmsg);
3980 dahdi_r2_write_log(level, completemsg);
3983 static int dahdi_r2_on_dnis_digit_received(openr2_chan_t *r2chan,
char digit)
3985 struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
3992 p->mfcr2_dnis_index++;
3993 p->
exten[p->mfcr2_dnis_index] = 0;
3994 p->
rdnis[p->mfcr2_dnis_index] = 0;
3996 if ((p->mfcr2_dnis_matched ||
4005 static void dahdi_r2_on_ani_digit_received(openr2_chan_t *r2chan,
char digit)
4007 struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
4010 p->mfcr2_ani_index++;
4011 p->
cid_num[p->mfcr2_ani_index] = 0;
4012 p->
cid_name[p->mfcr2_ani_index] = 0;
4015 static void dahdi_r2_on_billing_pulse_received(openr2_chan_t *r2chan)
4017 ast_verbose(
"MFC/R2 billing pulse received on channel %d\n", openr2_chan_get_number(r2chan));
4020 static openr2_event_interface_t dahdi_r2_event_iface = {
4021 .on_call_init = dahdi_r2_on_call_init,
4022 .on_call_offered = dahdi_r2_on_call_offered,
4023 .on_call_accepted = dahdi_r2_on_call_accepted,
4024 .on_call_answered = dahdi_r2_on_call_answered,
4025 .on_call_disconnect = dahdi_r2_on_call_disconnect,
4026 .on_call_end = dahdi_r2_on_call_end,
4027 .on_call_read = dahdi_r2_on_call_read,
4028 .on_hardware_alarm = dahdi_r2_on_hardware_alarm,
4029 .on_os_error = dahdi_r2_on_os_error,
4030 .on_protocol_error = dahdi_r2_on_protocol_error,
4031 .on_line_blocked = dahdi_r2_on_line_blocked,
4032 .on_line_idle = dahdi_r2_on_line_idle,
4034 .on_context_log = (openr2_handle_context_logging_func)dahdi_r2_on_context_log,
4035 .on_dnis_digit_received = dahdi_r2_on_dnis_digit_received,
4036 .on_ani_digit_received = dahdi_r2_on_ani_digit_received,
4038 .on_billing_pulse_received = dahdi_r2_on_billing_pulse_received
4041 static inline int16_t dahdi_r2_alaw_to_linear(uint8_t sample)
4046 static inline uint8_t dahdi_r2_linear_to_alaw(
int sample)
4051 static openr2_transcoder_interface_t dahdi_r2_transcode_iface = {
4052 dahdi_r2_alaw_to_linear,
4053 dahdi_r2_linear_to_alaw
4064 ast_debug(1,
"Swapping %d and %d\n", a, b);
4094 for (x = 0; x < strlen(fn); x++) {
4095 if (!isdigit(fn[x])) {
4106 fn =
"/dev/dahdi/channel";
4108 fd = open(fn, O_RDWR | O_NONBLOCK);
4114 if (ioctl(fd, DAHDI_SPECIFY, &chan)) {
4123 if (ioctl(fd, DAHDI_SET_BLOCKSIZE, &bs) == -1) {
4142 chan_pvt->
subs[sub_num].
dfd = -1;
4145 #if defined(HAVE_PRI) 4146 static void dahdi_close_pri_fd(
struct dahdi_pri *pri,
int fd_num)
4149 pri->pri.fds[fd_num] = -1;
4153 #if defined(HAVE_SS7) 4154 static void dahdi_close_ss7_fd(
struct dahdi_ss7 *ss7,
int fd_num)
4157 ss7->ss7.fds[fd_num] = -1;
4163 return ioctl(dfd, DAHDI_SETLINEAR, &linear);
4169 struct dahdi_bufferinfo bi;
4182 res = ioctl(p->
subs[x].
dfd, DAHDI_GET_BUFINFO, &bi);
4187 res = ioctl(p->
subs[x].
dfd, DAHDI_SET_BUFINFO, &bi);
4224 return DAHDI_TONE_DTMF_BASE + (digit -
'0');
4225 else if (digit >=
'A' && digit <=
'D')
4226 return DAHDI_TONE_DTMF_A + (digit -
'A');
4227 else if (digit >=
'a' && digit <=
'd')
4228 return DAHDI_TONE_DTMF_A + (digit -
'a');
4229 else if (digit ==
'*')
4230 return DAHDI_TONE_DTMF_s;
4231 else if (digit ==
'#')
4232 return DAHDI_TONE_DTMF_p;
4271 char dial_str[] = {
'T',
digit,
'\0' };
4282 dtmf = DAHDI_FLUSH_WRITE;
4285 ast_log(
LOG_WARNING,
"Unable to flush the DAHDI write buffer to send DTMF on channel %d: %s\n",
4289 ast_debug(1,
"Channel %s started VLDTMF digit '%c'\n",
4324 ast_debug(1,
"Channel %s ending VLDTMF digit '%c'\n",
4350 "Hook Transition Complete",
4355 "Polarity Reversal",
4363 { DAHDI_ALARM_RED,
"Red Alarm" },
4364 { DAHDI_ALARM_YELLOW,
"Yellow Alarm" },
4365 { DAHDI_ALARM_BLUE,
"Blue Alarm" },
4366 { DAHDI_ALARM_RECOVER,
"Recovering" },
4367 { DAHDI_ALARM_LOOPBACK,
"Loopback" },
4368 { DAHDI_ALARM_NOTOPEN,
"Not Open" },
4369 { DAHDI_ALARM_NONE,
"None" },
4379 return alm ?
"Unknown Alarm" :
"No Alarm";
4384 static char buf[256];
4387 sprintf(buf,
"Event %d", event);
4393 static char buf[256];
4396 return "E & M Immediate";
4398 return "E & M Wink";
4402 return "Feature Group D (DTMF)";
4404 return "Feature Group D (MF)";
4406 return "Feature Groud D (MF) Tandem Access";
4408 return "Feature Group B (MF)";
4412 return "FGC/CAMA (Dialpulse)";
4414 return "FGC/CAMA (MF)";
4416 return "FXS Loopstart";
4418 return "FXS Groundstart";
4420 return "FXS Kewlstart";
4422 return "FXO Loopstart";
4424 return "FXO Groundstart";
4426 return "FXO Kewlstart";
4430 return "ISDN BRI Point to Point";
4432 return "ISDN BRI Point to MultiPoint";
4438 return "SF (Tone) Immediate";
4440 return "SF (Tone) Wink";
4442 return "SF (Tone) with Feature Group D (DTMF)";
4444 return "SF (Tone) with Feature Group D (MF)";
4446 return "SF (Tone) with Feature Group B (MF)";
4450 snprintf(buf,
sizeof(buf),
"Unknown signalling %d", sig);
4455 #define sig2str dahdi_sig2str 4461 struct dahdi_confinfo zi;
4463 memset(&zi, 0,
sizeof(zi));
4466 if (slavechannel > 0) {
4468 zi.confmode = DAHDI_CONF_DIGITALMON;
4469 zi.confno = slavechannel;
4473 zi.confmode = DAHDI_CONF_REALANDPSEUDO | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER |
4474 DAHDI_CONF_PSEUDO_TALKER | DAHDI_CONF_PSEUDO_LISTENER;
4476 zi.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
4479 if ((zi.confno == c->
curconf.confno) && (zi.confmode == c->
curconf.confmode))
4483 if (ioctl(c->
dfd, DAHDI_SETCONF, &zi)) {
4487 if (slavechannel < 1) {
4508 struct dahdi_confinfo zi;
4515 memset(&zi, 0,
sizeof(zi));
4516 if (ioctl(c->
dfd, DAHDI_SETCONF, &zi)) {
4533 for (x = 0; x < 3; x++) {
4541 if (useslavenative) {
4560 else if (slave->
law != p->
law) {
4566 return useslavenative;
4574 struct dahdi_confinfo zi;
4576 memset(&zi, 0,
sizeof(zi));
4592 for (x = 0; x < 3; x++) {
4635 ast_debug(1,
"Updated conferencing on %d, with %d conference users\n", p->
channel, needconf);
4644 ast_debug(1,
"Echo cancellation already on\n");
4648 ast_debug(1,
"Echo cancellation isn't required on digital connection\n");
4652 #if defined(HAVE_PRI) || defined(HAVE_SS7) 4654 #if defined(HAVE_PRI) 4665 #if defined(HAVE_SS7) 4674 "Unable to enable audio mode on channel %d (%s)\n",
4690 ast_debug(1,
"No echo cancellation requested\n");
4706 ast_debug(1,
"No echo training requested\n");
4715 struct dahdi_echocanparams ecp = { .tap_length = 0 };
4730 struct dahdi_hwgain hwgain;
4732 hwgain.newgain = gain * 10.0;
4733 hwgain.tx = tx_direction;
4734 return ioctl(fd, DAHDI_SET_HWGAIN, &hwgain) < 0;
4741 float shallow, steep;
4742 float max = SHRT_MAX;
4744 neg = (sample < 0 ? -1 : 1);
4746 shallow = neg*(max-max/drc)+(
float)sample/drc;
4747 if (fabsf(steep) < fabsf(shallow)) {
4758 static void fill_txgain(
struct dahdi_gains *g,
float gain,
float drc,
int law)
4763 float linear_gain = pow(10.0, gain / 20.0);
4766 case DAHDI_LAW_ALAW:
4767 for (j = 0; j <
ARRAY_LEN(g->txgain); j++) {
4773 k = (float)k * linear_gain;
4776 }
else if (k < -32768) {
4785 case DAHDI_LAW_MULAW:
4786 for (j = 0; j <
ARRAY_LEN(g->txgain); j++) {
4792 k = (float)k * linear_gain;
4795 }
else if (k < -32768) {
4808 static void fill_rxgain(
struct dahdi_gains *g,
float gain,
float drc,
int law)
4812 float linear_gain = pow(10.0, gain / 20.0);
4815 case DAHDI_LAW_ALAW:
4816 for (j = 0; j <
ARRAY_LEN(g->rxgain); j++) {
4822 k = (float)k * linear_gain;
4825 }
else if (k < -32768) {
4834 case DAHDI_LAW_MULAW:
4835 for (j = 0; j <
ARRAY_LEN(g->rxgain); j++) {
4841 k = (float)k * linear_gain;
4844 }
else if (k < -32768) {
4858 struct dahdi_gains g;
4861 memset(&g, 0,
sizeof(g));
4862 res = ioctl(fd, DAHDI_GETGAINS, &g);
4870 return ioctl(fd, DAHDI_SETGAINS, &g);
4875 struct dahdi_gains g;
4878 memset(&g, 0,
sizeof(g));
4879 res = ioctl(fd, DAHDI_GETGAINS, &g);
4887 return ioctl(fd, DAHDI_SETGAINS, &g);
4890 static int set_actual_gain(
int fd,
float rxgain,
float txgain,
float rxdrc,
float txdrc,
int law)
4927 res = ioctl(fd, DAHDI_HOOK, &x);
4930 if (
errno == EINPROGRESS)
4944 #if defined(HAVE_PRI) || defined(HAVE_SS7) 4946 #if defined(HAVE_PRI) 4954 #if defined(HAVE_SS7) 4978 struct dahdi_confinfo c;
4991 memset(&c, 0,
sizeof(c));
4992 c.confmode = DAHDI_CONF_NORMAL;
4998 ast_debug(1,
"Disabled conferencing\n");
5012 ast_debug(1,
"Restored conferencing\n");
5064 if (
errno == EAGAIN)
5143 #if defined(HAVE_PRI) 5150 subaddr = strchr(p->
exten,
':');
5179 x = DAHDI_FLUSH_READ | DAHDI_FLUSH_WRITE;
5194 (p->
law == DAHDI_LAW_ALAW) ? PRI_LAYER_1_ALAW : PRI_LAYER_1_ULAW);
5200 #if defined(HAVE_SS7) 5232 openr2_calling_party_category_t chancat;
5251 chancat = dahdi_r2_get_channel_category(ast);
5252 callres = openr2_chan_make_call(p->r2chan, l, (c + p->
stripmsd), chancat);
5253 if (-1 == callres) {
5258 p->mfcr2_call_accepted = 0;
5259 p->mfcr2_progress_sent = 0;
5289 for (cur = iflist; cur; cur = cur->
next) {
5337 }
else if (iflist == pvt) {
5345 }
else if (ifend == pvt) {
5356 #if defined(HAVE_PRI) 5411 #if defined(HAVE_PRI)