From b9391cffc2e82c27184e81cd8723677d9e100ce2 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Sat, 6 Nov 2010 18:28:37 +0100 Subject: [PATCH] ftmod_libpri: Fix reversed PTP/PTMP mode parameter --- libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c | 4 ++-- libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.c | 5 +++-- libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c index 9fed12da88..137efae52b 100644 --- a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c +++ b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c @@ -1099,14 +1099,14 @@ static void *ftdm_libpri_run(ftdm_thread_t *me, void *obj) break; case FTDM_TRUNK_BRI: res = lpwrap_init_bri(&isdn_data->spri, span, isdn_data->dchan, - isdn_data->pswitch, isdn_data->node, 0, isdn_data->debug); + isdn_data->pswitch, isdn_data->node, 1, isdn_data->debug); #ifndef HAVE_LIBPRI_BRI goto out; #endif break; case FTDM_TRUNK_BRI_PTMP: res = lpwrap_init_bri(&isdn_data->spri, span, isdn_data->dchan, - isdn_data->pswitch, isdn_data->node, 1, isdn_data->debug); + isdn_data->pswitch, isdn_data->node, 0, isdn_data->debug); #ifndef HAVE_LIBPRI_BRI goto out; #endif diff --git a/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.c b/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.c index 2cfdd82228..5b04abec1b 100644 --- a/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.c +++ b/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.c @@ -195,9 +195,10 @@ int lpwrap_init_pri(struct lpwrap_pri *spri, ftdm_span_t *span, ftdm_channel_t * return ret; } -int lpwrap_init_bri(struct lpwrap_pri *spri, ftdm_span_t *span, ftdm_channel_t *dchan, int swtype, int node, int ptmp, int debug) +int lpwrap_init_bri(struct lpwrap_pri *spri, ftdm_span_t *span, ftdm_channel_t *dchan, int swtype, int node, int ptp, int debug) { int ret = -1; + #ifdef HAVE_LIBPRI_BRI memset(spri, 0, sizeof(struct lpwrap_pri)); spri->dchan = dchan; @@ -208,7 +209,7 @@ int lpwrap_init_bri(struct lpwrap_pri *spri, ftdm_span_t *span, ftdm_channel_t * return ret; } - if ((spri->pri = pri_new_bri_cb(spri->dchan->sockfd, ptmp, node, swtype, __pri_lpwrap_read, __pri_lpwrap_write, spri))) { + if ((spri->pri = pri_new_bri_cb(spri->dchan->sockfd, ptp, node, swtype, __pri_lpwrap_read, __pri_lpwrap_write, spri))) { unsigned char buf[4] = { 0 }; size_t buflen = sizeof(buf), len = 0; diff --git a/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.h b/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.h index d3d1c43768..4701e27e18 100644 --- a/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.h +++ b/libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.h @@ -121,7 +121,7 @@ struct lpwrap_pri_event_list { const char *lpwrap_pri_event_str(lpwrap_pri_event_t event_id); int lpwrap_one_loop(struct lpwrap_pri *spri); int lpwrap_init_pri(struct lpwrap_pri *spri, ftdm_span_t *span, ftdm_channel_t *dchan, int swtype, int node, int debug); -int lpwrap_init_bri(struct lpwrap_pri *spri, ftdm_span_t *span, ftdm_channel_t *dchan, int swtype, int node, int ptmp, int debug); +int lpwrap_init_bri(struct lpwrap_pri *spri, ftdm_span_t *span, ftdm_channel_t *dchan, int swtype, int node, int ptp, int debug); int lpwrap_run_pri(struct lpwrap_pri *spri); #define lpwrap_run_bri(x) lpwrap_run_pri(x)