[Freeswitch-dev] Question about sofia_presence.c

Gerald Weber gerald.weber at besharp.at
Thu Oct 25 10:40:29 MSD 2012

So you mean a sip packet like this ?

No.     Time           Source                Destination           Protocol Length Info
     74 4.780876000         SIP/XML  1174   Request: PUBLISH sip:2001 at

Frame 74: 1174 bytes on wire (9392 bits), 1174 bytes captured (9392 bits) on interface 0
Ethernet II, Src: HewlettP_33:a8:77 (e8:39:35:33:a8:77), Dst: Vmware_8c:00:1c (00:50:56:8c:00:1c)
Internet Protocol Version 4, Src: (, Dst: (
    Version: 4
    Header length: 20 bytes
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
    Total Length: 1160
    Identification: 0x1de8 (7656)
    Flags: 0x02 (Don't Fragment)
    Fragment offset: 0
    Time to live: 128
    Protocol: UDP (17)
    Header checksum: 0x0000 [incorrect, should be 0x2e4d (may be caused by "IP checksum offload"?)]
    Source: (
    Destination: (
    [Source GeoIP: Unknown]
    [Destination GeoIP: Unknown]
User Datagram Protocol, Src Port: 16066 (16066), Dst Port: sip (5060)
Session Initiation Protocol
    Request-Line: PUBLISH sip:2001 at SIP/2.0
    Message Header
    Message Body
        eXtensible Markup Language
                entity='sip:2001 at'>
                        Do not disturb

This i sent from a bria3 client to fs but i dont get any entry in sip_presence because of the check in line 4204.

Von: freeswitch-dev-bounces at lists.freeswitch.org [mailto:freeswitch-dev-bounces at lists.freeswitch.org] Im Auftrag von Anthony Minessale
Gesendet: Mittwoch, 24. Oktober 2012 20:01
An: freeswitch-dev at lists.freeswitch.org
Betreff: Re: [Freeswitch-dev] Question about sofia_presence.c

it has to send a publish to update sip_presence using the pidf method.

On Wed, Oct 24, 2012 at 10:55 AM, Gerald Weber <gerald.weber at besharp.at<mailto:gerald.weber at besharp.at>> wrote:
Hi all,

i'm currently extending my list_users command to show the presence status of registered sip devices.
I have a snom 360 and a bria softphone here to test with, calling one from the other shows 2 rows in sip_dialogs table so presence
is basically working.

Both phones have the ability to set the presence to, e.g. busy or meeting or whatever.

The only problem i have is, that there is no line in sip_presence table when i change the presence on the phone (or using presence in)
Digging through the code, i found that this is  because of the if statement in src/mod/endpoints/mod_sofia/sofia_presence.c line 4204
Looks like a check for multiple registrations, but how is this intended to work with only one registration per user ?
I changed the if to if (count > 0)  for testing and i can see the correct entries in sip_registrations.

I'm not quite sure if i understand the purpose of this code so i didn't raise a jira.
Is this a bug ? If not, does the sip_presence table only get filled when there are more than one registration per user ?


Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>

Official FreeSWITCH Sites

FreeSWITCH-dev mailing list
FreeSWITCH-dev at lists.freeswitch.org<mailto:FreeSWITCH-dev at lists.freeswitch.org>

Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale at hotmail.com<mailto:MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<mailto:PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net<http://irc.freenode.net> #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org<mailto:sip%3A888 at conference.freeswitch.org>
googletalk:conf+888 at conference.freeswitch.org<mailto:googletalk%3Aconf%2B888 at conference.freeswitch.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20121025/eec87537/attachment-0001.html 

Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev mailing list