📄 main.cpp
字号:
#include <qapplication.h>#include "kphone.h"#include <stdlib.h>#include <signal.h>int main( int argc, char **argv ){ int listenport = 5060; QString port = ""; QString dhost= ""; QString user = "default"; bool looseRoute = false; bool strictRoute = false; bool p2p = false; int debug = 0; QApplication a( argc, argv ); for ( int i = 0; i < a.argc(); i++ ) { if( QString( a.argv()[i] ) == "-u" ) { if( i+1 < a.argc() ) { user = QString( a.argv()[++i] ); } } else if( QString( a.argv()[i] ) == "-a" ) { if( i+1 < a.argc() ) { dhost = QString( a.argv()[++i] ); } } else if( QString( a.argv()[i] ) == "-p" ) { if( i+1 < a.argc() ) { port = QString( a.argv()[++i] ); } listenport = port.toInt(); } else if( QString( a.argv()[i] ) == "-t" ) { p2p = true; } else if( QString( a.argv()[i] ) == "-v" ) { if( i+1 < a.argc() ) { debug = atoi(a.argv()[++i]) ; } } else if( QString( a.argv()[i] ) == "-l" ) { looseRoute = true; } else if( QString( a.argv()[i] ) == "-s" ) { strictRoute = true; } else if( QString( a.argv()[i] ) == "-h" ) { printf (" -u <user> user identification in database \n -a <host> dissipate-host \n -p <port> portnumber to partner\n -t UA point to point (i.e. dissipate-host=host part of sip URI of the UA)\n -v n n=1 SIP messages n=2 debug info n=3 both\n -l loose route\n -s strict route\n"); exit ( 1); } } /* prevent zombie process when the video child is killed */ if (signal(SIGCHLD, SIG_IGN)) perror("signal(SIGCHLD, SIG_IGN)"); KPhone *phone = new KPhone( listenport, dhost, user, p2p, looseRoute, strictRoute, debug ); a.setMainWidget( phone ); phone->show(); return a.exec();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -