mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 08:29:45 +00:00
Quick fix to get hex output of D-Channel traffic in ozmod_libpri. Remove the comment chars in front of the #define IODEBUG to enable it (compile time tested only)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@703 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
9f892711a5
commit
391201452a
@ -31,6 +31,8 @@
|
|||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//#define IODEBUG
|
||||||
|
|
||||||
#include "openzap.h"
|
#include "openzap.h"
|
||||||
#include "lpwrap_pri.h"
|
#include "lpwrap_pri.h"
|
||||||
#ifndef HAVE_GETTIMEOFDAY
|
#ifndef HAVE_GETTIMEOFDAY
|
||||||
@ -123,8 +125,14 @@ static int __pri_lpwrap_read(struct pri *pri, void *buf, int buflen)
|
|||||||
memset(&((unsigned char*)buf)[res],0,2);
|
memset(&((unsigned char*)buf)[res],0,2);
|
||||||
res+=2;
|
res+=2;
|
||||||
|
|
||||||
//print_bits(buf, res-2, bb, sizeof(bb), 1, 0);
|
#ifdef IODEBUG
|
||||||
//zap_log(ZAP_LOG_DEBUG, "READ %d\n", res-2);
|
{
|
||||||
|
char bb[2048] = { 0 };
|
||||||
|
|
||||||
|
print_hex_bytes(buf, res - 2, bb, sizeof(bb));
|
||||||
|
zap_log(ZAP_LOG_DEBUG, "READ %d\n", res-2);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -137,11 +145,17 @@ static int __pri_lpwrap_write(struct pri *pri, void *buf, int buflen)
|
|||||||
if (zap_channel_write(spri->dchan, buf, buflen, &len) != ZAP_SUCCESS) {
|
if (zap_channel_write(spri->dchan, buf, buflen, &len) != ZAP_SUCCESS) {
|
||||||
zap_log(ZAP_LOG_CRIT, "span %d D-WRITE FAIL! [%s]\n", spri->span->span_id, spri->dchan->last_error);
|
zap_log(ZAP_LOG_CRIT, "span %d D-WRITE FAIL! [%s]\n", spri->span->span_id, spri->dchan->last_error);
|
||||||
zap_clear_flag(spri, LPWRAP_PRI_READY);
|
zap_clear_flag(spri, LPWRAP_PRI_READY);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//print_bits(buf, (int)buflen-2, bb, sizeof(bb), 1, 0);
|
#ifdef IODEBUG
|
||||||
//zap_log(ZAP_LOG_DEBUG, "WRITE %d\n", (int)buflen-2);
|
{
|
||||||
|
char bb[2048] = { 0 };
|
||||||
|
|
||||||
|
print_hex_bytes(buf, buflen - 2, bb, sizeof(bb));
|
||||||
|
zap_log(ZAP_LOG_DEBUG, "WRITE %d\n", (int)buflen-2);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return (int) buflen;
|
return (int) buflen;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user