*
* @ingroup misc
**/
-void linphone_core_set_user_agent(const char *name, const char *ver){
+void linphone_core_set_user_agent(LinphoneCore *lc, const char *name, const char *ver){
strncpy(_ua_name,name,sizeof(_ua_name)-1);
strncpy(_ua_version,ver,sizeof(_ua_version));
+ apply_user_agent(lc);
}
const char *linphone_core_get_user_agent_name(void){
void linphone_core_enable_logs(FILE *file);
void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc);
void linphone_core_disable_logs(void);
-/*sets the user-agent string in sip messages, must be set before linphone_core_new() or linphone_core_init() */
-void linphone_core_set_user_agent(const char *ua_name, const char *version);
const char *linphone_core_get_version(void);
const char *linphone_core_get_user_agent_name(void);
const char *linphone_core_get_user_agent_version(void);
#endif
+/*sets the user-agent string in sip messages, ideally called just after linphone_core_new() or linphone_core_init() */
+void linphone_core_set_user_agent(LinphoneCore *lc, const char *ua_name, const char *version);
+
LinphoneAddress * linphone_core_interpret_url(LinphoneCore *lc, const char *url);
LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url);
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setUserAgent(JNIEnv *env,jobject thiz,jlong pCore, jstring name, jstring version){
const char* cname=env->GetStringUTFChars(name, NULL);
const char* cversion=env->GetStringUTFChars(version, NULL);
- linphone_core_set_user_agent(cname,cversion);
+ linphone_core_set_user_agent((LinphoneCore *)pCore,cname,cversion);
env->ReleaseStringUTFChars(name, cname);
env->ReleaseStringUTFChars(version, cversion);
}
vtable.call_encryption_changed=linphone_gtk_call_encryption_changed;
vtable.transfer_state_changed=linphone_gtk_transfer_state_changed;
- linphone_core_set_user_agent("Linphone", LINPHONE_VERSION);
the_core=linphone_core_new(&vtable,config_file,factory_config_file,NULL);
+ linphone_core_set_user_agent(the_core,"Linphone", LINPHONE_VERSION);
linphone_core_set_waiting_callback(the_core,linphone_gtk_wait,NULL);
linphone_core_set_zrtp_secrets_file(the_core,secrets_file);
g_free(secrets_file);