[Serdev] Parsing tree changes and PA questions

Christian_Gavin at logitech.com Christian_Gavin at logitech.com
Sat Mar 19 01:06:22 UTC 2005


Hi All,

I made the following changes to the parsing tree (parser/parse_content.c)

- The pidf+xml MIME subtype was declared as "pidfi+xml"
- One other index was incorrect. Reference to sibling node 42 now becomes
32.

With these changes I am able to SUBSCRIBE to presence events with a user
agent accepting "application/pidf+xml".

Also:

- In pa/notify.c the add_contact_hf( ) function incorrectly refers to the
CONTENT_TYPE instead of CONTACT

- In NOTIFY messages, the Contact header field is also missing <sip: and
the enclosing >. This is in the add_contact_hf( ) function as well.

- In NOTIFY messages, the Contact included should be the URI of the
presence agent, eg. sip:172.18.87.143 instead of the URI of the watcher.

- In response to a SUBSCRIBE, the presence agent is missing the Contact:
header field. I hacked something quick in modules/pa/subscribe.c but the
included URI I used (p_uri) refers to the IP address of the presentity and
subsequent SUBSCRIBEs get incorrectly routed to the presentity by my
client, bypassing the server. How would I include the correct presentity
(the one with the presence agent domain) as Contact ?

Thanks,
CG

8><-------------------------------------------------------------------------------------

static type_node_t subtype_tree[] = {
      {'p',SUBTYPE_UNKNOWN,2,12},               /* index 0 */
            {'l',SUBTYPE_UNKNOWN,1,5},
                  {'a',SUBTYPE_UNKNOWN,1,-1},
                        {'i',SUBTYPE_UNKNOWN,1,-1},
                              {'n',SUBTYPE_PLAIN,0,-1},
            {'i',SUBTYPE_UNKNOWN,1,-1},         /* index 5 */
                  {'d',SUBTYPE_UNKNOWN,1,-1},
                        {'f',SUBTYPE_UNKNOWN,1,-1},
                              {'+',TYPE_UNKNOWN,1,-1},
                                    {'x',TYPE_UNKNOWN,1,-1},
                                          {'m',TYPE_UNKNOWN,1,-1},
                                                {'l',SUBTYPE_PIDFXML,0,-1},
      {'s',SUBTYPE_UNKNOWN,1,15},               /* index 12 */
            {'d',SUBTYPE_UNKNOWN,1,-1},
                  {'p',SUBTYPE_SDP,0,-1},
      {'c',SUBTYPE_UNKNOWN,1,24},               /* index 15 */
            {'p',SUBTYPE_UNKNOWN,2,-1},
                  {'i',SUBTYPE_UNKNOWN,1,19},   /* index 17 */
                        {'m',SUBTYPE_CPIM,0,-1},
                  {'l',SUBTYPE_UNKNOWN,1,-1},   /* index 19 */
                        {'+',TYPE_UNKNOWN,1,-1},
                              {'x',TYPE_UNKNOWN,1,-1},
                                    {'m',TYPE_UNKNOWN,1,-1},
                                          {'l',SUBTYPE_CPLXML,0,-1},
      {'r',SUBTYPE_UNKNOWN,2,38},               /* index 24 */
            {'l',SUBTYPE_UNKNOWN,1,32},
                  {'m',SUBTYPE_UNKNOWN,1,-1},
                        {'i',SUBTYPE_UNKNOWN,1,-1},
                              {'+',TYPE_UNKNOWN,1,-1},
                                    {'x',TYPE_UNKNOWN,1,-1},
                                          {'m',TYPE_UNKNOWN,1,-1},
                                                {'l',SUBTYPE_RLMIXML,0,-1},
            {'e',SUBTYPE_UNKNOWN,1,-1},         /* index 32 */
                  {'l',SUBTYPE_UNKNOWN,1,-1},
                        {'a',SUBTYPE_UNKNOWN,1,-1},
                              {'t',SUBTYPE_UNKNOWN,1,-1},
                                    {'e',SUBTYPE_UNKNOWN,1,-1},
                                          {'d',SUBTYPE_RELATED,0,-1},
      {'l',SUBTYPE_UNKNOWN,1,48},               /* index 38 */
            {'p',SUBTYPE_UNKNOWN,1,-1},
                  {'i',SUBTYPE_UNKNOWN,1,-1},
                        {'d',SUBTYPE_UNKNOWN,1,-1},
                              {'f',SUBTYPE_UNKNOWN,1,-1},
                                    {'i',SUBTYPE_UNKNOWN,1,-1},
                                          {'+',TYPE_UNKNOWN,1,-1},
                                                {'x',TYPE_UNKNOWN,1,-1},

{'m',TYPE_UNKNOWN,1,-1},

{'l',SUBTYPE_LPIDFXML,0,-1},
      {'w',SUBTYPE_UNKNOWN,1,63},               /* index 48 */
            {'a',SUBTYPE_UNKNOWN,1,-1},
                  {'t',SUBTYPE_UNKNOWN,1,-1},
                        {'c',SUBTYPE_UNKNOWN,1,-1},
                              {'h',SUBTYPE_UNKNOWN,1,-1},
                                    {'e',SUBTYPE_UNKNOWN,1,-1},
                                          {'r',SUBTYPE_UNKNOWN,1,-1},
                                                {'i',TYPE_UNKNOWN,1,-1},

{'n',TYPE_UNKNOWN,1,-1},

{'f',TYPE_UNKNOWN,1,-1},

{'o',TYPE_UNKNOWN,1,-1},

{'+',TYPE_UNKNOWN,1,-1},

{'x',TYPE_UNKNOWN,1,-1},

      {'m',TYPE_UNKNOWN,1,-1},

            {'l',SUBTYPE_WATCHERINFOXML,0,-1},
      {'x',SUBTYPE_UNKNOWN,1,73},               /* index 63 */
            {'p',SUBTYPE_UNKNOWN,1,-1},
                  {'i',SUBTYPE_UNKNOWN,1,-1},
                        {'d',SUBTYPE_UNKNOWN,1,-1},
                              {'f',SUBTYPE_UNKNOWN,1,-1},
                                    {'i',SUBTYPE_UNKNOWN,1,-1},
                                          {'+',TYPE_UNKNOWN,1,-1},
                                                {'x',TYPE_UNKNOWN,1,-1},

{'m',TYPE_UNKNOWN,1,-1},

{'l',SUBTYPE_XPIDFXML,0,-1},
      {'e',SUBTYPE_UNKNOWN,1,-1},               /* index 73 */
            {'x',SUBTYPE_UNKNOWN,1,-1},
                  {'t',SUBTYPE_UNKNOWN,1,-1},
                        {'e',SUBTYPE_UNKNOWN,1,-1},
                              {'r',SUBTYPE_UNKNOWN,1,-1},
                                    {'n',SUBTYPE_UNKNOWN,1,-1},
                                          {'a',TYPE_UNKNOWN,1,-1},
                                                {'l',TYPE_UNKNOWN,1,-1},

{'-',TYPE_UNKNOWN,1,-1},

{'b',SUBTYPE_LPIDFXML,0,-1},

{'o',TYPE_UNKNOWN,1,-1},

{'d',TYPE_UNKNOWN,1,-1},

{'y',SUBTYPE_EXTERNAL_BODY,1,-1},

      };

8><-------------------------------------------------------------------------------------




More information about the Serdev mailing list