- Timestamp:
- May 14, 2007 4:37:47 PM (18 years ago)
- Location:
- pjproject/branches/pjproject-0.5-stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/pjproject-0.5-stable/pjsip-apps/src/pjsua/pjsua_app.c
r1223 r1271 1741 1741 PJ_UNUSED_ARG(mime_type); 1742 1742 1743 PJ_LOG(3,(THIS_FILE,"MESSAGE from %.*s: %.*s ",1743 PJ_LOG(3,(THIS_FILE,"MESSAGE from %.*s: %.*s (%.*s)", 1744 1744 (int)from->slen, from->ptr, 1745 (int)text->slen, text->ptr)); 1745 (int)text->slen, text->ptr, 1746 (int)mime_type->slen, mime_type->ptr)); 1746 1747 } 1747 1748 -
pjproject/branches/pjproject-0.5-stable/pjsip/src/pjsua-lib/pjsua_im.c
r1147 r1271 73 73 74 74 /* Check if content type is acceptable */ 75 #if 0 75 76 static pj_bool_t acceptable_message(const pjsip_media_type *mime) 76 77 { … … 81 82 pj_stricmp(&mime->subtype, &STR_MIME_ISCOMPOSING)==0); 82 83 } 83 84 #endif 84 85 85 86 /** … … 105 106 pjsip_accept_hdr **p_accept_hdr) 106 107 { 108 /* Some UA sends text/html, so this check will break */ 109 #if 0 107 110 pjsip_ctype_hdr *ctype; 108 111 pjsip_msg *msg; … … 123 126 return PJ_FALSE; 124 127 } 128 #else 129 PJ_UNUSED_ARG(rdata); 130 PJ_UNUSED_ARG(p_accept_hdr); 131 #endif 125 132 126 133 return PJ_TRUE; … … 155 162 } 156 163 157 158 if (pj_stricmp(&body->content_type.type, &STR_MIME_TEXT)==0 && 159 pj_stricmp(&body->content_type.subtype, &STR_MIME_PLAIN)==0) 164 if (pj_stricmp(&body->content_type.type, &STR_MIME_APP)==0 && 165 pj_stricmp(&body->content_type.subtype, &STR_MIME_ISCOMPOSING)==0) 160 166 { 161 const pj_str_t mime_text_plain = pj_str("text/plain");162 pj_str_t text_body;163 164 /* Save text body */165 text_body.ptr = rdata->msg_info.msg->body->data;166 text_body.slen = rdata->msg_info.msg->body->len;167 168 if (pjsua_var.ua_cfg.cb.on_pager) {169 (*pjsua_var.ua_cfg.cb.on_pager)(call_id, from, to, &contact,170 &mime_text_plain, &text_body);171 }172 173 } else {174 167 /* Expecting typing indication */ 175 168 pj_status_t status; … … 188 181 is_typing); 189 182 } 183 184 } else { 185 pj_str_t mime_type; 186 char buf[256]; 187 pjsip_media_type *m; 188 pj_str_t text_body; 189 190 /* Save text body */ 191 text_body.ptr = rdata->msg_info.msg->body->data; 192 text_body.slen = rdata->msg_info.msg->body->len; 193 194 /* Get mime type */ 195 m = &rdata->msg_info.msg->body->content_type; 196 mime_type.ptr = buf; 197 mime_type.slen = pj_ansi_snprintf(buf, sizeof(buf), 198 "%.*s/%.*s", 199 (int)m->type.slen, 200 m->type.ptr, 201 (int)m->subtype.slen, 202 m->subtype.ptr); 203 if (mime_type.slen < 1) 204 mime_type.slen = 0; 205 206 if (pjsua_var.ua_cfg.cb.on_pager) { 207 (*pjsua_var.ua_cfg.cb.on_pager)(call_id, from, to, &contact, 208 &mime_type, &text_body); 209 } 190 210 } 191 211 … … 200 220 pj_str_t from, to; 201 221 pjsip_accept_hdr *accept_hdr; 202 pjsip_contact_hdr *contact_hdr;203 222 pjsip_msg *msg; 204 223 pj_status_t status; … … 242 261 */ 243 262 from.ptr = pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE); 244 contact_hdr = pjsip_msg_find_hdr(rdata->msg_info.msg, 245 PJSIP_H_CONTACT, NULL); 246 if (contact_hdr) { 247 from.slen = pjsip_uri_print(PJSIP_URI_IN_CONTACT_HDR, 248 contact_hdr->uri, 249 from.ptr, PJSIP_MAX_URL_SIZE); 250 } else { 251 from.slen = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, 252 rdata->msg_info.from->uri, 253 from.ptr, PJSIP_MAX_URL_SIZE); 254 } 263 from.slen = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, 264 rdata->msg_info.from->uri, 265 from.ptr, PJSIP_MAX_URL_SIZE); 255 266 256 267 if (from.slen < 1)
Note: See TracChangeset
for help on using the changeset viewer.