|
Hi Vadim! Unfortunately we don't have an environment that allows "follow me" capabibility testing here. Anyway, a look on SIP packages exchanged with just the inicial changes pointed below confirmed my suspicion. Considering that, I've changed methods "ph_answer_request" and "eXosip_answer_call" to accept an additional parameter "char* answer_contact" that will have a value only on "follow me" scenario (it will be NULL on all other cases). The patch follows attached and, as I've said, I made the necessary tests and study (reading RFC 3261) to have a feeling that it's all ok, but as our server don't handle "302 Moved Temporarily" response codes, I'm not completely sure that this will work perfectly. Can you please have a look on it ? Thanks and best regards, Mauro. Mauro Sergio Ferreira Brasil escreveu: Hi Vadim! --
|
diff -r b9d37dbd4b26 wifo/eXosip/include/eXosip/eXosip.h
--- a/wifo/eXosip/include/eXosip/eXosip.h Mon May 25 11:54:53 2009 +0200
+++ b/wifo/eXosip/include/eXosip/eXosip.h Tue Jun 09 16:32:13 2009 -0300
@@ -446,7 +446,7 @@
* @param jid dialog id of call.
* @param status Status code to use.
*/
-int eXosip_answer_call (int jid, int status, char *local_sdp_port, char
*local_video_port, char *public_sdp_port, char *public_video_port);
+int eXosip_answer_call (int jid, int status, char *local_sdp_port, char
*local_video_port, char *public_sdp_port, char *public_video_port, char*
answer_contact);
/**
* Answer call.
diff -r b9d37dbd4b26 wifo/eXosip/src/eXosip.c
--- a/wifo/eXosip/src/eXosip.c Mon May 25 11:54:53 2009 +0200
+++ b/wifo/eXosip/src/eXosip.c Tue Jun 09 16:32:13 2009 -0300
@@ -1504,7 +1504,7 @@
return 0;
}
-int eXosip_answer_call(int jid, int status, char *local_sdp_port, char
*local_video_port, char *public_sdp_port, char *public_video_port )
+int eXosip_answer_call(int jid, int status, char *local_sdp_port, char
*local_video_port, char *public_sdp_port, char *public_video_port, char*
answer_contact )
{
int i = -1;
eXosip_dialog_t *jd = NULL;
@@ -1522,7 +1522,11 @@
return -1;
}
- if
+ if ( (answer_contact != NULL) && (answer_contact[0] != '\0') )
+ {
+ osip_strncpy(contact, answer_contact, sizeof(contact) - 1);
+ }
+ else if
(
owsip_account_contact_get
(
@@ -2651,7 +2655,7 @@
if (tr!=NULL && tr->last_response!=NULL &&
MSG_IS_STATUS_1XX(tr->last_response))
{ /* answer with 603 */
- i = eXosip_answer_call(jid, 603, 0, 0, 0, 0);
+ i = eXosip_answer_call(jid, 603, 0, 0, 0, 0, NULL);
return i;
}
}
diff -r b9d37dbd4b26 wifo/phapi/phapi-old.c
--- a/wifo/phapi/phapi-old.c Mon May 25 11:54:53 2009 +0200
+++ b/wifo/phapi/phapi-old.c Tue Jun 09 16:32:13 2009 -0300
@@ -1235,7 +1235,7 @@
eXosip_lock();
DBG_SIP_NEGO("NO STUN ports (a.local=%s, a.public=%s) (v.local=%s,
v.public=%s)\n",local_voice_port,0,local_video_port,0);
- i = eXosip_answer_call(ca->did, 200, local_voice_port,
optional(local_video_port), 0, 0);
+ i = eXosip_answer_call(ca->did, 200, local_voice_port,
optional(local_video_port), 0, 0, NULL);
if (i == 0)
{
@@ -1293,15 +1293,22 @@
int
+ph_answer_request_with_contact(int did, int reason, char* answer_contact)
+{
+ int i;
+
+ eXosip_lock();
+ i = eXosip_answer_call(did, reason, 0, 0, 0, 0, answer_contact);
+ eXosip_unlock();
+
+ return i;
+}
+
+
+int
ph_answer_request(int did, int reason)
{
- int i;
-
- eXosip_lock();
- i = eXosip_answer_call(did, reason, 0, 0, 0, 0);
- eXosip_unlock();
-
- return i;
+ return ph_answer_request_with_contact(did, reason, NULL);
}
@@ -1666,6 +1673,33 @@
return i;
}
+
+
+int
+phLineSetFollowMe(int vlid, const char *uri)
+{
+ phVLine *vl = ph_valid_vlid(vlid);
+
+ if (!vl)
+ {
+ return -PH_BADVLID;
+ }
+
+ if (ph_find_matching_vline(uri, PHM_IGNORE_PORT))
+ {
+ return -PH_REDIRLOOP;
+ }
+
+ if (vl->followme)
+ {
+ osip_free(vl->followme);
+ }
+
+ vl->followme = osip_strdup(uri);
+
+ return 0;
+}
+
int
phLineSetBusy(int vlid, int busyFlag)
@@ -2922,7 +2956,7 @@
if (ph_follow_me_addr[0])
{
- ph_answer_request(je->did, 302, ph_follow_me_addr);
+ ph_answer_request_with_contact(je->did, 302, ph_follow_me_addr);
return;
}
#endif /* not used */
@@ -2969,13 +3003,11 @@
}
}
-#if 0 /* not used */
if (vl->followme && vl->followme[0])
{
- ph_answer_request(je->did, 302, vl->followme);
- return;
- }
-#endif /* not used */
+ ph_answer_request_with_contact(je->did, 302, vl->followme);
+ return;
+ }
ca = ph_locate_call(je, 1);
@@ -4932,7 +4964,7 @@
}
eXosip_lock();
- i = eXosip_answer_call(ca->did, 486, 0, 0, 0, 0);
+ i = eXosip_answer_call(ca->did, 486, 0, 0, 0, 0, NULL);
eXosip_unlock();
DBG_SIP_NEGO("release calls");
@@ -4974,13 +5006,11 @@
return FALSE;
}
-#if 0 /* not used */
if (vl->followme && vl->followme[0])
{
- ph_answer_request(did, 302, vl->followme);
- return FALSE;
- }
-#endif /* not used */
+ ph_answer_request_with_contact(did, 302, vl->followme);
+ return FALSE;
+ }
// ca = ph_locate_call(je, 1);
if((ca = ph_locate_call_by_cid(cid)) == NULL)
diff -r b9d37dbd4b26 wifo/phapi/phvline.c
--- a/wifo/phapi/phvline.c Mon May 25 11:54:53 2009 +0200
+++ b/wifo/phapi/phvline.c Tue Jun 09 16:32:13 2009 -0300
@@ -91,6 +91,8 @@
if (vl->used)
{
vl->used = 0;
+ if (vl->followme)
+ osip_free(vl->followme);
}
}
diff -r b9d37dbd4b26 wifo/phapi/phvline.h
--- a/wifo/phapi/phvline.h Mon May 25 11:54:53 2009 +0200
+++ b/wifo/phapi/phvline.h Tue Jun 09 16:32:13 2009 -0300
@@ -38,6 +38,7 @@
void * configurationHookUserData ;
OWPL_LINESTATE_EVENT LineState ;
int busy ;
+ char *followme;
/* sip parameters */
OWSIPAccount sipAccount ;
_______________________________________________ QuteCom-dev mailing list [email protected] http://lists.qutecom.org/mailman/listinfo/qutecom-dev
