My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// =====================================================================================
//
// Filename: sipexe.cpp
//
// Description:
//
// Version: 1.0
// Created: 12/10/2010 07:38:57 PM
// Revision: none
// Compiler: g++
//
// Author: Raymond Wen (),
// Company:
//
// =====================================================================================

#include <unistd.h>
#include <android/log.h>
#include <netinet/in.h>
#include <eXosip2/eXosip.h>
#include <iostream>
#include <complex>

const char* const LOG_TAG = "SIP_EXE";

static void android_trace_func(char *fi, int li, osip_trace_level_t level, char *chfr, va_list ap)
{
__android_log_vprint(ANDROID_LOG_VERBOSE, LOG_TAG, chfr, ap);
}

int main ( int argc, char *argv[] )
{
int i, port = 5060;
osip_trace_initialize_func(END_TRACE_LEVEL, &android_trace_func);
i=eXosip_init();
if (i!=0)
return -1;
i = eXosip_listen_addr (IPPROTO_UDP, NULL, port, AF_INET, 0);
if (i!=0)
{
eXosip_quit();
__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, "%s", "could not initialize transport layer\n");
return -1;
}

eXosip_event_t *je;
for (;;)
{
je = eXosip_event_wait (0, 24*60*60*1000);
eXosip_lock();
eXosip_automatic_action ();
eXosip_unlock();
if (je == NULL)
break;
if (je->type == EXOSIP_CALL_INVITE)
{
__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, "%s", "incoming call\n");
std::cout << "incoming call" << std::endl;
}
}

return 0;
} // ---------- end of function main ----------

Change log

r147 by rx.wen218 on Dec 18, 2010   Diff
change sipexe to use c++ code, and
demonstrate how to use stlport
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 1704 bytes, 63 lines
Powered by Google Project Hosting