Changeset 182:f526c16d302a in mediastreamer2
- Timestamp:
- Nov 30, 2008 10:08:26 AM (5 years ago)
- Branch:
- default
- Location:
- linphone
- Files:
-
- 1 added
- 4 edited
-
configure.in (modified) (1 diff)
-
coreapi/misc.c (modified) (9 diffs)
-
gtk-glade/main.c (modified) (1 diff)
-
m4/exosip.m4 (modified) (1 diff)
-
po/ru.po (added)
Legend:
- Unmodified
- Added
- Removed
-
linphone/configure.in
r72 r182 39 39 dnl Add the languages which your application supports here. 40 40 PKG_PROG_PKG_CONFIG 41 ALL_LINGUAS="fr it de ja es pl cs nl sv pt_BR hu "41 ALL_LINGUAS="fr it de ja es pl cs nl sv pt_BR hu ru" 42 42 GETTEXT_PACKAGE=linphone 43 43 AM_GNU_GETTEXT([external]) -
linphone/coreapi/misc.c
r157 r182 502 502 } 503 503 504 static int sendStunRequest(int sock, const struct sockaddr *server, socklen_t addrlen, int id ){504 static int sendStunRequest(int sock, const struct sockaddr *server, socklen_t addrlen, int id, bool_t changeAddr){ 505 505 char buf[STUN_MAX_MESSAGE_SIZE]; 506 506 int len = STUN_MAX_MESSAGE_SIZE; … … 512 512 memset(&username,0,sizeof(username)); 513 513 memset(&password,0,sizeof(password)); 514 stunBuildReqSimple( &req, &username, FALSE , FALSE, id);514 stunBuildReqSimple( &req, &username, changeAddr , changeAddr , id); 515 515 len = stunEncodeMessage( &req, buf, len, &password, FALSE); 516 516 if (len<=0){ … … 555 555 } 556 556 557 static int recvStunResponse(ortp_socket_t sock, char *ipaddr, int *port ){557 static int recvStunResponse(ortp_socket_t sock, char *ipaddr, int *port, int *id){ 558 558 char buf[STUN_MAX_MESSAGE_SIZE]; 559 559 int len = STUN_MAX_MESSAGE_SIZE; … … 563 563 struct in_addr ia; 564 564 stunParseMessage(buf,len, &resp,FALSE ); 565 *id=resp.msgHdr.id.octet[0]; 565 566 *port = resp.mappedAddress.ipv4.port; 566 567 ia.s_addr=htonl(resp.mappedAddress.ipv4.addr); … … 583 584 bool_t video_enabled=linphone_core_video_enabled(lc); 584 585 bool_t got_audio,got_video; 586 bool_t cone_audio=FALSE,cone_video=FALSE; 585 587 struct timeval init,cur; 586 588 if (parse_stun_server_addr(server,&ss,&ss_len)<0){ … … 598 600 if (sock2<0) return ; 599 601 } 600 sendStunRequest(sock1,(struct sockaddr*)&ss,ss_len,1); 601 if (sock2>=0) 602 sendStunRequest(sock2,(struct sockaddr*)&ss,ss_len,2); 603 602 sendStunRequest(sock1,(struct sockaddr*)&ss,ss_len,11,TRUE); 603 sendStunRequest(sock1,(struct sockaddr*)&ss,ss_len,1,FALSE); 604 if (sock2>=0){ 605 sendStunRequest(sock2,(struct sockaddr*)&ss,ss_len,22,TRUE); 606 sendStunRequest(sock2,(struct sockaddr*)&ss,ss_len,2,FALSE); 607 } 604 608 got_audio=FALSE; 605 609 got_video=FALSE; … … 607 611 do{ 608 612 double elapsed; 613 int id; 609 614 #ifdef WIN32 610 615 Sleep(10); … … 614 619 615 620 if (recvStunResponse(sock1,call->audio_params.natd_addr, 616 &call->audio_params.natd_port )>0){621 &call->audio_params.natd_port,&id)>0){ 617 622 ms_message("STUN test result: local audio port maps to %s:%i", 618 623 call->audio_params.natd_addr, 619 624 call->audio_params.natd_port); 625 if (id==11) 626 cone_audio=TRUE; 620 627 got_audio=TRUE; 621 628 } 622 629 if (recvStunResponse(sock2,call->video_params.natd_addr, 623 &call->video_params.natd_port )>0){630 &call->video_params.natd_port,&id)>0){ 624 631 ms_message("STUN test result: local video port maps to %s:%i", 625 632 call->video_params.natd_addr, 626 633 call->video_params.natd_port); 634 if (id==22) 635 cone_video=TRUE; 627 636 got_video=TRUE; 628 637 } … … 633 642 if (!got_audio){ 634 643 ms_error("No stun server response for audio port."); 635 } 636 if (!got_video && sock2>=0){ 637 ms_error("No stun server response for video port."); 644 }else{ 645 if (!cone_audio) { 646 ms_warning("NAT is symmetric for audio port"); 647 call->audio_params.natd_port=0; 648 } 649 } 650 if (sock2>=0){ 651 if (!got_video){ 652 ms_error("No stun server response for video port."); 653 }else{ 654 if (!cone_video) { 655 ms_warning("NAT is symmetric for video port."); 656 call->video_params.natd_port=0; 657 } 658 } 638 659 } 639 660 close_socket(sock1); -
linphone/gtk-glade/main.c
r174 r182 667 667 void linphone_gtk_close(){ 668 668 /* couldn't find a way to prevent closing to destroy the main window*/ 669 linphone_core_enable_video_preview(linphone_gtk_get_core(),FALSE); 669 LinphoneCore *lc=linphone_gtk_get_core(); 670 /*shutdown call if any*/ 671 if (linphone_core_in_call(lc)) 672 linphone_core_terminate_call(lc,NULL); 673 linphone_core_enable_video_preview(lc,FALSE); 670 674 the_ui=NULL; 671 675 the_ui=linphone_gtk_create_window("main"); -
linphone/m4/exosip.m4
r0 r182 9 9 10 10 CPPFLAGS_save=$CPPFLAGS 11 CPPFLAGS= $OSIP_CFLAGS11 CPPFLAGS="$OSIP_CFLAGS $CPPFLAGS" 12 12 AC_CHECK_HEADER([eXosip2/eXosip.h], ,AC_MSG_ERROR([Could not find eXosip2 headers !])) 13 13 CPPFLAGS=$CPPFLAGS_save
Note: See TracChangeset
for help on using the changeset viewer.
