Ignore:
Timestamp:
Dec 7, 2011 10:43:28 AM (12 years ago)
Author:
nanang
Message:

Re #1234: Initial version of keyframe request/response via SIP INFO.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r3894 r3901  
    26342634         * Handle INFO method. 
    26352635         */ 
    2636         if (tsx->role == PJSIP_ROLE_UAC &&  
     2636        const pj_str_t STR_APPLICATION = { "application", 11}; 
     2637        const pj_str_t STR_DTMF_RELAY  = { "dtmf-relay", 10 }; 
     2638        pjsip_msg_body *body = NULL; 
     2639        pj_bool_t dtmf_info = PJ_FALSE; 
     2640         
     2641        if (tsx->role == PJSIP_ROLE_UAC) { 
     2642            if (e->body.tsx_state.type == PJSIP_EVENT_TX_MSG) 
     2643                body = e->body.tsx_state.src.tdata->msg->body; 
     2644            else 
     2645                body = e->body.tsx_state.tsx->last_tx->msg->body; 
     2646        } else { 
     2647            if (e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) 
     2648                body = e->body.tsx_state.src.rdata->msg_info.msg->body; 
     2649        } 
     2650         
     2651        /* Check DTMF content in the INFO message */ 
     2652        if (body && body->len && 
     2653            pj_stricmp(&body->content_type.type, &STR_APPLICATION)==0 && 
     2654            pj_stricmp(&body->content_type.subtype, &STR_DTMF_RELAY)==0) 
     2655        { 
     2656            dtmf_info = PJ_TRUE; 
     2657        } 
     2658 
     2659        if (dtmf_info && tsx->role == PJSIP_ROLE_UAC &&  
    26372660            (tsx->state == PJSIP_TSX_STATE_COMPLETED || 
    26382661               (tsx->state == PJSIP_TSX_STATE_TERMINATED && 
     
    26522675                          tsx->status_text.ptr)); 
    26532676            } 
    2654         } else if (tsx->role == PJSIP_ROLE_UAS && 
     2677        } else if (dtmf_info && tsx->role == PJSIP_ROLE_UAS && 
    26552678                   tsx->state == PJSIP_TSX_STATE_TRYING) 
    26562679        { 
     
    28832906        if (vid_idx == -1 || call_info.media[vid_idx].dir == PJMEDIA_DIR_NONE) { 
    28842907            PJ_LOG(3,(THIS_FILE, 
    2885                       "Just rejected incoming video offer on call %d" 
    2886                       "use \"vid call add\" to enable video!", 
    2887                       call_id)); 
     2908                      "Just rejected incoming video offer on call %d, " 
     2909                      "use \"vid call enable %d\" or \"vid call add\" to enable video!", 
     2910                      call_id, vid_idx)); 
    28882911        } 
    28892912    } 
Note: See TracChangeset for help on using the changeset viewer.