merge patch allowing to set tcp port from gui

This commit is contained in:
Simon Morlat 2010-11-17 15:12:34 +01:00
parent fadf0603d9
commit 9a96f5c122
3 changed files with 66 additions and 13 deletions

View file

@ -3664,6 +3664,7 @@ void sip_config_uninit(LinphoneCore *lc)
int i;
sip_config_t *config=&lc->sip_conf;
lp_config_set_int(lc->config,"sip","sip_port",config->transports.udp_port);
lp_config_set_int(lc->config,"sip","sip_tcp_port",config->transports.tcp_port);
lp_config_set_int(lc->config,"sip","guess_hostname",config->guess_hostname);
lp_config_set_string(lc->config,"sip","contact",config->contact);
lp_config_set_int(lc->config,"sip","inc_timeout",config->inc_timeout);

View file

@ -28,7 +28,15 @@
</object>
<object class="GtkAdjustment" id="adjustment4">
<property name="value">1</property>
<property name="lower">1</property>
<property name="lower">0</property>
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
<property name="page_size">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_tcp_port">
<property name="value">1</property>
<property name="lower">0</property>
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
@ -252,7 +260,7 @@
<object class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="n_rows">3</property>
<property name="n_rows">4</property>
<property name="n_columns">2</property>
<child>
<object class="GtkSpinButton" id="video_rtp_port">
@ -265,8 +273,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
</packing>
</child>
<child>
@ -277,6 +285,21 @@
<property name="adjustment">adjustment3</property>
<signal name="value_changed" handler="linphone_gtk_audio_port_changed"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="tcp_sip_port">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="adjustment">adjustment_tcp_port</property>
<signal name="value_changed" handler="linphone_gtk_tcp_sip_port_changed"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
@ -285,12 +308,12 @@
</packing>
</child>
<child>
<object class="GtkSpinButton" id="sip_port">
<object class="GtkSpinButton" id="udp_sip_port">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="adjustment">adjustment4</property>
<signal name="value_changed" handler="linphone_gtk_sip_port_changed"/>
<signal name="value_changed" handler="linphone_gtk_udp_sip_port_changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@ -305,8 +328,8 @@
<property name="justify">right</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
</packing>
</child>
<child>
@ -316,6 +339,18 @@
<property name="label" translatable="yes">Audio RTP/UDP:</property>
<property name="justify">right</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_tcp_port">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">SIP (TCP):</property>
<property name="justify">right</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>

View file

@ -102,9 +102,22 @@ void linphone_gtk_ipv6_toggled(GtkWidget *w){
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)));
}
void linphone_gtk_sip_port_changed(GtkWidget *w){
linphone_core_set_sip_port(linphone_gtk_get_core(),
(gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(w)));
void linphone_gtk_udp_sip_port_changed(GtkWidget *w){
LCSipTransports tr;
LinphoneCore *lc=linphone_gtk_get_core();
linphone_core_get_sip_transports(lc,&tr);
tr.udp_port = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
linphone_core_set_sip_transports(lc,&tr);
}
void linphone_gtk_tcp_sip_port_changed(GtkWidget *w){
LCSipTransports tr;
LinphoneCore *lc=linphone_gtk_get_core();
linphone_core_get_sip_transports(lc,&tr);
tr.tcp_port = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
linphone_core_set_sip_transports(lc,&tr);
}
void linphone_gtk_audio_port_changed(GtkWidget *w){
@ -746,12 +759,16 @@ void linphone_gtk_show_parameters(void){
GtkWidget *codec_list=linphone_gtk_get_widget(pb,"codec_list");
int mtu;
int ui_advanced;
LCSipTransports tr;
/* NETWORK CONFIG */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"ipv6_enabled")),
linphone_core_ipv6_enabled(lc));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"sip_port")),
linphone_core_get_sip_port(lc));
linphone_core_get_sip_transports(lc,&tr);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"udp_sip_port")),
tr.udp_port);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"tcp_sip_port")),
tr.tcp_port);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"audio_rtp_port")),
linphone_core_get_audio_port(lc));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"video_rtp_port")),