On 03/04/10 01:40, James Lamanna wrote:
> On Fri, Apr 2, 2010 at 4:52 AM, Anca Vamanu <[email protected]> wrote:
>> Hi James,
>>
>> I think that the problem is with those Notifies without a body sent by
>> OpenSIPS when the phone was started. This is normal behavior, correct
>> and conform RFC - when the presence server does not have any record for
>> that presentity - it includes no body. But since you say that Linksys
>> does not like this and since it was not that difficult to change, I just
>> committed a patch that sends a Notify with an empty dialoginfo tuple as
>> body when no published record is found. Please upgrade from svn and test
>> this case again.
>
> Hi Anca,
> I saw your patch and upgraded to the SVN 1.6 branch.
> However, I do not believe I ever hit that code path.
> In my debug logs I see "No record exists in hash table" (notify.c:853).
> I'm not sure if fallback2db is true, but I don't think it is, so I
> never make it to that codepath.
Give the attached patch a shot, it should do what you're looking for.
Though I'm not sure generating an empty dialog without a presence entry
is the correct approach, I mean, the monitored extension is not there,
so why not hint it as a blinking light? In a cold start scenario, it'll
go green once your re-subscribe time comes, so set it to a couple
minutes or lower in the phone and you'll be good to go.
--
Angel Marin
http://anmar.eu.org/
Index: notify_body.c
===================================================================
--- notify_body.c (revision 6758)
+++ notify_body.c (working copy)
@@ -340,7 +340,6 @@
xmlNodePtr state_node = NULL;
str *body= NULL;
- str *pres_uri= NULL;
char buf[MAX_URI_SIZE+1];
if ( (pres_user->len + pres_domain->len + 1) > MAX_URI_SIZE) {
@@ -353,23 +352,6 @@
memcpy(buf + pres_user->len + 5, pres_domain->s, pres_domain->len);
buf[pres_user->len + 5 + pres_domain->len]= '\0';
- pres_uri = (str*)pkg_malloc(sizeof(str));
- if(pres_uri == NULL)
- {
- LM_ERR("while allocating memory\n");
- return NULL;
- }
- memset(pres_uri, 0, sizeof(str));
- pres_uri->s = buf;
- pres_uri->len = pres_user->len + 5 + pres_domain->len;
-
- LM_DBG("[pres_uri] %.*s\n", pres_uri->len, pres_uri->s);
-
- if ( pres_contains_presence(pres_uri)<0 ) {
- LM_DBG("No record exists in hash_table\n");
- goto error;
- }
-
/* create the Publish body */
doc = xmlNewDoc(BAD_CAST "1.0");
if(doc==0)
@@ -427,10 +409,6 @@
xmlCleanupParser();
return body;
error:
- if ( pres_uri )
- {
- pkg_free(pres_uri);
- }
if(body)
{
if(body->s)
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users