diff -rauN -x .svn linphone-r745/coreapi/linphonecore.c linphone-r745_rfc/coreapi/linphonecore.c --- linphone-r745/coreapi/linphonecore.c 2009-11-03 14:06:43.000000000 +0100 +++ linphone-r745_rfc/coreapi/linphonecore.c 2009-11-03 14:51:35.000000000 +0100 @@ -438,6 +438,9 @@ port=lp_config_get_int(lc->config,"sip","use_info",0); linphone_core_set_use_info_for_dtmf(lc,port); + port=lp_config_get_int(lc->config,"sip","use_rfc2833",0); + linphone_core_set_use_rfc2833_for_dtmf(lc,port); + ipv6=lp_config_get_int(lc->config,"sip","use_ipv6",-1); if (ipv6==-1){ ipv6=0; @@ -929,6 +932,16 @@ lc->sip_conf.use_info=use_info; } +bool_t linphone_core_get_use_rfc2833_for_dtmf(LinphoneCore *lc) +{ + return lc->sip_conf.use_rfc2833; +} + +void linphone_core_set_use_rfc2833_for_dtmf(LinphoneCore *lc,bool_t use_rfc2833) +{ + lc->sip_conf.use_rfc2833=use_rfc2833; +} + int linphone_core_get_sip_port(LinphoneCore *lc) { return lc->sip_conf.sip_port; @@ -2188,12 +2201,20 @@ void linphone_core_send_dtmf(LinphoneCore *lc,char dtmf) { - if (linphone_core_get_use_info_for_dtmf(lc)==0){ + /*By default we send DTMF RFC2833 if we do not have enabled SIP_INFO but we can also send RFC2833 and SIP_INFO*/ + if (linphone_core_get_use_rfc2833_for_dtmf(lc)!=0 || linphone_core_get_use_info_for_dtmf(lc)==0) + { /* In Band DTMF */ if (lc->audiostream!=NULL){ audio_stream_send_dtmf(lc->audiostream,dtmf); } - }else{ + else + { + ms_error("we cannot send RFC2833 dtmf when we are not in communication"); + } + } + if (linphone_core_get_use_info_for_dtmf(lc)!=0) + { char dtmf_body[1000]; char clen[10]; osip_message_t *msg=NULL; @@ -2617,6 +2638,7 @@ lp_config_set_string(lc->config,"sip","contact",config->contact); lp_config_set_int(lc->config,"sip","inc_timeout",config->inc_timeout); lp_config_set_int(lc->config,"sip","use_info",config->use_info); + lp_config_set_int(lc->config,"sip","use_rfc2833",config->use_rfc2833); lp_config_set_int(lc->config,"sip","use_ipv6",config->ipv6_enabled); lp_config_set_int(lc->config,"sip","register_only_when_network_is_up",config->register_only_when_network_is_up); for(elem=config->proxies,i=0;elem!=NULL;elem=ms_list_next(elem),i++){ diff -rauN -x .svn linphone-r745/coreapi/linphonecore.h linphone-r745_rfc/coreapi/linphonecore.h --- linphone-r745/coreapi/linphonecore.h 2009-11-03 14:06:43.000000000 +0100 +++ linphone-r745_rfc/coreapi/linphonecore.h 2009-11-03 14:47:49.000000000 +0100 @@ -61,6 +61,7 @@ MSList *deleted_proxies; int inc_timeout; /*timeout after an un-answered incoming call is rejected*/ bool_t use_info; + bool_t use_rfc2833; /*force RFC2833 to be sent*/ bool_t guess_hostname; bool_t loopback_only; bool_t ipv6_enabled; @@ -631,6 +632,10 @@ bool_t linphone_core_get_use_info_for_dtmf(LinphoneCore *lc); +void linphone_core_set_use_rfc2833_for_dtmf(LinphoneCore *lc,bool_t use_rfc2833); + +bool_t linphone_core_get_use_rfc2833_for_dtmf(LinphoneCore *lc); + int linphone_core_get_sip_port(LinphoneCore *lc); void linphone_core_set_sip_port(LinphoneCore *lc,int port);