- Timestamp:
- May 16, 2006 1:20:00 PM (19 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/build/Samples-vc.mak
r439 r448 36 36 37 37 38 SAMPLES = $(BINDIR)\simpleua.exe $(BINDIR)\playfile.exe $(BINDIR)\playsine.exe\ 39 $(BINDIR)\confsample.exe $(BINDIR)\sndinfo.exe \ 40 $(BINDIR)\level.exe $(BINDIR)\recfile.exe \ 41 $(BINDIR)\resampleplay.exe $(BINDIR)\siprtp.exe \ 38 SAMPLES = $(BINDIR)\confsample.exe \ 39 $(BINDIR)\level.exe \ 40 $(BINDIR)\playfile.exe \ 41 $(BINDIR)\playsine.exe\ 42 $(BINDIR)\recfile.exe \ 43 $(BINDIR)\resampleplay.exe \ 44 $(BINDIR)\simpleua.exe \ 45 $(BINDIR)\siprtp.exe \ 46 $(BINDIR)\sipstateless.exe \ 47 $(BINDIR)\sndinfo.exe \ 42 48 $(BINDIR)\streamutil.exe 43 49 -
pjproject/trunk/pjsip-apps/build/Samples.mak
r438 r448 39 39 BINDIR := ../bin/samples 40 40 41 SAMPLES := simpleua playfile playsine confsample sndinfo level recfile resampleplay \ 42 siprtp streamutil 41 SAMPLES := confsample \ 42 level \ 43 playfile \ 44 playsine \ 45 recfile \ 46 resampleplay \ 47 simpleua \ 48 siprtp \ 49 sipstateless \ 50 sndinfo \ 51 streamutil 43 52 44 53 EXES := $(foreach file, $(SAMPLES), $(BINDIR)/$(file)-$(TARGET)$(HOST_EXE)) -
pjproject/trunk/pjsip-apps/build/samples.dsp
r437 r448 123 123 # Begin Source File 124 124 125 SOURCE=..\src\samples\sipstateless.c 126 # End Source File 127 # Begin Source File 128 125 129 SOURCE=..\src\samples\sndinfo.c 126 130 # End Source File -
pjproject/trunk/pjsip-apps/src/samples/streamutil.c
r412 r448 75 75 pj_status_t status; 76 76 77 #if defined(PJMEDIA_HAS_G711_CODEC) && PJMEDIA_HAS_G711_CODEC!=0 77 78 status = pjmedia_codec_g711_init(med_endpt); 78 79 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 79 80 #endif 81 82 #if defined(PJMEDIA_HAS_GSM_CODEC) && PJMEDIA_HAS_GSM_CODEC!=0 80 83 status = pjmedia_codec_gsm_init(med_endpt); 81 84 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 82 85 #endif 86 87 #if defined(PJMEDIA_HAS_SPEEX_CODEC) && PJMEDIA_HAS_SPEEX_CODEC!=0 83 88 status = pjmedia_codec_speex_init(med_endpt, 0, -1, -1); 84 89 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 85 90 #endif 91 92 #if defined(PJMEDIA_HAS_L16_CODEC) && PJMEDIA_HAS_L16_CODEC!=0 86 93 status = pjmedia_codec_l16_init(med_endpt, 0); 87 94 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 95 #endif 88 96 89 97 return PJ_SUCCESS; -
pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
r368 r448 104 104 pj_status_t pjsip_tel_uri_subsys_init(void); 105 105 106 /* Defined in sip_util_statefull.c */107 extern pjsip_module mod_stateful_util;108 109 106 110 107 /* Specifies whether error subsystem has been registered to pjlib. */ … … 487 484 pj_list_init(&endpt->cap_hdr); 488 485 489 /* Register mod_stateful_util module (sip_util_statefull.c) */490 status = pjsip_endpt_register_module(endpt, &mod_stateful_util);491 if (status != PJ_SUCCESS)492 goto on_error;493 486 494 487 /* Done. */ -
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r315 r448 38 38 #define TSX_TRACE_(expr) 39 39 #endif 40 41 42 /* Defined in sip_util_statefull.c */ 43 extern pjsip_module mod_stateful_util; 40 44 41 45 … … 466 470 } 467 471 472 /* Register mod_stateful_util module (sip_util_statefull.c) */ 473 status = pjsip_endpt_register_module(endpt, &mod_stateful_util); 474 if (status != PJ_SUCCESS) { 475 return status; 476 } 477 468 478 return PJ_SUCCESS; 469 479 } -
pjproject/trunk/pjsip/src/pjsip/sip_util.c
r266 r448 1258 1258 1259 1259 /* 1260 * Send response statefully.1261 */1262 PJ_DEF(pj_status_t) pjsip_endpt_respond( pjsip_endpoint *endpt,1263 pjsip_module *tsx_user,1264 pjsip_rx_data *rdata,1265 int st_code,1266 const pj_str_t *st_text,1267 const pjsip_hdr *hdr_list,1268 const pjsip_msg_body *body,1269 pjsip_transaction **p_tsx )1270 {1271 pj_status_t status;1272 pjsip_tx_data *tdata;1273 pjsip_transaction *tsx;1274 1275 /* Validate arguments. */1276 PJ_ASSERT_RETURN(endpt && rdata, PJ_EINVAL);1277 1278 if (p_tsx) *p_tsx = NULL;1279 1280 /* Create response message */1281 status = pjsip_endpt_create_response( endpt, rdata, st_code, st_text,1282 &tdata);1283 if (status != PJ_SUCCESS)1284 return status;1285 1286 /* Add the message headers, if any */1287 if (hdr_list) {1288 const pjsip_hdr *hdr = hdr_list->next;1289 while (hdr != hdr_list) {1290 pjsip_msg_add_hdr( tdata->msg, pjsip_hdr_clone(tdata->pool, hdr) );1291 hdr = hdr->next;1292 }1293 }1294 1295 /* Add the message body, if any. */1296 if (body) {1297 tdata->msg->body = pjsip_msg_body_clone( tdata->pool, body );1298 if (tdata->msg->body == NULL) {1299 pjsip_tx_data_dec_ref(tdata);1300 return status;1301 }1302 }1303 1304 /* Create UAS transaction. */1305 status = pjsip_tsx_create_uas(tsx_user, rdata, &tsx);1306 if (status != PJ_SUCCESS) {1307 pjsip_tx_data_dec_ref(tdata);1308 return status;1309 }1310 1311 /* Feed the request to the transaction. */1312 pjsip_tsx_recv_msg(tsx, rdata);1313 1314 /* Send the message. */1315 status = pjsip_tsx_send_msg(tsx, tdata);1316 if (status != PJ_SUCCESS) {1317 pjsip_tx_data_dec_ref(tdata);1318 } else if (p_tsx) {1319 *p_tsx = tsx;1320 }1321 1322 return status;1323 }1324 1325 1326 /*1327 1260 * Get the event string from the event ID. 1328 1261 */ -
pjproject/trunk/pjsip/src/pjsip/sip_util_statefull.c
r230 r448 90 90 PJ_ASSERT_RETURN(endpt && tdata && (timeout==-1 || timeout>0), PJ_EINVAL); 91 91 92 /* Check that transaction layer module is registered to endpoint */ 93 PJ_ASSERT_RETURN(mod_stateful_util.id != -1, PJ_EINVALIDOP); 94 95 92 96 status = pjsip_tsx_create_uac(&mod_stateful_util, tdata, &tsx); 93 97 if (status != PJ_SUCCESS) { … … 106 110 } 107 111 112 113 /* 114 * Send response statefully. 115 */ 116 PJ_DEF(pj_status_t) pjsip_endpt_respond( pjsip_endpoint *endpt, 117 pjsip_module *tsx_user, 118 pjsip_rx_data *rdata, 119 int st_code, 120 const pj_str_t *st_text, 121 const pjsip_hdr *hdr_list, 122 const pjsip_msg_body *body, 123 pjsip_transaction **p_tsx ) 124 { 125 pj_status_t status; 126 pjsip_tx_data *tdata; 127 pjsip_transaction *tsx; 128 129 /* Validate arguments. */ 130 PJ_ASSERT_RETURN(endpt && rdata, PJ_EINVAL); 131 132 if (p_tsx) *p_tsx = NULL; 133 134 /* Create response message */ 135 status = pjsip_endpt_create_response( endpt, rdata, st_code, st_text, 136 &tdata); 137 if (status != PJ_SUCCESS) 138 return status; 139 140 /* Add the message headers, if any */ 141 if (hdr_list) { 142 const pjsip_hdr *hdr = hdr_list->next; 143 while (hdr != hdr_list) { 144 pjsip_msg_add_hdr( tdata->msg, pjsip_hdr_clone(tdata->pool, hdr) ); 145 hdr = hdr->next; 146 } 147 } 148 149 /* Add the message body, if any. */ 150 if (body) { 151 tdata->msg->body = pjsip_msg_body_clone( tdata->pool, body ); 152 if (tdata->msg->body == NULL) { 153 pjsip_tx_data_dec_ref(tdata); 154 return status; 155 } 156 } 157 158 /* Create UAS transaction. */ 159 status = pjsip_tsx_create_uas(tsx_user, rdata, &tsx); 160 if (status != PJ_SUCCESS) { 161 pjsip_tx_data_dec_ref(tdata); 162 return status; 163 } 164 165 /* Feed the request to the transaction. */ 166 pjsip_tsx_recv_msg(tsx, rdata); 167 168 /* Send the message. */ 169 status = pjsip_tsx_send_msg(tsx, tdata); 170 if (status != PJ_SUCCESS) { 171 pjsip_tx_data_dec_ref(tdata); 172 } else if (p_tsx) { 173 *p_tsx = tsx; 174 } 175 176 return status; 177 } 178 179
Note: See TracChangeset
for help on using the changeset viewer.