I finally succeeded in creating a working Windows CE application
using resiprocate. Is anyone interested in this? Or is resiprocate
already being used on Windows CE? (I didn't find much information
about it though)
Ok, I'll try to explain what I did to get resiprocate working on
WinCE, what problems I encountered and how they can be solved.
I'm using MS Visual Studio 8 and the Pocket PC 2003 SDK.
The resiprocate repository already includes several files to be able
to compile the library on WinCE. In the subdirectory rutil/wince there
are several standard include files which usually don't exist on wince,
like sys/types.h, errno.h etc. The availability of these files makes
the port a lot easier.
Compiling the library for WinCE is not that hard. I used a WinCE static
library project and I added the following source files:
- in contrib/ares: the ares_*.c files
- in rutil: all *.cxx files
- in rutil/dns: all *.cxx files
- in rutil/stun: all *.cxx files
- in rutil/wince: WceCompat.cxx
- in resip/dum: all *.cxx files
- in resip/stack: all *.cxx files except makeCert.cxx and MacSecurity.cxx
In the project settings, I added the following defines: WIN32, USE_ARES
and USING_CE
To the include directories, I added the rutil/wince, contrib/ares and
the ./ subdirectories (assuming that the project file is in the same
directory as the reSIProcate_7_1.sln file).
I also enabled the run-time type information flag in the project settings.
These settings should allow you to compile the library, but you won't
be able to create a working test application. First of all, when you try
to link the application, you'll get errors saying that functions like
'time', 'gmtime' etc are not found. You can solve this problem by using
the LibCE library which can be found at:
http://studierstube.icg.tu-graz.ac.at/handheld_ar/
After doing this, linking the application worked, but the test program
crashed very soon. After some debugging, I found out that the problem
was that inside the library, a sizeof(SipStack) resulted in 0x47900,
but doing the same thing in my main routine, resulted in 0x478f0. This
16 byte difference caused stack corruption and resulted in a crashing
program.
In my WinCE test program, windows.h was included before the
resip/SipStack.hxx file (by including the stdafx.h file). When compiling
the resiprocate library, the windows.h file is not included first, and
this seems to cause some datatype do be defined differently (I haven't
found out which one(s) exactly). When an #include <windows.h> was added
to the SipStack.cxx file, the size difference was no longer there.
Unfortunately, adding that include line to the SipStack.cxx file did not
allow a slightly more complex program to run. I then used a small script
to add a line "#include "resipconfig.h" to all the *.cxx and *.hxx files
in the rutil, rutil/dns, rutil/stun, rutil/wince, resip/dum and resip/stack
directories. In that resipconfig.h file, i put the following lines:
#ifdef WIN32
#include <winsock2.h>
#include <windows.h>
#endif // WIN32
After this I recompiled the library and tried the BasicCall.cxx test
application (using a WinMain() instead of the main() function). The
program worked perfectly and to prove it, I've added its output
below. After this, I modified the BasicCall.cxx file to make a call
to a SIP phone possible, and using EMIPLIB for the VoIP part, I was
able to establish a VoIP session between my PDA and the SIP phone.
I'm not sure if the way I solved the problem is a clean solution, but
it worked for me. Hopefully, someone else may find this information
useful as well.
Bye,
Jori
As promised, the output of the BasicCall program:
Load module: sipce.exe
Load module: msvcr80.dll
Load module: iphlpapi.dll
Load module: WS2.dll
Load module: coredll.dll.0413.MUI
Load module: coredll.dll
INFO | 20060703-100116.000 | sipce | RESIP:TRANSPORT | 3468433582 |
UdpTransport.cxx:36 | Creating UDP transport host= port=12005 ipv4=1
Load module: SSLLSP.DLL
Load module: AutoBind_lsp.dll
Load module: dtpt_lsp.dll
Load module: wspm.dll
INFO | 20060703-100119.000 | sipce | RESIP:TRANSPORT | 3468433582 |
UdpTransport.cxx:36 | Creating UDP transport host= port=12010 ipv4=1
UAC: Sending Options Request to UAS.
UAC(OPTIONS): testAppDialogSet: created.
Load module: dtpt_nsp.dll
Load module: nspm.dll
WARNING | 20060703-100122.000 | sipce | RESIP:DNS | 3468433582 |
DnsUtil.cxx:142 | local hostname does not contain a domain part
UAC: Sending Invite Request to UAS.
UAC(INVITE): testAppDialogSet: created.
INFO | 20060703-100124.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:1170 | Got: SipReq: OPTIONS UAS@xxxxxxxxx:12010
tid=604ea76a6b21cd6a cseq=OPTIONS contact=UAC@xxxxxxxxx:12005 / 1 from(wire)
UAS(OPTIONS): testAppDialogSet: created.
UAS(OPTIONS): testAppDialogSet: UAS UserProfile requested for msg: SipReq:
OPTIONS UAS@xxxxxxxxx:12010 tid=604ea76a6b21cd6a cseq=OPTIONS
contact=UAC@xxxxxxxxx:12005 / 1 from(wire)
UAS: ServerOutOfDialogReq-onReceivedRequest - SipReq: OPTIONS
UAS@xxxxxxxxx:12010 tid=604ea76a6b21cd6a cseq=OPTIONS
contact=UAC@xxxxxxxxx:12005 / 1 from(wire)
UAS: Sending 200 response to OPTIONS.
UAS(OPTIONS): testAppDialogSet: destroyed.
INFO | 20060703-100130.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TransactionState.cxx:762 | Retransmitting INVITE: SipReq: INVITE
UAS@xxxxxxxxx:12010 tid=8b49874ddd134919 cseq=INVITE
contact=UAC@xxxxxxxxx:12005 / 1 from(tu)
INFO | 20060703-100133.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:1170 | Got: SipReq: INVITE UAS@xxxxxxxxx:12010
tid=8b49874ddd134919 cseq=INVITE contact=UAC@xxxxxxxxx:12005 / 1 from(wire)
UAS(INVITE): testAppDialogSet: created.
UAS(INVITE): testAppDialogSet: UAS UserProfile requested for msg: SipReq:
INVITE UAS@xxxxxxxxx:12010 tid=8b49874ddd134919 cseq=INVITE
contact=UAC@xxxxxxxxx:12005 / 1 from(wire)
UAS(INVITE): testAppDialog: created.
INFO | 20060703-100137.000 | sipce | RESIP:DUM | 3468433582 |
InviteSession.cxx:2047 | Transition UAS_Start -> UAS_Offer
UAS: ServerInviteSession-onNewSession - SipReq: INVITE UAS@xxxxxxxxx:12010
tid=8b49874ddd134919 cseq=INVITE contact=UAC@xxxxxxxxx:12005 / 1 from(wire)
UAS: Sending 180 response.
INFO | 20060703-100140.000 | sipce | RESIP:DUM | 3468433582 |
ServerInviteSession.cxx:93 | UAS_Offer: provisional(180)
INFO | 20060703-100141.000 | sipce | RESIP:DUM | 3468433582 |
InviteSession.cxx:2047 | Transition UAS_Offer -> UAS_EarlyOffer
UAS: InviteSession-onOffer(SDP)
UAS: Sending 200 response with SDP answer.
INFO | 20060703-100143.000 | sipce | RESIP:DUM | 3468433582 |
ServerInviteSession.cxx:253 | UAS_EarlyOffer: provideAnswer
INFO | 20060703-100144.000 | sipce | RESIP:DUM | 3468433582 |
InviteSession.cxx:2047 | Transition UAS_EarlyOffer -> UAS_EarlyProvidedAnswer
INFO | 20060703-100146.000 | sipce | RESIP:DUM | 3468433582 |
ServerInviteSession.cxx:445 | UAS_EarlyProvidedAnswer: accept(200)
INFO | 20060703-100147.000 | sipce | RESIP:DUM | 3468433582 |
InviteSession.cxx:2047 | Transition UAS_EarlyProvidedAnswer -> UAS_Accepted
UAS: InviteSession-onConnected - SipResp: 200 tid=8b49874ddd134919 cseq=INVITE
contact=UAS@xxxxxxxxx:12010 / 1 from(tu)
INFO | 20060703-100149.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TransactionState.cxx:762 | Retransmitting INVITE: SipReq: INVITE
UAS@xxxxxxxxx:12010 tid=8b49874ddd134919 cseq=INVITE
contact=UAC@xxxxxxxxx:12005 / 1 from(tu)
INFO | 20060703-100152.000 | sipce | RESIP:DUM | 3468433582 |
InviteSession.cxx:778 | Retransmitting:
SIP/2.0 200 OK
Via: SIP/2.0/UDP
127.0.0.1:12005;branch=z9hG4bK-d87543-8b49874ddd134919-1--d87543-;rport=12005
Contact: <sip:UAS@xxxxxxxxx:12010>
To: <sip:UAS@xxxxxxxxx:12010>;tag=5120015b
From: <sip:UAC@xxxxxxxxx:1205>;tag=121cd071
Call-ID: 9e396f2271672908NDJiZDJhMjlkYjA3NTE3MmFjYjZiZDE0NTFmNGQ2ZmE.
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE
Content-Type: application/sdp
Content-Length: 266
v=0
o=1900 369696545 369696545 IN IP4 192.168.2.15
s=X-Lite
c=IN IP4 192.168.2.15
t=0 0
m=audio 8000 RTP/AVP 8 3 98 97 101
a=fmtp:101 0-15
a=rtpmap:8 pcma/8000
a=rtpmap:3 gsm/8000
a=rtpmap:98 iLBC
a=rtpmap:97 speex/8000
a=rtpmap:101 telephone-event/8000
INFO | 20060703-100159.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TransactionState.cxx:762 | Retransmitting INVITE: SipReq: INVITE
UAS@xxxxxxxxx:12010 tid=8b49874ddd134919 cseq=INVITE
contact=UAC@xxxxxxxxx:12005 / 1 from(tu)
INFO | 20060703-100202.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:1170 | Got: SipResp: 200 tid=604ea76a6b21cd6a
cseq=OPTIONS contact=127.0.0.1:12010 / 1 from(wire)
UAC: ClientOutOfDialogReq-onSuccess - SipResp: 200 tid=604ea76a6b21cd6a
cseq=OPTIONS contact=127.0.0.1:12010 / 1 from(wire)
INFO | 20060703-100205.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:1170 | Got: SipResp: 408 tid=8b49874ddd134919
cseq=INVITE / 1 from(wire)
UAC(INVITE): testAppDialog: created.
INFO | 20060703-100206.000 | sipce | RESIP:DUM | 3468433582 | Dialog.cxx:546 |
Dialog::dispatch, ignoring stray response: SipResp: 408 tid=8b49874ddd134919
cseq=INVITE / 1 from(wire)
INFO | 20060703-100208.000 | sipce | RESIP:DUM | 3468433582 |
ClientInviteSession.cxx:703 | Failure: error response: SipResp: 408
tid=8b49874ddd134919 cseq=INVITE / 1 from(wire)
INFO | 20060703-100210.000 | sipce | RESIP:DUM | 3468433582 |
InviteSession.cxx:2047 | Transition UAC_Start -> InviteSession::Terminated
UAC: ClientInviteSession-onFailure - SipResp: 408 tid=8b49874ddd134919
cseq=INVITE / 1 from(wire)
UAC: InviteSession-onTerminated - SipResp: 408 tid=8b49874ddd134919
cseq=INVITE / 1 from(wire)
UAC(OPTIONS): testAppDialogSet: destroyed.
UAC(INVITE): testAppDialog: destroyed.
UAC(INVITE): testAppDialogSet: destroyed.
INFO | 20060703-100214.000 | sipce | RESIP:DUM | 3468433582 |
InviteSession.cxx:778 | Retransmitting:
SIP/2.0 200 OK
Via: SIP/2.0/UDP
127.0.0.1:12005;branch=z9hG4bK-d87543-8b49874ddd134919-1--d87543-;rport=12005
Contact: <sip:UAS@xxxxxxxxx:12010>
To: <sip:UAS@xxxxxxxxx:12010>;tag=5120015b
From: <sip:UAC@xxxxxxxxx:1205>;tag=121cd071
Call-ID: 9e396f2271672908NDJiZDJhMjlkYjA3NTE3MmFjYjZiZDE0NTFmNGQ2ZmE.
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE
Content-Type: application/sdp
Content-Length: 266
v=0
o=1900 369696545 369696545 IN IP4 192.168.2.15
s=X-Lite
c=IN IP4 192.168.2.15
t=0 0
m=audio 8000 RTP/AVP 8 3 98 97 101
a=fmtp:101 0-15
a=rtpmap:8 pcma/8000
a=rtpmap:3 gsm/8000
a=rtpmap:98 iLBC
a=rtpmap:97 speex/8000
a=rtpmap:101 telephone-event/8000
INFO | 20060703-100222.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TuSelector.cxx:72 | Stats message
WARNING | 20060703-100223.000 | sipce | RESIP:STATS | 3468433582 |
StatisticsMessage.cxx:154 | RESIP:TRANSACTION
TU summary: 0 TRANSPORT 3 TRANSACTION 0 CLIENTTX 1 SERVERTX 0 TIMERS 2
Transaction summary: reqi 0 reqo 7 rspi 1 rspo 0
Details: INVi 0/S0/F0 INVo 1/S0/F0 ACKi 0 ACKo 0 BYEi 0/S0/F0 BYEo 0/S0/F0
CANi 0/S0/F0 CANo 0/S0/F0 MSGi 0/S0/F0 MSGo 0/S0/F0 OPTi 0/S0/F0 OPTo 1/S1/F0
REGi 0/S0/F0 REGo 0/S0/F0 PUBi 0/S0/F0 PUBo 0/S0/F0 SUBi 0/S0/F0 SUBo 0/S0/F0
NOTi 0/S0/F0 NOTo 0/S0/F0
Retransmissions: INVx 3 BYEx 0 CANx 0 MSGx 0 OPTx 2 REGx 0 finx 0 nonx 0 PUBx
0 SUBx 0 NOTx 0
INFO | 20060703-100229.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TransactionState.cxx:395 | discarding stray response: SipResp: 180
tid=8b49874ddd134919 cseq=INVITE contact=UAS@xxxxxxxxx:12010 / 1 from(wire)
INFO | 20060703-100231.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TuSelector.cxx:72 | Stats message
WARNING | 20060703-100232.000 | sipce | RESIP:STATS | 3468433582 |
StatisticsMessage.cxx:154 | RESIP:TRANSACTION
TU summary: 0 TRANSPORT 3 TRANSACTION 1 CLIENTTX 0 SERVERTX 1 TIMERS 1
Transaction summary: reqi 4 reqo 0 rspi 0 rspo 5
Details: INVi 2/S2/F0 INVo 0/S0/F0 ACKi 0 ACKo 0 BYEi 0/S0/F0 BYEo 0/S0/F0
CANi 0/S0/F0 CANo 0/S0/F0 MSGi 0/S0/F0 MSGo 0/S0/F0 OPTi 2/S2/F0 OPTo 0/S0/F0
REGi 0/S0/F0 REGo 0/S0/F0 PUBi 0/S0/F0 PUBo 0/S0/F0 SUBi 0/S0/F0 SUBo 0/S0/F0
NOTi 0/S0/F0 NOTo 0/S0/F0
Retransmissions: INVx 0 BYEx 0 CANx 0 MSGx 0 OPTx 0 REGx 0 finx 0 nonx 0 PUBx
0 SUBx 0 NOTx 0
INFO | 20060703-100238.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:1170 | Got: SipReq: OPTIONS UAS@xxxxxxxxx:12010
tid=604ea76a6b21cd6a cseq=OPTIONS contact=UAC@xxxxxxxxx:12005 / 1 from(wire)
UAS(OPTIONS): testAppDialogSet: created.
UAS(OPTIONS): testAppDialogSet: UAS UserProfile requested for msg: SipReq:
OPTIONS UAS@xxxxxxxxx:12010 tid=604ea76a6b21cd6a cseq=OPTIONS
contact=UAC@xxxxxxxxx:12005 / 1 from(wire)
UAS: ServerOutOfDialogReq-onReceivedRequest - SipReq: OPTIONS
UAS@xxxxxxxxx:12010 tid=604ea76a6b21cd6a cseq=OPTIONS
contact=UAC@xxxxxxxxx:12005 / 1 from(wire)
UAS: Sending 200 response to OPTIONS.
INFO | 20060703-100244.000 | sipce | RESIP:DUM | 3468433582 |
InviteSessionHandler.cxx:27 | InviteSessionHandler::onAckNotReceived
INFO | 20060703-100245.000 | sipce | RESIP:DUM | 3468433582 |
ServerInviteSession.cxx:321 | UAS_Accepted: end
INFO | 20060703-100246.000 | sipce | RESIP:DUM | 3468433582 |
InviteSession.cxx:2361 | <sip:UAS@xxxxxxxxx:12010>;tag=5120015b Sending BYE
ACK not received
INFO | 20060703-100248.000 | sipce | RESIP:DUM | 3468433582 |
InviteSession.cxx:2047 | Transition UAS_Accepted -> InviteSession::Terminated
UAS: InviteSession-onTerminated -
UAS(OPTIONS): testAppDialogSet: destroyed.
INFO | 20060703-100250.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:221 | shutdown giveup=0 dialogSets=1
INFO | 20060703-100251.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:221 | shutdown giveup=0 dialogSets=0
INFO | 20060703-100252.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:206 | DialogUsageManager::onAllHandlesDestroyed:
removing TU
INFO | 20060703-100254.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TransactionState.cxx:395 | discarding stray response: SipResp: 200
tid=8b49874ddd134919 cseq=INVITE contact=UAS@xxxxxxxxx:12010 / 1 from(wire)
INFO | 20060703-100256.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TuSelector.cxx:38 | TransactionUserMessage::RequestShutdown TU:
DialogUsageManager size=0
INFO | 20060703-100257.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TuSelector.cxx:38 | TransactionUserMessage::RequestShutdown TU:
DialogUsageManager size=1
INFO | 20060703-100259.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:1170 | Got: SipReq: INVITE UAS@xxxxxxxxx:12010
tid=8b49874ddd134919 cseq=INVITE contact=UAC@xxxxxxxxx:12005 / 1 from(wire)
INFO | 20060703-100301.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:1218 | Merged request: INVITE sip:UAS@xxxxxxxxx:12010
SIP/2.0
Via: SIP/2.0/UDP
127.0.0.1:12005;branch=z9hG4bK-d87543-8b49874ddd134919-1--d87543-;rport=12005
Max-Forwards: 70
Contact: <sip:UAC@xxxxxxxxx:12005>
To: <sip:UAS@xxxxxxxxx:12010>
From: <sip:UAC@xxxxxxxxx:1205>;tag=121cd071
Call-ID: 9e396f2271672908NDJiZDJhMjlkYjA3NTE3MmFjYjZiZDE0NTFmNGQ2ZmE.
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE
Content-Type: application/sdp
Content-Length: 266
v=0
o=1900 369696545 369696545 IN IP4 192.168.2.15
s=X-Lite
c=IN IP4 192.168.2.15
t=0 0
m=audio 8000 RTP/AVP 8 3 98 97 101
a=fmtp:101 0-15
a=rtpmap:8 pcma/8000
a=rtpmap:3 gsm/8000
a=rtpmap:98 iLBC
a=rtpmap:97 speex/8000
a=rtpmap:101 telephone-event/8000
INFO | 20060703-100309.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TransactionState.cxx:395 | discarding stray response: SipResp: 200
tid=604ea76a6b21cd6a cseq=OPTIONS contact=127.0.0.1:12010 / 1 from(wire)
INFO | 20060703-100311.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TuSelector.cxx:42 | TransactionUserMessage::RemoveTransactionUser TU:
DialogUsageManager size=0
INFO | 20060703-100313.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:1050 | TU unregistered
UAC: onDumCanBeDeleted.
INFO | 20060703-100319.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TuSelector.cxx:72 | Stats message
WARNING | 20060703-100320.000 | sipce | RESIP:STATS | 3468433582 |
StatisticsMessage.cxx:154 | RESIP:TRANSACTION
TU summary: 0 TRANSPORT 0 TRANSACTION 0 CLIENTTX 1 SERVERTX 2 TIMERS 5
Transaction summary: reqi 7 reqo 4 rspi 0 rspo 12
Details: INVi 4/S3/F5 INVo 0/S0/F0 ACKi 0 ACKo 0 BYEi 0/S0/F0 BYEo 1/S0/F0
CANi 0/S0/F0 CANo 0/S0/F0 MSGi 0/S0/F0 MSGo 0/S0/F0 OPTi 3/S3/F0 OPTo 0/S0/F0
REGi 0/S0/F0 REGo 0/S0/F0 PUBi 0/S0/F0 PUBo 0/S0/F0 SUBi 0/S0/F0 SUBo 0/S0/F0
NOTi 0/S0/F0 NOTo 0/S0/F0
Retransmissions: INVx 0 BYEx 3 CANx 0 MSGx 0 OPTx 0 REGx 0 finx 0 nonx 0 PUBx
0 SUBx 0 NOTx 0
INFO | 20060703-100329.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:1170 | Got: SipResp: 408 tid=6e4b992ee46d2e58
cseq=BYE / 2 from(wire)
INFO | 20060703-100330.000 | sipce | RESIP:DUM | 3468433582 |
InviteSession.cxx:1467 | InviteSession::dispatchTerminated SipResp: 408
tid=6e4b992ee46d2e58 cseq=BYE / 2 from(wire)
UAS(INVITE): testAppDialog: destroyed.
UAS(INVITE): testAppDialogSet: destroyed.
INFO | 20060703-100333.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:206 | DialogUsageManager::onAllHandlesDestroyed:
removing TU
INFO | 20060703-100334.000 | sipce | RESIP:TRANSACTION | 3468433582 |
TuSelector.cxx:42 | TransactionUserMessage::RemoveTransactionUser TU:
DialogUsageManager size=0
INFO | 20060703-100336.000 | sipce | RESIP:DUM | 3468433582 |
DialogUsageManager.cxx:1050 | TU unregistered
UAS: onDumCanBeDeleted.
!!!!!!!!!!!!!!!!!! Successful !!!!!!!!!!
Unload module: msvcr80.dll
Unload module: nspm.dll
Unload module: dtpt_nsp.dll
Unload module: wspm.dll
Unload module: dtpt_lsp.dll
Unload module: AutoBind_lsp.dll
Unload module: SSLLSP.DLL
Unload module: iphlpapi.dll
Unload module: WS2.dll
The program '[cfbcd402] sipce.exe' has exited with code 5398 (0x1516).
_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxxxxxx
https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel