- Timestamp:
- Feb 23, 2006 1:49:28 PM (19 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/config.c
r218 r223 22 22 23 23 static const char *id = "config.c"; 24 const char *PJ_VERSION = "0.5.1. 1";24 const char *PJ_VERSION = "0.5.1.2"; 25 25 26 26 PJ_DEF(void) pj_dump_config(void) -
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r222 r223 54 54 pjmedia_port_op rx_setting; /**< Can we receive from this port */ 55 55 pjmedia_port_op tx_setting; /**< Can we transmit to this port */ 56 int listener_cnt; /**< Number of listeners. */ 56 57 pj_bool_t *listeners; /**< Array of listeners. */ 57 58 pjmedia_vad *vad; /**< VAD for this port. */ … … 468 469 src_port->listeners[sink_slot] = 1; 469 470 ++conf->connect_cnt; 471 ++src_port->listener_cnt; 470 472 471 473 if (conf->connect_cnt == 1) … … 506 508 src_port->listeners[sink_slot] = 0; 507 509 --conf->connect_cnt; 510 --src_port->listener_cnt; 508 511 509 512 PJ_LOG(4,(THIS_FILE,"Port %.*s stop transmitting to port %.*s", … … 557 560 if (conf_port->listeners[port] != 0) { 558 561 --conf->connect_cnt; 562 --conf_port->listener_cnt; 559 563 conf_port->listeners[port] = 0; 560 564 } … … 564 568 conf_port = conf->ports[port]; 565 569 for (i=0; i<conf->max_ports; ++i) { 566 if (conf_port->listeners[i]) 570 if (conf_port->listeners[i]) { 567 571 --conf->connect_cnt; 572 --conf_port->listener_cnt; 573 } 568 574 } 569 575 … … 694 700 695 701 /* Get frame from this port. 696 * If port has rx_buffer , then get the frame from the rx_buffer697 * instead.702 * If port has rx_buffer (e.g. sound port), then get the frame 703 * from the rx_buffer instead. 698 704 */ 699 if (i==0 /*conf_port->cur_rx_buf*/) {705 if (i==0) { 700 706 pj_int16_t *rx_buf; 701 707 702 if (conf_port->rx_read == conf_port->rx_write) 703 conf_port->rx_read = (conf_port->rx_write+RX_BUF_COUNT-RX_BUF_COUNT/2) % RX_BUF_COUNT; 708 if (conf_port->rx_read == conf_port->rx_write) { 709 conf_port->rx_read = 710 (conf_port->rx_write+RX_BUF_COUNT-RX_BUF_COUNT/2) % 711 RX_BUF_COUNT; 712 } 704 713 705 714 rx_buf = conf_port->rx_buf[conf_port->rx_read]; … … 708 717 } 709 718 conf_port->rx_read = (conf_port->rx_read+1) % RX_BUF_COUNT; 719 710 720 } else { 711 721 pjmedia_frame frame; … … 715 725 frame.size = size; 716 726 pjmedia_port_get_frame(conf_port->port, &frame); 727 728 if (frame.type == PJMEDIA_FRAME_TYPE_NONE) 729 continue; 717 730 } 718 731 719 732 /* Skip (after receiving the frame) if this port is muted. */ 720 733 if (conf_port->rx_setting == PJMEDIA_PORT_MUTE) 734 continue; 735 736 /* Also skip if this port doesn't have listeners. */ 737 if (conf_port->listener_cnt == 0) 721 738 continue; 722 739 … … 728 745 729 746 /* Skip if we don't have signal. */ 730 if (silence) {731 TRACE_(("sil:%d ", i));732 continue;733 }747 //if (silence) { 748 // TRACE_(("sil:%d ", i)); 749 // continue; 750 //} 734 751 735 752 /* Convert the buffer to unsigned value */ … … 743 760 unsigned k; 744 761 745 if ( conf_port->listeners[j]== 0)762 if (listener == 0) 746 763 continue; 747 764 … … 768 785 if (!conf_port) 769 786 continue; 787 788 if (conf_port->tx_setting == PJMEDIA_PORT_MUTE) { 789 frame.type = PJMEDIA_FRAME_TYPE_NONE; 790 frame.buf = NULL; 791 frame.size = 0; 792 793 if (conf_port->port) 794 pjmedia_port_put_frame(conf_port->port, &frame); 795 796 continue; 797 798 } else if (conf_port->tx_setting != PJMEDIA_PORT_ENABLE) { 799 continue; 800 } 770 801 771 802 // … … 780 811 conf_port->tx_buf2 : conf_port->tx_buf1); 781 812 782 if (!conf_port->sources) { 783 for (j=0; j<conf->samples_per_frame; ++j) 784 target_buf[j] = 0; 785 } else { 813 if (conf_port->sources) { 786 814 for (j=0; j<conf->samples_per_frame; ++j) { 787 815 target_buf[j] = unsigned2pcm(conf_port->sum_buf[j] / conf_port->sources); … … 792 820 conf_port->cur_tx_buf = target_buf; 793 821 794 if (conf_port->tx_setting != PJMEDIA_PORT_ENABLE)795 continue;796 797 822 pj_memset(&frame, 0, sizeof(frame)); 798 frame.type = PJMEDIA_FRAME_TYPE_AUDIO; 823 if (conf_port->sources) 824 frame.type = PJMEDIA_FRAME_TYPE_AUDIO; 825 else 826 frame.type = PJMEDIA_FRAME_TYPE_NONE; 827 799 828 frame.buf = conf_port->cur_tx_buf; 800 829 frame.size = conf->samples_per_frame * conf->bits_per_sample / 8; -
pjproject/trunk/pjmedia/src/pjmedia/rtp.c
r208 r223 93 93 ses, pt, m, payload_len, ts_len)); 94 94 95 /* Update timestamp */ 96 ses->out_hdr.ts = pj_htonl(pj_ntohl(ses->out_hdr.ts)+ts_len); 97 98 /* If payload_len is zero, bail out. 99 * This is a clock frame; we're not really transmitting anything. 100 */ 101 if (payload_len == 0) 102 return PJ_SUCCESS; 103 95 104 /* Update session. */ 96 105 ses->out_extseq++; 97 ses->out_hdr.ts = pj_htonl(pj_ntohl(ses->out_hdr.ts)+ts_len);98 106 99 107 /* Create outgoing header. */ -
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r215 r223 279 279 &rtphdrlen); 280 280 281 } else {281 } else if (frame->type != PJMEDIA_FRAME_TYPE_NONE) { 282 282 unsigned max_size; 283 283 … … 297 297 (const void**)&rtphdr, 298 298 &rtphdrlen); 299 } else { 300 301 /* Just update RTP session's timestamp. */ 302 status = pjmedia_rtp_encode_rtp( &channel->rtp, 303 0, 0, 304 0, ts_len, 305 (const void**)&rtphdr, 306 &rtphdrlen); 307 return PJ_SUCCESS; 308 299 309 } 300 310 -
pjproject/trunk/pjsip/include/pjsip-ua/sip_inv.h
r212 r223 349 349 pjsip_tx_data **p_tdata ); 350 350 351 352 /** 353 * Create the initial response message for the incoming INVITE request in 354 * rdata with status code st_code and optional status text st_text. Use 355 * #pjsip_answer() to create subsequent response message. 356 */ 357 PJ_DECL(pj_status_t) pjsip_inv_initial_answer( pjsip_inv_session *inv, 358 pjsip_rx_data *rdata, 359 int st_code, 360 const pj_str_t *st_text, 361 const pjmedia_sdp_session *sdp, 362 pjsip_tx_data **p_tdata); 351 363 352 364 /** -
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r220 r223 880 880 PJ_EINVALIDOP); 881 881 882 /* Lock dialog. */ 883 pjsip_dlg_inc_lock(inv->dlg); 884 882 885 /* Create the INVITE request. */ 883 886 status = pjsip_dlg_create_request(inv->dlg, &pjsip_invite_method, -1, 884 887 &tdata); 885 888 if (status != PJ_SUCCESS) 886 return status; 889 goto on_return; 890 887 891 888 892 /* If this is the first INVITE, then copy the headers from inv_hdr. … … 921 925 status = pjmedia_sdp_neg_get_neg_local(inv->neg, &offer); 922 926 if (status != PJ_SUCCESS) 923 return status;927 goto on_return; 924 928 925 929 tdata->msg->body = create_sdp_body(tdata->pool, offer); … … 946 950 *p_tdata = tdata; 947 951 948 return PJ_SUCCESS; 952 953 on_return: 954 pjsip_dlg_dec_lock(inv->dlg); 955 return status; 949 956 } 950 957 … … 1105 1112 static pj_status_t process_answer( pjsip_inv_session *inv, 1106 1113 int st_code, 1107 pjsip_tx_data *tdata ) 1114 pjsip_tx_data *tdata, 1115 const pjmedia_sdp_session *local_sdp) 1108 1116 { 1109 1117 pj_status_t status; 1110 1118 pjmedia_sdp_session *sdp = NULL; 1111 1112 /* Include SDP for 18x and 2xx response.1113 * Also if SDP negotiator is ready, start negotiation.1114 */1115 if (st_code/10 == 18 || st_code/10 == 20) {1116 1117 pjmedia_sdp_neg_state neg_state;1118 1119 neg_state = inv->neg ? pjmedia_sdp_neg_get_state(inv->neg) :1120 PJMEDIA_SDP_NEG_STATE_NULL;1121 1122 if (neg_state == PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER) {1123 1124 status = pjmedia_sdp_neg_get_neg_local(inv->neg, &sdp);1125 1126 } else if (neg_state == PJMEDIA_SDP_NEG_STATE_WAIT_NEGO &&1127 pjmedia_sdp_neg_has_local_answer(inv->neg) )1128 {1129 1130 status = inv_negotiate_sdp(inv);1131 if (status != PJ_SUCCESS)1132 return status;1133 1134 status = pjmedia_sdp_neg_get_active_local(inv->neg, &sdp);1135 }1136 1137 }1138 1139 1140 1141 /* Include SDP when it's available.1142 * Subsequent response will include this SDP.1143 */1144 if (sdp) {1145 tdata->msg->body = create_sdp_body(tdata->pool, sdp);1146 }1147 1148 /* Remove message body if this is a non-2xx final response */1149 if (st_code >= 300)1150 tdata->msg->body = NULL;1151 1152 1153 return PJ_SUCCESS;1154 }1155 1156 1157 /*1158 * Answer initial INVITE1159 * Re-INVITE will be answered automatically, and will not use this function.1160 */1161 PJ_DEF(pj_status_t) pjsip_inv_answer( pjsip_inv_session *inv,1162 int st_code,1163 const pj_str_t *st_text,1164 const pjmedia_sdp_session *local_sdp,1165 pjsip_tx_data **p_tdata )1166 {1167 pjsip_tx_data *last_res;1168 pj_status_t status;1169 1170 /* Verify arguments. */1171 PJ_ASSERT_RETURN(inv && p_tdata, PJ_EINVAL);1172 1173 /* Must have INVITE transaction. */1174 PJ_ASSERT_RETURN(inv->invite_tsx, PJ_EBUG);1175 1176 /* INVITE transaction MUST have transmitted a response (e.g. 100) */1177 PJ_ASSERT_RETURN(inv->invite_tsx->last_tx, PJ_EINVALIDOP);1178 1119 1179 1120 /* If local_sdp is specified, then we MUST NOT have answered the … … 1199 1140 if (status != PJ_SUCCESS) 1200 1141 return status; 1201 } 1202 1203 1204 1142 1143 } 1144 1145 1146 /* If SDP negotiator is ready, start negotiation. */ 1147 if (st_code/100==2 || (st_code/10==18 && st_code!=180)) { 1148 1149 pjmedia_sdp_neg_state neg_state; 1150 1151 /* Start nego when appropriate. */ 1152 neg_state = inv->neg ? pjmedia_sdp_neg_get_state(inv->neg) : 1153 PJMEDIA_SDP_NEG_STATE_NULL; 1154 1155 if (neg_state == PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER) { 1156 1157 status = pjmedia_sdp_neg_get_neg_local(inv->neg, &sdp); 1158 1159 } else if (neg_state == PJMEDIA_SDP_NEG_STATE_WAIT_NEGO && 1160 pjmedia_sdp_neg_has_local_answer(inv->neg) ) 1161 { 1162 1163 status = inv_negotiate_sdp(inv); 1164 if (status != PJ_SUCCESS) 1165 return status; 1166 1167 status = pjmedia_sdp_neg_get_active_local(inv->neg, &sdp); 1168 } 1169 } 1170 1171 /* Include SDP when it's available for 2xx and 18x (but not 180) response. 1172 * Subsequent response will include this SDP. 1173 */ 1174 if (sdp) { 1175 tdata->msg->body = create_sdp_body(tdata->pool, sdp); 1176 } 1177 1178 1179 return PJ_SUCCESS; 1180 } 1181 1182 1183 /* 1184 * Create first response to INVITE 1185 */ 1186 PJ_DEF(pj_status_t) pjsip_inv_initial_answer( pjsip_inv_session *inv, 1187 pjsip_rx_data *rdata, 1188 int st_code, 1189 const pj_str_t *st_text, 1190 const pjmedia_sdp_session *sdp, 1191 pjsip_tx_data **p_tdata) 1192 { 1193 pjsip_tx_data *tdata; 1194 pj_status_t status; 1195 1196 /* Verify arguments. */ 1197 PJ_ASSERT_RETURN(inv && p_tdata, PJ_EINVAL); 1198 1199 /* Must have INVITE transaction. */ 1200 PJ_ASSERT_RETURN(inv->invite_tsx, PJ_EBUG); 1201 1202 pjsip_dlg_inc_lock(inv->dlg); 1203 1204 /* Create response */ 1205 status = pjsip_dlg_create_response(inv->dlg, rdata, st_code, st_text, 1206 &tdata); 1207 if (status != PJ_SUCCESS) 1208 goto on_return; 1209 1210 /* Process SDP in answer */ 1211 status = process_answer(inv, st_code, tdata, sdp); 1212 if (status != PJ_SUCCESS) { 1213 pjsip_tx_data_dec_ref(tdata); 1214 goto on_return; 1215 } 1216 1217 *p_tdata = tdata; 1218 1219 on_return: 1220 pjsip_dlg_dec_lock(inv->dlg); 1221 return status; 1222 } 1223 1224 1225 /* 1226 * Answer initial INVITE 1227 * Re-INVITE will be answered automatically, and will not use this function. 1228 */ 1229 PJ_DEF(pj_status_t) pjsip_inv_answer( pjsip_inv_session *inv, 1230 int st_code, 1231 const pj_str_t *st_text, 1232 const pjmedia_sdp_session *local_sdp, 1233 pjsip_tx_data **p_tdata ) 1234 { 1235 pjsip_tx_data *last_res; 1236 pj_status_t status; 1237 1238 /* Verify arguments. */ 1239 PJ_ASSERT_RETURN(inv && p_tdata, PJ_EINVAL); 1240 1241 /* Must have INVITE transaction. */ 1242 PJ_ASSERT_RETURN(inv->invite_tsx, PJ_EBUG); 1243 1244 /* INVITE transaction MUST have transmitted a response (e.g. 100) */ 1245 PJ_ASSERT_RETURN(inv->invite_tsx->last_tx, PJ_EINVALIDOP); 1246 1247 pjsip_dlg_inc_lock(inv->dlg); 1205 1248 1206 1249 /* Modify last response. */ … … 1208 1251 status = pjsip_dlg_modify_response(inv->dlg, last_res, st_code, st_text); 1209 1252 if (status != PJ_SUCCESS) 1210 return status;1253 goto on_return; 1211 1254 1212 1255 1213 1256 /* Process SDP in answer */ 1214 status = process_answer(inv, st_code, last_res); 1215 if (status != PJ_SUCCESS) 1216 return status; 1257 status = process_answer(inv, st_code, last_res, local_sdp); 1258 if (status != PJ_SUCCESS) { 1259 pjsip_tx_data_dec_ref(last_res); 1260 goto on_return; 1261 } 1217 1262 1218 1263 1219 1264 *p_tdata = last_res; 1220 1265 1221 return PJ_SUCCESS; 1266 on_return: 1267 pjsip_dlg_dec_lock(inv->dlg); 1268 return status; 1222 1269 } 1223 1270 … … 1467 1514 * request. 1468 1515 */ 1469 PJ_ASSERT_RETURN((cseq=pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL)) != NULL &&1470 (cseq->cseq == inv->invite_tsx->cseq),1516 PJ_ASSERT_RETURN((cseq=pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL))!=NULL 1517 && (cseq->cseq == inv->invite_tsx->cseq), 1471 1518 PJ_EINVALIDOP); 1472 1519 … … 1625 1672 if (tsx->method.id == PJSIP_INVITE_METHOD) { 1626 1673 1674 /* Keep the initial INVITE transaction. */ 1675 if (inv->invite_tsx == NULL) 1676 inv->invite_tsx = tsx; 1677 1627 1678 if (dlg->role == PJSIP_ROLE_UAC) { 1628 1629 /* Keep the initial INVITE transaction. */1630 if (inv->invite_tsx == NULL)1631 inv->invite_tsx = tsx;1632 1679 1633 1680 switch (tsx->state) { … … 1636 1683 break; 1637 1684 default: 1638 pj_assert(!"Unexpected state");1685 inv_on_state_calling(inv, e); 1639 1686 break; 1640 1687 } … … 1651 1698 break; 1652 1699 default: 1653 pj_assert(!"Unexpected state"); 1700 inv_on_state_incoming(inv, e); 1701 break; 1654 1702 } 1655 1703 } … … 1675 1723 1676 1724 switch (tsx->state) { 1725 1726 case PJSIP_TSX_STATE_CALLING: 1727 inv_set_state(inv, PJSIP_INV_STATE_CALLING, e); 1728 break; 1677 1729 1678 1730 case PJSIP_TSX_STATE_PROCEEDING: … … 1807 1859 switch (tsx->state) { 1808 1860 1861 case PJSIP_TSX_STATE_TRYING: 1862 inv_set_state(inv, PJSIP_INV_STATE_INCOMING, e); 1863 break; 1864 1809 1865 case PJSIP_TSX_STATE_PROCEEDING: 1810 1866 /* … … 2130 2186 2131 2187 /* Process SDP in the answer */ 2132 status = process_answer(inv, 200, tdata );2188 status = process_answer(inv, 200, tdata, NULL); 2133 2189 if (status != PJ_SUCCESS) 2134 2190 return; -
pjproject/trunk/pjsip/src/pjsua/pjsua.h
r222 r223 122 122 unsigned wav_slot; /**< WAV player slot in bridge */ 123 123 124 /* User Agent behaviour: */ 125 126 int auto_answer; /**< Automatically answer in calls. */ 127 124 128 125 129 /* Since we support simultaneous calls, we need to have multiple … … 179 183 180 184 181 /* Misc: */185 /* Logging: */ 182 186 183 187 int log_level; /**< Logging verbosity. */ -
pjproject/trunk/pjsip/src/pjsua/pjsua_inv.c
r220 r223 279 279 280 280 281 /* Answer with 100 (using the dialog, not invite): */ 282 283 status = pjsip_dlg_create_response(dlg, rdata, 100, NULL, &response); 281 /* Must answer with some response to initial INVITE. 282 * If auto-answer flag is set, send 200 straight away, otherwise send 100. 283 */ 284 285 status = pjsip_inv_initial_answer(inv, rdata, 286 (pjsua.auto_answer ? 200 : 100), 287 NULL, NULL, &response); 284 288 if (status != PJ_SUCCESS) { 285 289 … … 294 298 295 299 } else { 296 status = pjsip_dlg_send_response(dlg, pjsip_rdata_get_tsx(rdata), 297 response); 300 status = pjsip_inv_send_msg(inv, response, NULL); 298 301 if (status != PJ_SUCCESS) 299 302 pjsua_perror(THIS_FILE, "Unable to send 100 response", status); 300 303 } 301 304 302 PJ_LOG(3,(THIS_FILE, 303 "\nIncoming call!!\n" 304 "From: %.*s\n" 305 "To: %.*s\n" 306 "(press 'a' to answer, 'h' to decline)", 307 (int)dlg->remote.info_str.slen, 308 dlg->remote.info_str.ptr, 309 (int)dlg->local.info_str.slen, 310 dlg->local.info_str.ptr)); 305 if (pjsua.auto_answer < 200) { 306 PJ_LOG(3,(THIS_FILE, 307 "\nIncoming call!!\n" 308 "From: %.*s\n" 309 "To: %.*s\n" 310 "(press 'a' to answer, 'h' to decline)", 311 (int)dlg->remote.info_str.slen, 312 dlg->remote.info_str.ptr, 313 (int)dlg->local.info_str.slen, 314 dlg->local.info_str.ptr)); 315 } else { 316 PJ_LOG(3,(THIS_FILE, 317 "Call From:%.*s To:%.*s was answered with %d (%s)", 318 (int)dlg->remote.info_str.slen, 319 dlg->remote.info_str.ptr, 320 (int)dlg->local.info_str.slen, 321 dlg->local.info_str.ptr, 322 pjsua.auto_answer, 323 pjsip_get_status_text(pjsua.auto_answer)->ptr )); 324 } 325 311 326 /* This INVITE request has been handled. */ 312 327 return PJ_TRUE; … … 767 782 } 768 783 769 /* Connect new call to the sound device port (port zero) in the 770 * main conference bridge. 771 */ 772 pjmedia_conf_connect_port( pjsua.mconf, 0, inv_data->conf_slot); 773 pjmedia_conf_connect_port( pjsua.mconf, inv_data->conf_slot, 0); 784 /* If auto-play is configured, connect the call to the file player 785 * port 786 */ 787 if (pjsua.wav_file && inv->role == PJSIP_ROLE_UAS) { 788 789 pjmedia_conf_connect_port( pjsua.mconf, pjsua.wav_slot, 790 inv_data->conf_slot); 791 792 } else { 793 794 /* Connect new call to the sound device port (port zero) in the 795 * main conference bridge. 796 */ 797 pjmedia_conf_connect_port( pjsua.mconf, 0, inv_data->conf_slot); 798 pjmedia_conf_connect_port( pjsua.mconf, inv_data->conf_slot, 0); 799 } 800 774 801 775 802 /* Done. */ -
pjproject/trunk/pjsip/src/pjsua/pjsua_opt.c
r222 r223 42 42 { 43 43 puts("Usage:"); 44 puts(" pjsua [options] [sip-url]");44 puts(" pjsua [options]"); 45 45 puts(""); 46 46 puts(" [sip-url] Default URL to invite."); 47 47 puts(""); 48 48 puts("General options:"); 49 puts(" --help Display this help screen"); 50 puts(" --version Display version info"); 51 puts(""); 52 puts("Logging options:"); 49 53 puts(" --config-file=file Read the config/arguments from file."); 50 54 puts(" --log-file=fname Log to filename (default stderr)"); 51 55 puts(" --log-level=N Set log max level to N (0(none) to 6(trace))"); 52 56 puts(" --app-log-level=N Set log max level for stdout display to N"); 53 puts(" --help Display this help screen");54 puts(" --version Display version info");55 puts("");56 puts("Media options:");57 puts(" --null-audio Use NULL audio device");58 puts(" --wav-file=file Play WAV file in conference bridge");59 puts("");60 //puts("");61 //puts("User Agent options:");62 //puts(" --auto-answer=sec Auto-answer all incoming calls after sec seconds.");63 //puts(" --auto-hangup=sec Auto-hangup all calls after sec seconds.");64 puts("");65 puts("SIP options:");66 puts(" --local-port=port Set TCP/UDP port");67 puts(" --id=url Set the URL of local ID (used in From header)");68 puts(" --contact=url Override the Contact information");69 puts(" --proxy=url Set the URL of proxy server");70 puts(" --outbound=url Set the URL of outbound proxy server");71 puts(" --registrar=url Set the URL of registrar server");72 puts(" --reg-timeout=secs Set registration interval to secs (default 3600)");73 57 puts(""); 74 58 puts("Authentication options:"); … … 77 61 puts(" --password=string Set authentication password"); 78 62 puts(""); 79 puts("STUN options (all must be specified):"); 63 puts("SIP options:"); 64 puts(" --id=url Set the URL of local ID (used in From header)"); 65 puts(" --contact=url Override the Contact information"); 66 puts(" --proxy=url Set the URL of proxy server"); 67 //puts(" --outbound=url Set the URL of outbound proxy server"); 68 puts(""); 69 puts("Registration Options:"); 70 puts(" --registrar=url Set the URL of registrar server"); 71 puts(" --reg-timeout=secs Set registration interval to secs (default 3600)"); 72 puts(""); 73 puts("Transport Options:"); 74 puts(" --local-port=port Set TCP/UDP port"); 80 75 puts(" --use-stun1=host[:port]"); 81 76 puts(" --use-stun2=host[:port] Use STUN and set host name and port of STUN servers"); 82 77 puts(""); 83 puts("SIMPLE options (may be specified more than once):"); 78 puts("Media Options:"); 79 puts(" --null-audio Use NULL audio device"); 80 //puts(" --wav-file=file Play WAV file in conference bridge"); 81 puts(""); 82 puts("Buddy List (can be more than one):"); 84 83 puts(" --add-buddy url Add the specified URL to the buddy list."); 85 //puts(" --offer-x-ms-msg Offer \"x-ms-message\" in outgoing INVITE"); 86 //puts(" --no-presence Do not subscribe presence of buddies"); 84 puts(""); 85 puts("User Agent options:"); 86 puts(" --auto-answer=code Automatically answer incoming calls with code (e.g. 200)"); 87 puts(" --auto-play=file Automatically play WAVE file to incoming calls"); 87 88 puts(""); 88 89 fflush(stdout); … … 199 200 OPT_USE_STUN1, OPT_USE_STUN2, 200 201 OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE, 201 OPT_AUTO_ANSWER, OPT_AUTO_HANGUP, OPT_ WAV_FILE};202 OPT_AUTO_ANSWER, OPT_AUTO_HANGUP, OPT_AUTO_PLAY}; 202 203 struct option long_options[] = { 203 204 { "config-file",1, 0, OPT_CONFIG_FILE}, … … 225 226 { "auto-answer",1, 0, OPT_AUTO_ANSWER}, 226 227 { "auto-hangup",1, 0, OPT_AUTO_HANGUP}, 227 { " wav-file", 1, 0, OPT_WAV_FILE},228 { "auto-play", 1, 0, OPT_AUTO_PLAY}, 228 229 { NULL, 0, 0, 0} 229 230 }; … … 410 411 break; 411 412 412 case OPT_ WAV_FILE:413 case OPT_AUTO_PLAY: 413 414 pjsua.wav_file = optarg; 415 break; 416 417 case OPT_AUTO_ANSWER: 418 pjsua.auto_answer = atoi(optarg); 419 if (pjsua.auto_answer < 100 || pjsua.auto_answer > 699) { 420 puts("Error: invalid code in --auto-answer (expecting 100-699"); 421 return -1; 422 } 414 423 break; 415 424 }
Note: See TracChangeset
for help on using the changeset viewer.