Changeset 501:8eda480150bf in verona


Ignore:
Timestamp:
Jun 20, 2012 4:59:54 PM (11 months ago)
Author:
Vadim Lebedev <vadim@…>
Branch:
default
Message:

avoid generation of mutiple Allow headers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • phapi/phapi.c

    r500 r501  
    203203int ph_set_media_direction( sdp_message_t * sdp, const char *media_type, enum ph_direction direction); 
    204204const char * ph_get_str_direction( enum ph_direction direction); 
    205  
     205int ph_message_set_allow(osip_message_t* msg, const char* allowstr); 
    206206#define nonempty(x)  ((x) && (x)[0]) 
    207207 
     
    17721772                return -1; 
    17731773 
    1774         osip_message_set_allow(invite, "INVITE, ACK, BYE, CANCEL, REFER, NOTIFY, SUBSCRIBE, REGISTER"); 
     1774        ph_message_set_allow(invite, "INVITE, ACK, BYE, CANCEL, REFER, NOTIFY, SUBSCRIBE, REGISTER"); 
    17751775 
    17761776        ph_apply_customizations(invite, NULL, NULL); 
     
    31583158 
    31593159        osip_message_set_subject(reinvite, "Call reinvite"); 
    3160         osip_message_set_allow(reinvite, "INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO"); 
     3160        ph_message_set_allow(reinvite, "INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO"); 
    31613161                 
    31623162        sdp_context_build_offer(ca->sdpctx); 
     
    33823382        if (vl->rid >= 0) 
    33833383        { 
    3384                 osip_message_set_allow(msg, "INVITE, ACK, BYE, CANCEL, OPTIONS, REFER, NOTIFY, SUBSCRIBE, REGISTER, MESSAGE"); 
     3384                ph_message_set_allow(msg, "INVITE, ACK, BYE, CANCEL, OPTIONS, REFER, NOTIFY, SUBSCRIBE, REGISTER, MESSAGE"); 
    33853385                ph_apply_customizations(msg, NULL, NULL); 
    33863386                ret = eXosip_register_send_register(vl->rid, msg); 
     
    78177817} 
    78187818 
     7819int ph_message_set_allow(osip_message_t* msg, const char* allowstr) 
     7820{ 
     7821        osip_allow_t* allow; 
     7822 
     7823        if (!osip_message_get_allow(msg, 0, &allow)) { 
     7824                char *tmp = osip_strdup(allowstr); 
     7825                if (!tmp) 
     7826                        return -1; 
     7827                osip_free(allow->value); 
     7828                allow->value = tmp; 
     7829                return 0; 
     7830        } 
     7831        return osip_message_set_allow(msg, allowstr); 
     7832} 
     7833 
Note: See TracChangeset for help on using the changeset viewer.