Changeset 2968 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
- Timestamp:
- Oct 26, 2009 11:21:37 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r2966 r2968 194 194 puts (" --password=string Set authentication password"); 195 195 puts (" --publish Send presence PUBLISH for this account"); 196 puts (" --mwi Subscribe to message summary/waiting indication"); 196 197 puts (" --use-100rel Require reliable provisional response (100rel)"); 197 198 puts (" --use-timer Require SIP session timers"); … … 484 485 OPT_BOUND_ADDR, OPT_CONTACT_PARAMS, OPT_CONTACT_URI_PARAMS, 485 486 OPT_100REL, OPT_USE_IMS, OPT_REALM, OPT_USERNAME, OPT_PASSWORD, 486 OPT_ NAMESERVER, OPT_STUN_SRV,487 OPT_MWI, OPT_NAMESERVER, OPT_STUN_SRV, 487 488 OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE, 488 489 OPT_AUTO_ANSWER, OPT_AUTO_PLAY, OPT_AUTO_PLAY_HANGUP, OPT_AUTO_LOOP, … … 536 537 { "reg-timeout",1, 0, OPT_REG_TIMEOUT}, 537 538 { "publish", 0, 0, OPT_PUBLISH}, 539 { "mwi", 0, 0, OPT_MWI}, 538 540 { "use-100rel", 0, 0, OPT_100REL}, 539 541 { "use-ims", 0, 0, OPT_USE_IMS}, … … 834 836 break; 835 837 838 case OPT_MWI: /* mwi */ 839 cur_acc->mwi_enabled = PJ_TRUE; 840 break; 841 836 842 case OPT_100REL: /** 100rel */ 837 843 cur_acc->require_100rel = PJ_TRUE; … … 1551 1557 } 1552 1558 1559 /* Publish */ 1560 if (acc_cfg->publish_enabled) 1561 pj_strcat2(result, "--publish\n"); 1562 1563 /* MWI */ 1564 if (acc_cfg->mwi_enabled) 1565 pj_strcat2(result, "--mwi\n"); 1553 1566 } 1554 1567 … … 2740 2753 PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); 2741 2754 } 2755 } 2756 2757 2758 /* 2759 * MWI indication 2760 */ 2761 static void on_mwi_info(pjsua_acc_id acc_id, pjsua_mwi_info *mwi_info) 2762 { 2763 pj_str_t body; 2764 2765 PJ_LOG(3,(THIS_FILE, "Received MWI for acc %d:", acc_id)); 2766 2767 if (mwi_info->rdata->msg_info.ctype) { 2768 const pjsip_ctype_hdr *ctype = mwi_info->rdata->msg_info.ctype; 2769 2770 PJ_LOG(3,(THIS_FILE, " Content-Type: %.*s/%.*s", 2771 (int)ctype->media.type.slen, 2772 ctype->media.type.ptr, 2773 (int)ctype->media.subtype.slen, 2774 ctype->media.subtype.ptr)); 2775 } 2776 2777 if (!mwi_info->rdata->msg_info.msg->body) { 2778 PJ_LOG(3,(THIS_FILE, " no message body")); 2779 return; 2780 } 2781 2782 body.ptr = mwi_info->rdata->msg_info.msg->body->data; 2783 body.slen = mwi_info->rdata->msg_info.msg->body->len; 2784 2785 PJ_LOG(3,(THIS_FILE, " Body:\n%.*s", (int)body.slen, body.ptr)); 2742 2786 } 2743 2787 … … 4338 4382 app_config.cfg.cb.on_call_replaced = &on_call_replaced; 4339 4383 app_config.cfg.cb.on_nat_detect = &on_nat_detect; 4384 app_config.cfg.cb.on_mwi_info = &on_mwi_info; 4340 4385 4341 4386 /* Set sound device latency */
Note: See TracChangeset
for help on using the changeset viewer.