Changeset 372:2dbfcbc0c0f3 in verona


Ignore:
Timestamp:
Nov 21, 2011 8:08:30 PM (19 months ago)
Author:
Laurent Tarrisse <hsivank@…>
Branch:
default
Message:

hold/resume

File:
1 edited

Legend:

Unmodified
Added
Removed
  • phapi/phapi.c

    r371 r372  
    61776177} 
    61786178 
     6179void 
     6180ph_call_offhold(eXosip_event_t *je) 
     6181{ 
     6182        phCallStateInfo_t info; 
     6183        phcall_t *ca; 
     6184        int remotehold; 
     6185 
     6186        DBG_SIP_NEGO("SIP NEGO: ph_call_offhold\n"); 
     6187 
     6188        ca = ph_locate_call(je, 0); 
     6189        if (!ca) 
     6190                return; 
     6191 
     6192        clear(info); 
     6193 
     6194        info.vlid = ca->vlid; 
     6195 
     6196        remotehold = ca->remotehold; 
     6197        ca->remotehold = 0; 
     6198 
     6199        if (ph_call_hasaudio(ca) || ph_call_hasvideo(ca)) { 
     6200                ph_call_retrieve_payloads(ca, -1); 
     6201                ph_call_media_resume(ca, !remotehold); 
     6202        } 
     6203 
     6204        if (remotehold) { 
     6205                info.userData = je->external_reference; 
     6206                info.event = phCALLRESUMED; 
     6207                info.streams = ca->nego_mflags; 
     6208 
     6209                if (phcb->callProgress) { 
     6210                        phcb->callProgress(ca->cid, &info); 
     6211                } 
     6212        } 
     6213} 
     6214 
     6215#define keywordcmp(key,str)  strncmp(key,str,strlen(key)) 
     6216 
     6217void 
     6218ph_call_reinvite(eXosip_event_t *je) 
     6219{ 
     6220        int is_sendrec = 0; 
     6221        int mline = 0; 
     6222        sdp_message_t * msg = eXosip_get_sdp_info(je->request); 
     6223 
     6224        for (mline=0; !sdp_message_endof_media (msg, mline); mline++) { 
     6225                int i; 
     6226                sdp_attribute_t *attr; 
     6227                const char * mtype = sdp_message_m_media_get(msg, mline); 
     6228                if (strcasecmp("audio", mtype) == 0){ 
     6229                        //is audio 
     6230                } 
     6231                /*else if (strcasecmp("video", mtype) == 0){ 
     6232                        //is video 
     6233                }*/ 
     6234                else 
     6235                        continue; 
     6236 
     6237                for (i=0;(attr=sdp_message_attribute_get(msg,mline,i))!=NULL;i++) { 
     6238                        if (keywordcmp("sendrecv",attr->a_att_field)==0){ 
     6239                                is_sendrec = 1; 
     6240                        }/*else if (keywordcmp("sendonly",attr->a_att_field)==0){ 
     6241                                is_sendrec = 0; 
     6242                        }else if (keywordcmp("recvonly",attr->a_att_field)==0){ 
     6243                                is_sendrec = 0; 
     6244                        }else if (keywordcmp("inactive",attr->a_att_field)==0){ 
     6245                                is_sendrec = 0; 
     6246                        }*/ 
     6247                } 
     6248                break; 
     6249        } 
     6250 
     6251        ph_answer_request(je->cid, je->tid, 200, 0); 
     6252 
     6253        if(is_sendrec) 
     6254                ph_call_offhold(je); 
     6255        else 
     6256        ph_call_onhold(je); 
     6257} 
     6258 
    61796259static int ph_find_expires_for_vl(int vlid, osip_message_t *msg) 
    61806260{ 
     
    65676647                switch(je->type) 
    65686648                { 
     6649                case EXOSIP_CALL_REINVITE: 
     6650                        ph_call_reinvite(je); 
     6651                        break; 
     6652 
    65696653                case EXOSIP_CALL_INVITE: 
    65706654                        ph_call_new(je); 
Note: See TracChangeset for help on using the changeset viewer.