Dne 1.9.2009 21:59, Simon Morlat napsal(a):
Not sure what's wrong, but I don't see any difference. The last message of the log isI just pushed to svn and git a possible workaround: it restarts the register with the real local address as seen by the server, after the 404 failure. So the expected behaviour should be first the same 404 error, then a second register going to the server, but this time with correct contact information.Unfortunately I have no server on my hands to test with for this use case. At least I could verify this patch does not break the behaviour for the main case. Can you do the test and send me back the log in case of failure again ?
commit d0fe2ae5e394889a09635dc8f5eae2ad7e5e3754 Author: smorlat <smor...@3f6dc0c8-ddfe-455d-9043-3cd528dc4637> Date: Tue Sep 1 19:55:36 2009 +0000retry a register after a failure, if the contact was not up to date (incorre
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/tr...@618 3f6dc0c8-dd
(and git diff HEAD^1 is attached just to be sure I have the same code as you have)
Matěj
diff --git a/linphone/coreapi/exevents.c b/linphone/coreapi/exevents.c
index 12a4475..0cd7b43 100644
--- a/linphone/coreapi/exevents.c
+++ b/linphone/coreapi/exevents.c
@@ -932,9 +932,8 @@ void linphone_registration_faillure(LinphoneCore *lc,
eXosip_event_t *ev){
const char *reason=NULL;
osip_uri_t *requri=osip_message_get_uri(ev->request);
char *ru;
+ LinphoneProxyConfig *cfg;
- osip_uri_to_str(requri,&ru);
-
if (ev->response){
status_code=osip_message_get_status_code(ev->response);
reason=osip_message_get_reason_phrase(ev->response);
@@ -945,14 +944,21 @@ void linphone_registration_faillure(LinphoneCore *lc,
eXosip_event_t *ev){
linphone_process_authentication(lc,ev);
break;
case 403:
-
linphone_proxy_config_process_authentication_failure(lc,ev);
+ cfg=linphone_core_get_proxy_config_from_rid(lc,ev->rid);
+ /* if contact is up to date, process the failure,
otherwise resend a new register with
+ updated contact first, just in case the
faillure is due to incorrect contact */
+ if
(!linphone_proxy_config_register_again_with_updated_contact(cfg,ev->request,ev->response)){
+
linphone_proxy_config_process_authentication_failure(lc,ev);
+ return;
+ }
default:
+ osip_uri_to_str(requri,&ru);
msg=ortp_strdup_printf(_("Registration on %s failed:
%s"),ru,(reason!=NULL) ? reason : _("no response timeout"));
lc->vtable.display_status(lc,msg);
gstate_new_state(lc, GSTATE_REG_FAILED, msg);
ms_free(msg);
+ osip_free(ru);
}
- osip_free(ru);
}
void linphone_registration_success(LinphoneCore *lc,eXosip_event_t *ev){
diff --git a/linphone/coreapi/private.h b/linphone/coreapi/private.h
index 325d103..dd34975 100644
--- a/linphone/coreapi/private.h
+++ b/linphone/coreapi/private.h
@@ -32,10 +32,6 @@
#include "config.h"
#endif
-#ifndef LINPHONE_VERSION
-#define LINPHONE_VERSION "3.1.2"
-#endif
-
#ifndef LIBLINPHONE_VERSION
#define LIBLINPHONE_VERSION LINPHONE_VERSION
#endif
@@ -112,7 +108,7 @@ static inline void set_string(char **dest, const char *src){
}
#define PAYLOAD_TYPE_ENABLED PAYLOAD_TYPE_USER_FLAG_0
-void
linphone_proxy_config_register_again_with_updated_contact(LinphoneProxyConfig
*obj, osip_message_t *orig_request, osip_message_t *last_answer);
+bool_t
linphone_proxy_config_register_again_with_updated_contact(LinphoneProxyConfig
*obj, osip_message_t *orig_request, osip_message_t *last_answer);
void linphone_process_authentication(LinphoneCore* lc, eXosip_event_t *ev);
void linphone_authentication_ok(LinphoneCore *lc, eXosip_event_t *ev);
void linphone_subscription_new(LinphoneCore *lc, eXosip_event_t *ev);
diff --git a/linphone/coreapi/proxy.c b/linphone/coreapi/proxy.c
index 9ea5968..bdd10e6 100644
--- a/linphone/coreapi/proxy.c
+++ b/linphone/coreapi/proxy.c
@@ -60,25 +60,25 @@ bool_t linphone_proxy_config_is_registered(const
LinphoneProxyConfig *obj){
return obj->registered;
}
-void
linphone_proxy_config_register_again_with_updated_contact(LinphoneProxyConfig
*obj, osip_message_t *orig_request, osip_message_t *last_answer){
+bool_t
linphone_proxy_config_register_again_with_updated_contact(LinphoneProxyConfig
*obj, osip_message_t *orig_request, osip_message_t *last_answer){
osip_message_t *msg;
const char *rport,*received;
osip_via_t *via=NULL;
osip_generic_param_t *param=NULL;
osip_contact_t *ctt=NULL;
osip_message_get_via(last_answer,0,&via);
- if (!via) return;
+ if (!via) return FALSE;
osip_via_param_get_byname(via,"rport",¶m);
if (param) rport=param->gvalue;
- else return;
+ else return FALSE;
param=NULL;
osip_via_param_get_byname(via,"received",¶m);
if (param) received=param->gvalue;
- else return;
+ else return FALSE;
osip_message_get_contact(orig_request,0,&ctt);
if (strcmp(ctt->url->host,received)==0 && (ctt->url->port!=0 &&
strcmp(ctt->url->port,rport)==0)){
ms_message("Register has up to date contact, doing nothing.");
- return;
+ return FALSE;
}
eXosip_lock();
msg=NULL;
@@ -95,6 +95,7 @@ void
linphone_proxy_config_register_again_with_updated_contact(LinphoneProxyConf
eXosip_register_send_register(obj->rid,msg);
eXosip_unlock();
ms_message("Resending new register with updated contact
%s:%s",received,rport);
+ return TRUE;
}
int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char
*server_addr){
(linphone-3:9488): libglade-WARNING **: Radio button group video_item could not be found ALSA lib conf.c:3952:(snd_config_expand) Unknown parameters 0 ALSA lib control.c:909:(snd_ctl_open_noupdate) Invalid CTL default:0 ALSA lib conf.c:3952:(snd_config_expand) Unknown parameters 0 ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM default:0 ALSA lib conf.c:3952:(snd_config_expand) Unknown parameters 0 ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM default:0 ALSA lib conf.c:3952:(snd_config_expand) Unknown parameters 1 ALSA lib control.c:909:(snd_ctl_open_noupdate) Invalid CTL default:1 ALSA lib conf.c:3952:(snd_config_expand) Unknown parameters 1 ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM default:1 ALSA lib conf.c:3952:(snd_config_expand) Unknown parameters 1 ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM default:1 linphone-message : Registering all filters... linphone-message : Registering all soundcard handlers linphone-message : Card ALSA: default device added linphone-warning : Could not attach mixer to card: NepÅÃpustný argument linphone-warning : Strange, sound card HDA Intel does not seems to be capable of anything, retrying with plughw... linphone-message : Card ALSA: HDA Intel added linphone-warning : Could not attach mixer to card: NepÅÃpustný argument linphone-warning : Strange, sound card USB Device 0x46d:0x8da does not seems to be capable of anything, retrying with plughw... linphone-message : Card ALSA: USB Device 0x46d:0x8da added linphone-message : Registering all webcam handlers linphone-message : Webcam V4L2: /dev/video0 added linphone-message : Webcam V4L: /dev/video0 added linphone-message : Webcam StaticImage: Static picture added linphone-message : Loading plugins linphone-message : Cannot open directory /usr/lib/mediastreamer/plugins: AdresáŠnebo soubor neexistuje linphone-message : ms_init() done linphone-message : Cannot open directory /usr/lib/liblinphone/plugins: AdresáŠnebo soubor neexistuje linphone-message : DNS resolution with 0.0.0.0:5060 linphone-message : getaddrinfo returned the following addresses: linphone-message : 0.0.0.0 port 5060 linphone-message : eXosip: Reseting timer to 15s before waking up! linphone-message : allocating transaction ressource 1 125646156 linphone-message : allocating NICT context linphone-message : DNS resolution with ccm-sub1.ipt.str.redhat.com:5060 linphone-message : getaddrinfo returned the following addresses: linphone-message : 10.32.8.32 port 5060 linphone-message : Message sent: (to dest=10.32.8.32:5060) REGISTER sip:ccm-sub1.ipt.str.redhat.com SIP/2.0 Via: SIP/2.0/UDP 192.168.1.2:5060;rport;branch=z9hG4bK1547503472 From: <sip:[email protected]>;tag=295827959 To: <sip:[email protected]> Call-ID: 125646156 CSeq: 1 REGISTER Contact: <sip:[email protected]:5060;line=834b2840c03f747> Max-Forwards: 70 User-Agent: Linphone/3.1.2 (eXosip2/3.1.0) Expires: 3600 Content-Length: 0 linphone-message : cb_sndregister (id=1) linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : Received message: SIP/2.0 100 Trying Date: Tue, 01 Sep 2009 21:35:40 GMT From: <sip:[email protected]>;tag=295827959 Content-Length: 0 To: <sip:[email protected]> Call-ID: 125646156 Via: SIP/2.0/UDP 192.168.1.2:5060;rport;branch=z9hG4bK1547503472;received=10.36.8.249 CSeq: 1 REGISTER linphone-message : Message received from: 10.32.8.32:5060 linphone-message : Message received from: 10.32.8.32:5060 linphone-message : MESSAGE REC. CALLID:125646156 linphone-message : Message received from: 10.32.8.32:5060 linphone-message : cb_rcv1xx (id=1) linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : Received message: SIP/2.0 401 Unauthorized Date: Tue, 01 Sep 2009 21:35:40 GMT From: <sip:[email protected]>;tag=295827959 WWW-Authenticate: Digest realm="ccmsipline", nonce="Z4ERNjgoqXQpDiFoyjj3FspfyhxMdZMP", algorithm=MD5 Content-Length: 0 To: <sip:[email protected]>;tag=1941804240 Call-ID: 125646156 Via: SIP/2.0/UDP 192.168.1.2:5060;rport;branch=z9hG4bK1547503472;received=10.36.8.249 CSeq: 1 REGISTER linphone-message : Message received from: 10.32.8.32:5060 linphone-message : Message received from: 10.32.8.32:5060 linphone-message : MESSAGE REC. CALLID:125646156 linphone-message : Message received from: 10.32.8.32:5060 linphone-message : cb_rcv4xx (id=1) linphone-message : eXosip: timer sec:5 usec:10000! linphone-message : REGISTRATION_FAILURE linphone-message : INFO: authinfo: "ccmsipline" "ccmsipline" linphone-message : INFO: authinfo: "ccmsipline" "ccmsipline" linphone-message : allocating transaction ressource 2 125646156 linphone-message : allocating NICT context linphone-message : DNS resolution with ccm-sub1.ipt.str.redhat.com:5060 linphone-message : getaddrinfo ret ** (linphone-3:9488): WARNING **: Nelze najÃt soubor s obrázkem: calling_anim.gif urned the following addresses: linphone-message : 10.32.8.32 port 5060 linphone-message : Message sent: (to dest=10.32.8.32:5060) REGISTER sip:ccm-sub1.ipt.str.redhat.com SIP/2.0 Via: SIP/2.0/UDP 192.168.1.2:5060;rport;branch=z9hG4bK295368392 From: <sip:[email protected]>;tag=295827959 To: <sip:[email protected]> Call-ID: 125646156 CSeq: 2 REGISTER Contact: <sip:[email protected]:5060;line=834b2840c03f747> Authorization: Digest username="8255157", realm="ccmsipline", nonce="Z4ERNjgoqXQpDiFoyjj3FspfyhxMdZMP", uri="sip:ccm-sub1.ipt.str.redhat.com", response="e4c025144812ce8e9e3444c5c375e4bd", algorithm=MD5 Max-Forwards: 70 User-Agent: Linphone/3.1.2 (eXosip2/3.1.0) Expires: 3600 Content-Length: 0 linphone-message : cb_sndregister (id=2) linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : Received message: SIP/2.0 100 Trying Date: Tue, 01 Sep 2009 21:35:40 GMT From: <sip:[email protected]>;tag=295827959 Content-Length: 0 To: <sip:[email protected]>;tag=1941804240 Call-ID: 125646156 Via: SIP/2.0/UDP 192.168.1.2:5060;rport;branch=z9hG4bK295368392;received=10.36.8.249 CSeq: 2 REGISTER linphone-message : Message received from: 10.32.8.32:5060 linphone-message : Message received from: 10.32.8.32:5060 linphone-message : MESSAGE REC. CALLID:125646156 linphone-message : Message received from: 10.32.8.32:5060 linphone-message : cb_rcv1xx (id=2) linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : Received message: SIP/2.0 404 Not Found Date: Tue, 01 Sep 2009 21:35:40 GMT Warning: 399 ccm-sub1 "Unable to find device/user in database" From: <sip:[email protected]>;tag=295827959 Content-Length: 0 To: <sip:[email protected]>;tag=1941804240 Call-ID: 125646156 Via: SIP/2.0/UDP 192.168.1.2:5060;rport;branch=z9hG4bK295368392;received=10.36.8.249 CSeq: 2 REGISTER linphone-message : Message received from: 10.32.8.32:5060 linphone-message : Message received from: 10.32.8.32:5060 linphone-message : MESSAGE REC. CALLID:125646156 linphone-message : Message received from: 10.32.8.32:5060 linphone-message : cb_rcv4xx (id=2) linphone-message : eXosip: timer sec:4 usec:100000! linphone-message : REGISTRATION_FAILURE linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : cb_nict_kill_transaction (id=1) linphone-message : Release a terminated transaction linphone-message : free transaction ressource 1 125646156 linphone-message : free nict ressource linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : cb_nict_kill_transaction (id=2) linphone-message : eXosip: Reseting timer to 15s before waking up! linphone-message : eXosip option set: ipv4_for_gateway:! linphone-message : Notifying all friends that we are in status 5 linphone-message : Partial MTU discovered : 1412 linphone-message : Partial MTU discovered : 1412 linphone-message : mtu to ccm-sub1.ipt.str.redhat.com is 1412 linphone-message : Discovered mtu is 1412, RTP payload max size is 1352 linphone-message : allocating transaction ressource 3 8321718 linphone-message : allocating ICT context linphone-message : DNS resolution with ccm-sub1.ipt.str.redhat.com:5060 linphone-message : getaddrinfo returned the following addresses: linphone-message : 10.32.8.32 port 5060 linphone-message : Message sent: (to dest=10.32.8.32:5060) INVITE sip:[email protected] SIP/2.0 Via: SIP/2.0/UDP 192.168.1.2:5060;rport;branch=z9hG4bK2139853223 From: <sip:[email protected]>;tag=989523058 To: <sip:[email protected]> Call-ID: 8321718 CSeq: 20 INVITE Contact: <sip:[email protected]:5060> Content-Type: application/sdp Max-Forwards: 70 User-Agent: Linphone/3.1.2 (eXosip2/3.1.0) Subject: Phone call Expires: 120 Content-Length: 314 v=0 o=8255157 123456 654321 IN IP4 192.168.1.2 s=A conversation c=IN IP4 192.168.1.2 t=0 0 m=audio 7078 RTP/AVP 111 110 0 3 8 101 a=rtpmap:111 speex/16000/1 a=rtpmap:110 speex/8000/1 a=rtpmap:0 PCMU/8000/1 a=rtpmap:3 GSM/8000/1 a=rtpmap:8 PCMA/8000/1 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-11 linphone-message : cb_sndinvite (id=3) linphone-message : eXosip: timer sec:0 usec:100000! linphone-message : Received message: SIP/2.0 100 Trying Date: Tue, 01 Sep 2009 21:35:47 GMT From: <sip:[email protected]>;tag=989523058 Allow-Events: presence Content-Length: 0 To: <sip:[email protected]> Call-ID: 8321718 Via: SIP/2.0/UDP 192.168.1.2:5060;rport;branch=z9hG4bK2139853223;received=10.36.8.249 CSeq: 20 INVITE linphone-message : Message received from: 10.32.8.32:5060 linphone-message : Message received from: 10.32.8.32:5060 linphone-message : MESSAGE REC. CALLID:8321718 linphone-message : Message received from: 10.32.8.32:5060 linphone-message : cb_rcv1xx (id=3) linphone-message : eXosip: Reseting timer to 15s before waking up! linphone-message : Received message: SIP/2.0 503 Service Unavailable Date: Tue, 01 Sep 2009 21:35:47 GMT Warning: 399 "Unable to find a device handler for the request received on port 5060 from 192.168.1.2" From: <sip:[email protected]>;tag=989523058 Allow-Events: presence Content-Length: 0 To: <sip:[email protected]>;tag=1371871054 Call-ID: 8321718 Via: SIP/2.0/UDP 192.168.1.2:5060;rport;branch=z9hG4bK2139853223;received=10.36.8.249 CSeq: 20 INVITE linphone-message : Message received from: 10.32.8.32:5060 linphone-message : Message received from: 10.32.8.32:5060 linphone-message : MESSAGE REC. CALLID:8321718 linphone-message : Message received from: 10.32.8.32:5060 linphone-message : DNS resolution with 10.32.8.32:5060 linphone-message : getaddrinfo returned the following addresses: linphone-message : 10.32.8.32 port 5060 linphone-message : Message sent: (to dest=10.32.8.32:5060) ACK sip:[email protected] SIP/2.0 Via: SIP/2.0/UDP 192.168.1.2:5060;rport;branch=z9hG4bK2139853223 From: <sip:[email protected]>;tag=989523058 To: <sip:[email protected]>;tag=1371871054 Call-ID: 8321718 CSeq: 20 ACK Content-Length: 0 linphone-message : cb_rcv5xx (id=3) linphone-message : cb_sndack (id=3) linphone-message : eXosip: Reseting timer to 15s before waking up! linphone-message : CALL_PROCEEDING linphone-message : CALL_REQUESTFAILURE or GLOBALFAILURE or SERVERFAILURE linphone-message : Notifying all friends that we are in status 1 linphone-message : Release a terminated transaction linphone-message : Release a terminated transaction linphone-message : free transaction ressource 2 125646156 linphone-message : free nict ressource linphone-message : free transaction ressource 3 8321718 linphone-message : free ict ressource
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ Linphone-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/linphone-users
