diff --git a/linphone/build/wince/liblinphone.ncb b/linphone/build/wince/liblinphone.ncb deleted file mode 100644 index a247b37d6..000000000 Binary files a/linphone/build/wince/liblinphone.ncb and /dev/null differ diff --git a/linphone/build/wince/liblinphone.sln b/linphone/build/wince/liblinphone.sln index 217604981..fe4efff27 100644 --- a/linphone/build/wince/liblinphone.sln +++ b/linphone/build/wince/liblinphone.sln @@ -4,9 +4,6 @@ Microsoft Visual Studio Solution File, Format Version 10.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblinphone", "liblinphone.vcproj", "{290078F0-3B63-47BF-A2A9-E1AF5411F5E7}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "linphonec", "linphonec\linphonec.vcproj", "{92574924-BF59-4DAA-994B-9978B80E5797}" - ProjectSection(ProjectDependencies) = postProject - {290078F0-3B63-47BF-A2A9-E1AF5411F5E7} = {290078F0-3B63-47BF-A2A9-E1AF5411F5E7} - EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/linphone/build/wince/liblinphone.suo b/linphone/build/wince/liblinphone.suo deleted file mode 100644 index f959a99f3..000000000 Binary files a/linphone/build/wince/liblinphone.suo and /dev/null differ diff --git a/linphone/build/wince/liblinphone.vcproj b/linphone/build/wince/liblinphone.vcproj index 379d7dbb0..9909c8a1f 100644 --- a/linphone/build/wince/liblinphone.vcproj +++ b/linphone/build/wince/liblinphone.vcproj @@ -178,6 +178,7 @@ OutputDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)" IntermediateDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)" ConfigurationType="4" + CharacterSet="1" > diff --git a/linphone/console/linphonec.c b/linphone/console/linphonec.c index e4db93767..81fccea14 100644 --- a/linphone/console/linphonec.c +++ b/linphone/console/linphonec.c @@ -61,10 +61,6 @@ #if !defined(strdup) #define strdup _strdup #endif /*strdup*/ -/* -#if !defined(access) -#define access _access -#endif*/ /*access*/ #endif /*_WIN32_WCE*/ @@ -77,6 +73,10 @@ #define _(something) (something) #endif +#ifndef PACKAGE_DIR +#define PACKAGE_DIR "" +#endif + /*************************************************************************** * * Types @@ -568,9 +568,22 @@ bool_t linphonec_get_autoanswer(){ * - char *histfile_name * - FILE *mylogfile */ -#if defined (_MSC_VER) -int _tmain(int argc, _TCHAR* argv[]) { - trace_level=1; +#if defined (_WIN32_WCE) + +char **convert_args_to_ascii(int argc, _TCHAR **wargv){ + int i; + char **result=malloc(argc*sizeof(char*)); + char argtmp[128]; + for(i=0;isa_family==AF_INET){ + struct sockaddr_in *p_sin=(struct sockaddr_in*)p_addr; + if (p_sin->sin_addr.s_addr==0){ + close_socket(sock); + return -1; + } + } err=getnameinfo((struct sockaddr *)&addr,s,result,LINPHONE_IPADDR_SIZE,NULL,0,NI_NUMERICHOST); if (err!=0){ ms_error("getnameinfo error: %s",strerror(errno)); diff --git a/linphone/mediastreamer2/build/wince/mediastreamer2.vcproj b/linphone/mediastreamer2/build/wince/mediastreamer2.vcproj index 84f96ae3d..ac78735cf 100644 --- a/linphone/mediastreamer2/build/wince/mediastreamer2.vcproj +++ b/linphone/mediastreamer2/build/wince/mediastreamer2.vcproj @@ -1,1568 +1,1568 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/linphone/mediastreamer2/build/winmob/echo/echo.vcproj b/linphone/mediastreamer2/build/winmob/echo/echo.vcproj new file mode 100644 index 000000000..5a8b40e64 --- /dev/null +++ b/linphone/mediastreamer2/build/winmob/echo/echo.vcproj @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/linphone/mediastreamer2/build/winmob/mediastreamer2.sln b/linphone/mediastreamer2/build/winmob/mediastreamer2.sln index b328b8f7f..8a3de9d24 100644 --- a/linphone/mediastreamer2/build/winmob/mediastreamer2.sln +++ b/linphone/mediastreamer2/build/winmob/mediastreamer2.sln @@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mediastreamer2", "mediastreamer2.vcproj", "{177F5AE2-A40C-4412-8F26-7F85FA32464E}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echo", "echo\echo.vcproj", "{B616AC95-748E-4CD5-89AC-772DC3C069D9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) @@ -39,6 +41,18 @@ Global {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I) {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) + {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/linphone/mediastreamer2/build/winmob/mediastreamer2.vcproj b/linphone/mediastreamer2/build/winmob/mediastreamer2.vcproj index c36cce4dd..8758723c2 100644 --- a/linphone/mediastreamer2/build/winmob/mediastreamer2.vcproj +++ b/linphone/mediastreamer2/build/winmob/mediastreamer2.vcproj @@ -1,913 +1,933 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/linphone/mediastreamer2/include/mediastreamer2/msrtp.h b/linphone/mediastreamer2/include/mediastreamer2/msrtp.h index 0bd961b82..13ac30a65 100644 --- a/linphone/mediastreamer2/include/mediastreamer2/msrtp.h +++ b/linphone/mediastreamer2/include/mediastreamer2/msrtp.h @@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MS_RTP_SEND_SET_RELAY_SESSION_ID MS_FILTER_METHOD(MS_RTP_SEND_ID,5,const char *) +#define MS_RTP_SEND_SET_DTMF_DURATION MS_FILTER_METHOD(MS_RTP_SEND_ID,1,int) extern MSFilterDesc ms_rtp_send_desc; extern MSFilterDesc ms_rtp_recv_desc; diff --git a/linphone/mediastreamer2/src/audiostream.c b/linphone/mediastreamer2/src/audiostream.c index dcaf42467..dccc009c1 100644 --- a/linphone/mediastreamer2/src/audiostream.c +++ b/linphone/mediastreamer2/src/audiostream.c @@ -560,6 +560,10 @@ void ring_stop(RingStream *stream){ ms_filter_destroy(stream->source); ms_filter_destroy(stream->sndwrite); ms_free(stream); +#ifdef _WIN32_WCE + ms_warning("Sleeping a bit after closing the audio device..."); + ms_sleep(1); +#endif } diff --git a/linphone/mediastreamer2/src/msfileplayer_win.c b/linphone/mediastreamer2/src/msfileplayer_win.c index e2aa2e2e1..0007b7a2a 100644 --- a/linphone/mediastreamer2/src/msfileplayer_win.c +++ b/linphone/mediastreamer2/src/msfileplayer_win.c @@ -17,11 +17,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define UNICODE + #include "mediastreamer2/msfileplayer.h" #include "mediastreamer2/waveheader.h" #include "mediastreamer2/msticker.h" - typedef enum { CLOSED, STARTED, @@ -128,13 +129,10 @@ static int player_open(MSFilter *f, void *arg){ PlayerData *d=(PlayerData*)f->data; HANDLE fd; const char *file=(const char*)arg; -#if defined(_WIN32_WCE) - fd = CreateFile((LPCWSTR)file, GENERIC_READ, FILE_SHARE_READ, NULL, + WCHAR wUnicode[1024]; + MultiByteToWideChar(CP_UTF8, 0, file, -1, wUnicode, 1024); + fd = CreateFile(wUnicode, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); -#else - fd = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, 0, NULL); -#endif if (fd==INVALID_HANDLE_VALUE){ ms_warning("Failed to open %s",file); return -1; diff --git a/linphone/mediastreamer2/src/msfilerec_win.c b/linphone/mediastreamer2/src/msfilerec_win.c index 85df07b86..b485d451b 100644 --- a/linphone/mediastreamer2/src/msfilerec_win.c +++ b/linphone/mediastreamer2/src/msfilerec_win.c @@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define UNICODE + #include "mediastreamer2/msfilerec.h" #include "mediastreamer2/waveheader.h" @@ -84,6 +86,9 @@ static void write_wav_header(int rate,int size, char *filename){ wave_header_t header; DWORD bytes_written=0; HANDLE fd; + WCHAR wUnicode[1024]; + MultiByteToWideChar(CP_UTF8, 0, filename, -1, wUnicode, 1024); + memcpy(&header.riff_chunk.riff,"RIFF",4); header.riff_chunk.len=le_uint32(size+32); memcpy(&header.riff_chunk.wave,"WAVE",4); @@ -101,11 +106,7 @@ static void write_wav_header(int rate,int size, char *filename){ header.data_chunk.len=le_uint32(size); /* TODO: replace with "lseek" equivalent for windows */ -#if defined(_WIN32_WCE) - fd=CreateFile((LPCWSTR)filename, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); -#else - fd=CreateFile(filename, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); -#endif + fd=CreateFile(wUnicode, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (fd==INVALID_HANDLE_VALUE){ #if !defined(_WIN32_WCE) ms_warning("Cannot open %s: %s",filename,strerror(errno)); @@ -127,13 +128,12 @@ static int rec_open(MSFilter *f, void *arg){ RecState *s=(RecState*)f->data; const char *filename=(const char*)arg; + WCHAR wUnicode[1024]; + MultiByteToWideChar(CP_UTF8, 0, filename, -1, wUnicode, 1024); + ms_mutex_lock(&f->lock); snprintf(s->filename, sizeof(s->filename), "%s", filename); -#if defined(_WIN32_WCE) - s->fd=CreateFile((LPCWSTR)filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); -#else - s->fd=CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); -#endif + s->fd=CreateFile(wUnicode, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); if (s->fd==INVALID_HANDLE_VALUE){ #if !defined(_WIN32_WCE) ms_warning("Cannot open %s: %s",filename,strerror(errno)); diff --git a/linphone/mediastreamer2/src/msrtp.c b/linphone/mediastreamer2/src/msrtp.c index 36431c929..79a4a3fad 100644 --- a/linphone/mediastreamer2/src/msrtp.c +++ b/linphone/mediastreamer2/src/msrtp.c @@ -33,6 +33,8 @@ struct SenderData { uint32_t skip_until; int rate; char dtmf; + bool_t dtmf_start; + int dtmf_duration; char relay_session_id[64]; int relay_session_id_size; uint64_t last_rsi_time; @@ -52,6 +54,8 @@ static void sender_init(MSFilter * f) d->skip = FALSE; d->rate = 8000; d->dtmf = 0; + d->dtmf_start = FALSE; + d->dtmf_duration = 800; d->mute_mic=FALSE; d->relay_session_id_size=0; d->last_rsi_time=0; @@ -71,11 +75,23 @@ static int sender_send_dtmf(MSFilter * f, void *arg) SenderData *d = (SenderData *) f->data; ms_filter_lock(f); + if (d->skip==TRUE) + { + ms_filter_unlock(f); + return -1; + } d->dtmf = dtmf[0]; ms_filter_unlock(f); return 0; } +static int sender_set_dtmf_duration(MSFilter * f, void *arg) +{ + SenderData *d = (SenderData *) f->data; + d->dtmf_duration = *((int*)arg); + return 0; +} + static int sender_set_session(MSFilter * f, void *arg) { SenderData *d = (SenderData *) f->data; @@ -159,6 +175,109 @@ static uint32_t get_cur_timestamp(MSFilter * f, uint32_t packet_ts) return netts; } +static int send_dtmf(MSFilter * f, uint32_t timestamp_start, uint32_t current_timestamp) +{ + SenderData *d = (SenderData *) f->data; + mblk_t *m1; + int tev_type; + + /* create the first telephony event packet */ + switch (d->dtmf){ + case '1': + tev_type=TEV_DTMF_1; + break; + case '2': + tev_type=TEV_DTMF_2; + break; + case '3': + tev_type=TEV_DTMF_3; + break; + case '4': + tev_type=TEV_DTMF_4; + break; + case '5': + tev_type=TEV_DTMF_5; + break; + case '6': + tev_type=TEV_DTMF_6; + break; + case '7': + tev_type=TEV_DTMF_7; + break; + case '8': + tev_type=TEV_DTMF_8; + break; + case '9': + tev_type=TEV_DTMF_9; + break; + case '*': + tev_type=TEV_DTMF_STAR; + break; + case '0': + tev_type=TEV_DTMF_0; + break; + case '#': + tev_type=TEV_DTMF_POUND; + break; + + case 'A': + case 'a': + tev_type=TEV_DTMF_A; + break; + + + case 'B': + case 'b': + tev_type=TEV_DTMF_B; + break; + + case 'C': + case 'c': + tev_type=TEV_DTMF_C; + break; + + case 'D': + case 'd': + tev_type=TEV_DTMF_D; + break; + + case '!': + tev_type=TEV_FLASH; + break; + + + default: + ms_warning("Bad dtmf: %c.",d->dtmf); + return -1; + } + + + if (d->dtmf_start == TRUE) + m1=rtp_session_create_telephone_event_packet(d->session,1); + else + m1=rtp_session_create_telephone_event_packet(d->session,0); + if (m1==NULL) return -1; + + + if (RTP_TIMESTAMP_IS_NEWER_THAN(current_timestamp, d->skip_until)) { + //retransmit end of rtp dtmf event + mblk_t *tmp; + rtp_session_add_telephone_event(d->session,m1,tev_type,1,10, (current_timestamp-timestamp_start)); + tmp=copymsg(m1); + rtp_session_sendm_with_ts(d->session,tmp,timestamp_start); + d->session->rtp.snd_seq--; + tmp=copymsg(m1); + rtp_session_sendm_with_ts(d->session,tmp,timestamp_start); + d->session->rtp.snd_seq--; + rtp_session_sendm_with_ts(d->session,m1,timestamp_start); + } + else { + rtp_session_add_telephone_event(d->session,m1,tev_type,0,10, (current_timestamp-timestamp_start)); + rtp_session_sendm_with_ts(d->session,m1,timestamp_start); + } + return 0; +} + static void sender_process(MSFilter * f) { SenderData *d = (SenderData *) f->data; @@ -184,32 +303,37 @@ static void sender_process(MSFilter * f) timestamp = get_cur_timestamp(f, mblk_get_timestamp_info(im)); ms_filter_lock(f); - if (d->dtmf != 0) { - rtp_session_send_dtmf(s, d->dtmf, timestamp); - ms_debug("RFC2833 dtmf sent."); - d->dtmf = 0; - d->skip_until = timestamp + (3 * 160); - d->skip = TRUE; - freemsg(im); - }else if (d->skip) { + if (d->skip) { ms_debug("skipping.."); - if (RTP_TIMESTAMP_IS_NEWER_THAN(timestamp, d->skip_until)) { - d->skip = FALSE; - } - freemsg(im); - }else{ - if (d->mute_mic==FALSE){ - int pt = mblk_get_payload_type(im); - header = rtp_session_create_packet(s, 12, NULL, 0); - if (pt>0) - rtp_set_payload_type(header, pt); - rtp_set_markbit(header, mblk_get_marker_info(im)); - header->b_cont = im; - rtp_session_sendm_with_ts(s, header, timestamp); - } - else{ + send_dtmf(f, d->skip_until-d->dtmf_duration, timestamp); + d->dtmf_start = FALSE; + if (!RTP_TIMESTAMP_IS_NEWER_THAN(timestamp, d->skip_until)) { freemsg(im); + ms_filter_unlock(f); + continue; } + d->skip = FALSE; + d->dtmf = 0; + } + + if (d->skip == FALSE && d->mute_mic==FALSE){ + int pt = mblk_get_payload_type(im); + header = rtp_session_create_packet(s, 12, NULL, 0); + if (pt>0) + rtp_set_payload_type(header, pt); + rtp_set_markbit(header, mblk_get_marker_info(im)); + header->b_cont = im; + rtp_session_sendm_with_ts(s, header, timestamp); + } + else{ + freemsg(im); + } + + if (d->dtmf != 0) { + ms_debug("prepare to send RFC2833 dtmf."); + d->skip_until = timestamp + d->dtmf_duration; + d->skip = TRUE; + d->dtmf_start = TRUE; } ms_filter_unlock(f); } @@ -222,6 +346,7 @@ static MSFilterMethod sender_methods[] = { {MS_RTP_SEND_SEND_DTMF, sender_send_dtmf}, {MS_RTP_SEND_SET_RELAY_SESSION_ID, sender_set_relay_session_id}, {MS_FILTER_GET_SAMPLE_RATE, sender_get_sr }, + {MS_RTP_SEND_SET_DTMF_DURATION, sender_set_dtmf_duration }, {0, NULL} }; diff --git a/linphone/mediastreamer2/src/msticker.c b/linphone/mediastreamer2/src/msticker.c index 6a21b7e7e..6e52656d0 100644 --- a/linphone/mediastreamer2/src/msticker.c +++ b/linphone/mediastreamer2/src/msticker.c @@ -266,7 +266,6 @@ static void sleepMs(int ms){ static int set_high_prio(void){ int precision=2; int result=0; - struct sched_param param; #ifdef WIN32 MMRESULT mm; TIMECAPS ptc; @@ -289,6 +288,7 @@ static int set_high_prio(void){ ms_warning("SetThreadPriority() failed (%d)\n", GetLastError()); } #else + struct sched_param param; memset(¶m,0,sizeof(param)); #ifdef TARGET_OS_MAC int policy=SCHED_RR; diff --git a/linphone/mediastreamer2/src/winsndds.cpp b/linphone/mediastreamer2/src/winsndds.cpp index 8d6b22ad8..fe539fe8e 100644 --- a/linphone/mediastreamer2/src/winsndds.cpp +++ b/linphone/mediastreamer2/src/winsndds.cpp @@ -19,12 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifdef __DIRECTSOUND_ENABLED__ +#define UNICODE + #include "mediastreamer2/mssndcard.h" #include "mediastreamer2/msfilter.h" #include "mediastreamer2/msticker.h" -#define UNICODE - #include #ifdef _MSC_VER #include @@ -1045,7 +1045,7 @@ static void _winsnddscard_detect(MSSndCardManager *m){ if (ms_lib_instance==NULL) { - ms_lib_instance = LoadLibrary("dsound.dll"); + ms_lib_instance = LoadLibrary(L"dsound.dll"); if( ms_lib_instance == NULL ) { /* error */ diff --git a/linphone/mediastreamer2/tests/echo.c b/linphone/mediastreamer2/tests/echo.c index dc481545d..ca2ddbfc2 100644 --- a/linphone/mediastreamer2/tests/echo.c +++ b/linphone/mediastreamer2/tests/echo.c @@ -22,7 +22,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "mediastreamer2/mssndcard.h" #include "mediastreamer2/msticker.h" +#ifndef _WIN32_WCE #include +#elif defined(_MSC_VER) +#define main _tmain +#endif static int run=1; @@ -37,11 +41,14 @@ int main(int argc, char *argv[]){ MSTicker *ticker; char *card_id=NULL; int rate = 16000; + ortp_init(); ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); ms_init(); - + +#ifndef _WIN32_WCE signal(SIGINT,stop); +#endif if (argc>1) card_id=argv[1]; @@ -77,8 +84,12 @@ int main(int argc, char *argv[]){ ticker=ms_ticker_new(); ms_filter_link(f1,0,f2,0); ms_ticker_attach(ticker,f1); +#ifndef _WIN32_WCE while(run) ms_sleep(1); +#else + ms_sleep(5); +#endif ms_ticker_detach(ticker,f1); ms_ticker_destroy(ticker); ms_filter_unlink(f1,0,f2,0); diff --git a/linphone/oRTP/build/win32native/ortp.def b/linphone/oRTP/build/win32native/ortp.def index 98486cad6..4b418e029 100755 --- a/linphone/oRTP/build/win32native/ortp.def +++ b/linphone/oRTP/build/win32native/ortp.def @@ -70,6 +70,8 @@ EXPORTS rtp_add_csrc rtp_session_send_dtmf + rtp_session_add_telephone_event + rtp_session_create_telephone_event_packet rtp_session_set_source_description rtp_session_set_symmetric_rtp diff --git a/linphone/oRTP/build/wince/oRTP.vcproj b/linphone/oRTP/build/wince/oRTP.vcproj index a3bf099cf..c64f9a2ce 100644 --- a/linphone/oRTP/build/wince/oRTP.vcproj +++ b/linphone/oRTP/build/wince/oRTP.vcproj @@ -1,877 +1,877 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/linphone/oRTP/build/wince/ortp.def b/linphone/oRTP/build/wince/ortp.def index 4f43d85be..e7e4c7ea6 100644 --- a/linphone/oRTP/build/wince/ortp.def +++ b/linphone/oRTP/build/wince/ortp.def @@ -70,6 +70,8 @@ EXPORTS rtp_add_csrc rtp_session_send_dtmf + rtp_session_add_telephone_event + rtp_session_create_telephone_event_packet rtp_session_set_source_description rtp_session_set_symmetric_rtp diff --git a/linphone/oRTP/build/winmob/oRTP.vcproj b/linphone/oRTP/build/winmob/oRTP.vcproj index 3aa3937c3..fdfc895e1 100644 --- a/linphone/oRTP/build/winmob/oRTP.vcproj +++ b/linphone/oRTP/build/winmob/oRTP.vcproj @@ -1,915 +1,916 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/linphone/oRTP/src/ortp.c b/linphone/oRTP/src/ortp.c index 992032f86..4edd91a4d 100644 --- a/linphone/oRTP/src/ortp.c +++ b/linphone/oRTP/src/ortp.c @@ -256,7 +256,7 @@ static void __ortp_logv_out(OrtpLogLevel lev, const char *fmt, va_list args){ ortp_fatal("Bad level !"); } msg=ortp_strdup_vprintf(fmt,args); -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(_WIN32_WCE) OutputDebugString(msg); OutputDebugString("\r\n"); #else diff --git a/linphone/oRTP/src/port.c b/linphone/oRTP/src/port.c index de14a3812..15a324091 100644 --- a/linphone/oRTP/src/port.c +++ b/linphone/oRTP/src/port.c @@ -124,7 +124,7 @@ int close_socket(ortp_socket_t sock){ #endif } -#if defined (_WIN32_WCE) +#if defined (_WIN32_WCE) || defined(_MSC_VER) int ortp_file_exist(const char *pathname) { FILE* fd; if (pathname==NULL) return -1;