Changeset 364:e1b6bfaba51c in verona


Ignore:
Timestamp:
Nov 8, 2011 3:40:01 PM (19 months ago)
Author:
Vadim Lebedev <vadim@…>
Branch:
default
Message:

Implement correct hanling of Expires parameter value in Contact header of REGISTER replies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • phapi/phapi.c

    r358 r364  
    121121 
    122122 
     123static char *ph_get_call_(phcall_t *ca); 
     124static void set_customized_header(osip_message_t *req, const char *h, const char *v); 
    123125static char *ph_get_call_contact(phcall_t *ca); 
    124 static void set_customized_header(osip_message_t *req, const char *h, const char *v); 
    125126 
    126127#define MEDIA_SUSPEND 
     
    61416142static int ph_find_expires_for_vl(int vlid, osip_message_t *msg) 
    61426143{ 
    6143         //TODO: we must every Contact header field and extracting the value of "expires" param, 
    6144         //currently let's return 0 so phapi will keep the vline regTimeout 
    6145         return 0; 
     6144        osip_contact_t*  mctct; 
     6145        osip_contact_t*  lctct; 
     6146        struct vline *vl; 
     6147        int ret = 0; 
     6148        int pos = 0; 
     6149 
     6150        osip_contact_init(&lctct); 
     6151        osip_contact_parse(lctct, vl->contact); 
     6152 
     6153        vl = vl = ph_valid_vlid(vlid); 
     6154        if (!vl) 
     6155                return 0; 
     6156 
     6157        while(!osip_message_get_contact(msg, pos++, &mctct)) { 
     6158                osip_uri_param_t *param; 
     6159 
     6160                ret = ph_same_str(lctct->url->username, mctct->url->username) && 
     6161                                ph_same_str(lctct->url->host, mctct->url->host) && 
     6162                                ph_same_str(lctct->url->port, mctct->url->port); 
     6163                if (!ret) 
     6164                        continue; 
     6165 
     6166                ret = 0; 
     6167                if (!osip_contact_param_get_byname(mctct, "Expires", &param)) { 
     6168                        ret = atoi(param->gvalue); 
     6169                } 
     6170                break; 
     6171        } 
     6172        osip_contact_free(lctct); 
     6173        return ret; 
    61466174} 
    61476175 
Note: See TracChangeset for help on using the changeset viewer.