Commit 04b732b6 authored by llea's avatar llea

stun.cxx modified for powerpc

Bugs fixed
parent d5fca2ee
......@@ -35,7 +35,7 @@ usage () {
echo "Options:
-prefix DIR Set install prefix
-oss Enable OSS support
-alsa Enable ALSA support [Not supported yet]
-alsa Enable ALSA support
-macosx Enable MacOSX audio support [Not supported yet]"
}
......@@ -129,7 +129,7 @@ fi
# Check for cc++2
dir=`is_in_path bin/ccgnu2-config ${CLASSIC_DIRS}:$CCPPDIR -p`
if [ x"dir" = x"" ]
if [ x"$dir" = x"" ]
then
echo "I couldn't find bin/ccgnu2-config in the standard dirs. Please edit"
echo "this script and set CCPPDIR."
......@@ -141,7 +141,7 @@ fi
# Check for ccRTP (include/ccrtp/rtp.h)
dir=`is_in_path include/ccrtp/rtp.h ${CLASSIC_DIRS}:$CCDIR -p`
if [ x"dir" = x"" ]
if [ x"$dir" = x"" ]
then
echo "I couldn't find ccrtp/rtp.h in the standard dirs. Please edit"
echo "this script and set CCRTPDIR."
......@@ -153,7 +153,7 @@ fi
# Check for oSIP (include/osip2/osip.h)
dir=`is_in_path include/osip2/osip.h ${CLASSIC_DIRS}:$OSIPDIR -p`
if [ x"dir" = x"" ]
if [ x"$dir" = x"" ]
then
echo "I couldn't find osip2/osip.h in the standard dirs.Please edit"
echo "this script and set OSIPDIR."
......@@ -165,7 +165,7 @@ fi
# Check for eXoSIP (include/eXosip/eXosip.h)
dir=`is_in_path include/eXosip/eXosip.h ${CLASSIC_DIRS}:$EXOSIPDIR -p`
if [ x"dir" = x"" ]
if [ x"$dir" = x"" ]
then
echo "I couldn't find exosip/exosip.h in the standard dirs. Please "
echo "edit this script and set EXOSIPDIR."
......
......@@ -19,7 +19,7 @@ METAL_SKINS = metal
ifdef ALSA
endif
INCPATH = -I. -I$(QTDIR)/include -I$(CCPPDIR)/include/cc++2 -I$(CCRTPDIR)/include -I$(OSIPDIR)/include -I$(EXOPSIP)/include -I/usr/include -I../gsm
CXXFLAGS = -pipe -Wall -W -g -pipe -march=i386 -mcpu=i686 -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -fpermissive -Wno-deprecated $(INCPATH)
......@@ -29,6 +29,7 @@ LIBS=-L$(QTDIR)/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm -L/opt/lib -losip2
EXTRALIBS=../gsm/libgsm.a
CONFIGURE_CONF=$(shell ls ../configure.conf)
OBJS = \
audiobuffer.o \
......@@ -67,8 +68,8 @@ OBJS = \
volumecontrol.o volumecontrol.moc.o \
stun.o udp.o
#start: check prereq all
start: check all
start: check prereq all
#start: check all
check:
ifeq ($(CONFIGURE_CONF),../configure.conf)
......
......@@ -334,13 +334,12 @@ AudioRtpRTX::run (void) {
if (countTime < 10 and countTime > 0) {
manager->notificationIncomingCall();
}
}
}
// Write data or notification
i = audioDevice->writeBuffer ();
delete adu;
// Let's wait for the next transmit cycle
Thread::sleep(TimerPort::getTimer());
TimerPort::incTimer(frameSize); // 'frameSize' ms
......
/****************************************************************************
** Form implementation generated from reading ui file 'configurationpanel.ui'
**
** Created: Wed Apr 20 14:48:03 2005
** Created: Mon Apr 25 16:32:28 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form interface generated from reading ui file 'configurationpanel.ui'
**
** Created: Wed Apr 20 14:48:03 2005
** Created: Mon Apr 25 16:32:28 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
......@@ -320,11 +320,15 @@ Manager::actionHandle (int lineNumber, int action) {
break;
case TRANSFER_CALL:
sip->manageActions (lineNumber, TRANSFER_CALL);
if (sip->call[lineNumber] != NULL) {
sip->manageActions (lineNumber, TRANSFER_CALL);
}
break;
case CANCEL_CALL:
sip->manageActions (lineNumber, CANCEL_CALL);
if (sip->call[lineNumber] != NULL) {
sip->manageActions (lineNumber, CANCEL_CALL);
}
break;
default:
......
/****************************************************************************
** Form implementation generated from reading ui file 'phonebook.ui'
**
** Created: Wed Apr 20 14:48:03 2005
** Created: Mon Apr 25 16:32:27 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form interface generated from reading ui file 'phonebook.ui'
**
** Created: Wed Apr 20 14:48:03 2005
** Created: Mon Apr 25 16:32:27 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
......@@ -1344,9 +1344,11 @@ QtGUIMainWindow::keyPressEvent(QKeyEvent *e) {
break;
case Qt::Key_Escape:
lcd->clear();
hangupLine();
return;
break;
break;
case Qt::Key_Return:
case Qt::Key_Enter:
......@@ -1363,14 +1365,20 @@ QtGUIMainWindow::keyPressEvent(QKeyEvent *e) {
this->toggleLine(e->key() - Qt::Key_F1);
return;
break;
case Qt::Key_L:
if (e->state() == Qt::ControlButton ) {
lcd->clear();
return;
}
break;
case Qt::Key_Q :
if (e->state() == Qt::ControlButton ) {
emit keyPressed(e->key());
return;
}
break;
case Qt::Key_L :
case Qt::Key_O :
if (e->state() == Qt::ControlButton ) {
urlinput->show();
return;
......
......@@ -512,24 +512,24 @@ SIP::outgoingInvite (void) {
qDebug ("From: %s", from);
qDebug ("To: <%s>", to);
// If no SIP proxy setting
if (Config::gets("Signalisations", "SIP.sipproxy") == "") {
// If no SIP proxy setting for direct call with only IP address
if (startCall(from, to, NULL, NULL) <= 0) {
qDebug("SIP: no start call");
return -1;
}
return 0;
} else {
// If SIP proxy setting
string qroute = "<sip:" +
Config::gets("Signalisations", "SIP.sipproxy") + ";lr>";
char * route = (char*)qroute.data();
if (startCall(from, to, NULL, route) <= 0) {
qDebug("SIP: no start call");
return -1;
}
return 0;
}
string qroute = "<sip:" + Config::gets("Signalisations", "SIP.sipproxy")
+ ";lr>";
char * route = (char*)qroute.data();
if (startCall(from, to, NULL, route) <= 0) {
qDebug("SIP: no start call");
return -1;
}
return 0;
}
int
......@@ -570,7 +570,7 @@ SIP::manageActions (int usedLine, int action) {
assert (usedLine < NUMBER_OF_LINES);
assert (usedLine >= 0);
bzero (tmpbuf, 64);
// Get local port
snprintf (tmpbuf, 63, "%d", call[usedLine]->getLocalAudioPort());
......
......@@ -17,11 +17,11 @@
</property>
<widget class="QPushButton">
<property name="name">
<cstring>buttonCancel</cstring>
<cstring>buttonOK</cstring>
</property>
<property name="geometry">
<rect>
<x>228</x>
<x>208</x>
<y>-1</y>
<width>20</width>
<height>23</height>
......@@ -39,39 +39,23 @@
<height>23</height>
</size>
</property>
<property name="focusPolicy">
<enum>StrongFocus</enum>
</property>
<property name="text">
<string>0</string>
<string>1</string>
</property>
<property name="accel">
<string></string>
</property>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>url</cstring>
</property>
<property name="geometry">
<rect>
<x>-1</x>
<y>0</y>
<width>210</width>
<height>23</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>210</width>
<height>0</height>
</size>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonOK</cstring>
<cstring>buttonCancel</cstring>
</property>
<property name="geometry">
<rect>
<x>208</x>
<x>228</x>
<y>-1</y>
<width>20</width>
<height>23</height>
......@@ -89,13 +73,38 @@
<height>23</height>
</size>
</property>
<property name="focusPolicy">
<enum>TabFocus</enum>
</property>
<property name="text">
<string>1</string>
<string>0</string>
</property>
<property name="accel">
<string></string>
</property>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>url</cstring>
</property>
<property name="geometry">
<rect>
<x>-1</x>
<y>0</y>
<width>210</width>
<height>23</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>210</width>
<height>0</height>
</size>
</property>
<property name="focusPolicy">
<enum>StrongFocus</enum>
</property>
</widget>
</widget>
<connections>
<connection>
......@@ -108,6 +117,7 @@
<tabstops>
<tabstop>url</tabstop>
<tabstop>buttonOK</tabstop>
<tabstop>buttonCancel</tabstop>
</tabstops>
<includes>
<include location="local" impldecl="in implementation">url_input.ui.h</include>
......
/****************************************************************************
** Form implementation generated from reading ui file 'url_input.ui'
**
** Created: Wed Apr 20 14:48:03 2005
** Created: Mon Apr 25 16:32:28 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......@@ -30,19 +30,22 @@ URL_Input::URL_Input( QWidget* parent, const char* name, bool modal, WFlags fl )
if ( !name )
setName( "URL_Input" );
buttonOK = new QPushButton( this, "buttonOK" );
buttonOK->setGeometry( QRect( 208, -1, 20, 23 ) );
buttonOK->setMinimumSize( QSize( 0, 23 ) );
buttonOK->setMaximumSize( QSize( 20, 23 ) );
buttonOK->setFocusPolicy( QPushButton::StrongFocus );
buttonCancel = new QPushButton( this, "buttonCancel" );
buttonCancel->setGeometry( QRect( 228, -1, 20, 23 ) );
buttonCancel->setMinimumSize( QSize( 0, 23 ) );
buttonCancel->setMaximumSize( QSize( 20, 23 ) );
buttonCancel->setFocusPolicy( QPushButton::TabFocus );
url = new QLineEdit( this, "url" );
url->setGeometry( QRect( -1, 0, 210, 23 ) );
url->setMinimumSize( QSize( 210, 0 ) );
buttonOK = new QPushButton( this, "buttonOK" );
buttonOK->setGeometry( QRect( 208, -1, 20, 23 ) );
buttonOK->setMinimumSize( QSize( 0, 23 ) );
buttonOK->setMaximumSize( QSize( 20, 23 ) );
url->setFocusPolicy( QLineEdit::StrongFocus );
languageChange();
resize( QSize(250, 21).expandedTo(minimumSizeHint()) );
clearWState( WState_Polished );
......@@ -52,6 +55,7 @@ URL_Input::URL_Input( QWidget* parent, const char* name, bool modal, WFlags fl )
// tab order
setTabOrder( url, buttonOK );
setTabOrder( buttonOK, buttonCancel );
}
/*
......@@ -69,9 +73,9 @@ URL_Input::~URL_Input()
void URL_Input::languageChange()
{
setCaption( tr( "URL_Input" ) );
buttonCancel->setText( tr( "0" ) );
buttonCancel->setAccel( QKeySequence( QString::null ) );
buttonOK->setText( tr( "1" ) );
buttonOK->setAccel( QKeySequence( QString::null ) );
buttonCancel->setText( tr( "0" ) );
buttonCancel->setAccel( QKeySequence( QString::null ) );
}
/****************************************************************************
** Form interface generated from reading ui file 'url_input.ui'
**
** Created: Wed Apr 20 14:48:03 2005
** Created: Mon Apr 25 16:32:27 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......@@ -28,9 +28,9 @@ public:
URL_Input( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~URL_Input();
QPushButton* buttonOK;
QPushButton* buttonCancel;
QLineEdit* url;
QPushButton* buttonOK;
protected:
......
No preview for this file type
No preview for this file type
......@@ -671,7 +671,7 @@ stunRand()
asm("rdtsc" : "=A" (tick));
#elif defined (__SUNPRO_CC) || defined( __sparc__ )
tick = gethrtime();
#elif defined(__MACH__)
#elif defined(__MACH__) || defined(__powerpc__)
int fd=open("/dev/random",O_RDONLY);
read(fd,&tick,sizeof(tick));
closesocket(fd);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment