Changeset 253
- Timestamp:
- Mar 1, 2006 7:29:10 PM (19 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 4 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/build/Makefile
r249 r253 75 75 76 76 77 ###############################################################################78 # Defines for building PJSUA79 #80 export PJSUA_SRCDIR = ../src/pjsua81 export PJSUA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \82 main.o83 export PJSUA_CFLAGS += $(_CFLAGS)84 export PJSUA_LDFLAGS += $(_LDFLAGS)85 export PJSUA_EXE:=../bin/pjsua-$(MACHINE_NAME)-$(OS_NAME)-$(CC_NAME)$(HOST_EXE)86 87 88 89 77 export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT 90 78 ############################################################################### … … 92 80 # 93 81 # 94 TARGETS := pjsip pjsip-ua pjsip-simple pjsua-lib pjsua82 TARGETS := pjsip pjsip-ua pjsip-simple pjsua-lib 95 83 96 84 .PHONY: $(TARGETS) … … 104 92 distclean: realclean 105 93 106 .PHONY: dep depend pjsip pjsip-ua pjsua-lib pjsuaclean realclean distclean94 .PHONY: dep depend pjsip pjsip-ua pjsua-lib clean realclean distclean 107 95 108 96 pjsip: … … 117 105 pjsua-lib: 118 106 $(MAKE) -f $(RULES_MAK) APP=PJSUA_LIB app=pjsua-lib $(PJSUA_LIB_LIB) 119 120 pjsua:121 $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(PJSUA_EXE)122 107 123 108 .PHONY: ../lib/pjsip.ko … … 141 126 $(MAKE) -f $(RULES_MAK) APP=PJSUA_LIB app=pjsua-lib $@ 142 127 143 .PHONY: ../lib/pjsua.ko144 ../lib/pjsua.ko:145 $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $@146 147 128 clean depend realclean: 148 129 $(MAKE) -f $(RULES_MAK) APP=PJSIP app=pjsip $@ … … 150 131 $(MAKE) -f $(RULES_MAK) APP=PJSIP_SIMPLE app=pjsip-simple $@ 151 132 $(MAKE) -f $(RULES_MAK) APP=PJSUA_LIB app=pjsua-lib $@ 152 $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $@153 @if test "$@" == "depend"; then \154 echo '$(PJSUA_EXE): $(PJSIP_LIB) $(PJSIP_UA_LIB) $(PJSIP_SIMPLE) $(PJSUA_LIB_LIB) $(PJLIB_LIB) $(PJLIB_UTIL_LIB) $(PJMEDIA_LIB) $(PJMEDIA_CODEC_LIB)' >> .pjsua-$(MACHINE_NAME)-$(OS_NAME)-$(CC_NAME).depend; \155 fi156 133 157 134 -
pjproject/trunk/pjsip/include/pjsip/sip_transaction.h
r230 r253 284 284 * Dump transaction layer. 285 285 */ 286 PJ_DECL(void) pjsip_tsx_layer_dump( void);286 PJ_DECL(void) pjsip_tsx_layer_dump(pj_bool_t detail); 287 287 288 288 /* -
pjproject/trunk/pjsip/include/pjsip/sip_ua_layer.h
r230 r253 75 75 /** 76 76 * Dump user agent contents (e.g. all dialogs). 77 * 78 * @param detail If non-zero, list of dialogs will be printed. 77 79 */ 78 PJ_DEF(void) pjsip_ua_dump( void);80 PJ_DEF(void) pjsip_ua_dump(pj_bool_t detail); 79 81 80 82 /** -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r238 r253 176 176 177 177 /* Media: */ 178 int start_rtp_port;/**< Start of RTP port to try. */ 178 179 pjmedia_endpt *med_endpt; /**< Media endpoint. */ 179 180 pjmedia_conf *mconf; /**< Media conference. */ -
pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
r248 r253 606 606 timeout.sec = timeout.msec = 0; 607 607 pj_timer_heap_poll( endpt->timer_heap, &timeout ); 608 609 /* timer_heap_poll should never ever returns negative value, or otherwise 610 * ioqueue_poll() will block forever! 611 */ 612 pj_assert(timeout.sec >= 0 && timeout.msec >= 0); 608 613 609 614 /* If caller specifies maximum time to wait, then compare the value with -
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r230 r253 762 762 * Dump transaction layer. 763 763 */ 764 PJ_DEF(void) pjsip_tsx_layer_dump( void)764 PJ_DEF(void) pjsip_tsx_layer_dump(pj_bool_t detail) 765 765 { 766 766 #if PJ_LOG_MAX_LEVEL >= 3 … … 771 771 772 772 PJ_LOG(3, (THIS_FILE, "Dumping transaction table:")); 773 774 it = pj_hash_first(mod_tsx_layer.htable, &itbuf); 775 if (it == NULL) { 776 PJ_LOG(3, (THIS_FILE, " - none - ")); 777 } else { 778 while (it != NULL) { 779 pjsip_transaction *tsx = pj_hash_this( mod_tsx_layer.htable, it); 780 781 PJ_LOG(3, (THIS_FILE, " %s %s|%d|%s", 782 tsx->obj_name, 783 (tsx->last_tx? pjsip_tx_data_get_info(tsx->last_tx): "none"), 784 tsx->status_code, 785 pjsip_tsx_state_str(tsx->state))); 786 787 it = pj_hash_next(mod_tsx_layer.htable, it); 773 PJ_LOG(3, (THIS_FILE, " Total %d transactions", 774 pj_hash_count(mod_tsx_layer.htable))); 775 776 if (detail) { 777 it = pj_hash_first(mod_tsx_layer.htable, &itbuf); 778 if (it == NULL) { 779 PJ_LOG(3, (THIS_FILE, " - none - ")); 780 } else { 781 while (it != NULL) { 782 pjsip_transaction *tsx = pj_hash_this(mod_tsx_layer.htable,it); 783 784 PJ_LOG(3, (THIS_FILE, " %s %s|%d|%s", 785 tsx->obj_name, 786 (tsx->last_tx? 787 pjsip_tx_data_get_info(tsx->last_tx): 788 "none"), 789 tsx->status_code, 790 pjsip_tsx_state_str(tsx->state))); 791 792 it = pj_hash_next(mod_tsx_layer.htable, it); 793 } 788 794 } 789 795 } -
pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c
r230 r253 778 778 * Dump user agent contents (e.g. all dialogs). 779 779 */ 780 PJ_DEF(void) pjsip_ua_dump( void)780 PJ_DEF(void) pjsip_ua_dump(pj_bool_t detail) 781 781 { 782 782 #if PJ_LOG_MAX_LEVEL >= 3 … … 786 786 pj_mutex_lock(mod_ua.mutex); 787 787 788 PJ_LOG(3, (THIS_FILE, "Number of dialog sets: %u", pj_hash_count(mod_ua.dlg_table))); 789 PJ_LOG(3, (THIS_FILE, "Dumping dialog sets:")); 790 791 it = pj_hash_first(mod_ua.dlg_table, &itbuf); 792 for (; it != NULL; it = pj_hash_next(mod_ua.dlg_table, it)) { 793 struct dlg_set *dlg_set; 794 pjsip_dialog *dlg; 795 const char *title; 796 797 dlg_set = pj_hash_this(mod_ua.dlg_table, it); 798 if (!dlg_set || pj_list_empty(&dlg_set->dlg_list)) continue; 799 800 /* First dialog in dialog set. */ 801 dlg = dlg_set->dlg_list.next; 802 if (dlg->role == PJSIP_ROLE_UAC) 803 title = " [out] "; 804 else 805 title = " [in] "; 806 807 print_dialog(title, dlg, dlginfo, sizeof(dlginfo)); 808 PJ_LOG(3,(THIS_FILE, "%s", dlginfo)); 809 810 /* Next dialog in dialog set (forked) */ 811 dlg = dlg->next; 812 while (dlg != (pjsip_dialog*) &dlg_set->dlg_list) { 813 print_dialog(" [forked] ", dlg, dlginfo, sizeof(dlginfo)); 788 PJ_LOG(3, (THIS_FILE, "Number of dialog sets: %u", 789 pj_hash_count(mod_ua.dlg_table))); 790 791 if (detail && pj_hash_count(mod_ua.dlg_table)) { 792 PJ_LOG(3, (THIS_FILE, "Dumping dialog sets:")); 793 it = pj_hash_first(mod_ua.dlg_table, &itbuf); 794 for (; it != NULL; it = pj_hash_next(mod_ua.dlg_table, it)) { 795 struct dlg_set *dlg_set; 796 pjsip_dialog *dlg; 797 const char *title; 798 799 dlg_set = pj_hash_this(mod_ua.dlg_table, it); 800 if (!dlg_set || pj_list_empty(&dlg_set->dlg_list)) continue; 801 802 /* First dialog in dialog set. */ 803 dlg = dlg_set->dlg_list.next; 804 if (dlg->role == PJSIP_ROLE_UAC) 805 title = " [out] "; 806 else 807 title = " [in] "; 808 809 print_dialog(title, dlg, dlginfo, sizeof(dlginfo)); 810 PJ_LOG(3,(THIS_FILE, "%s", dlginfo)); 811 812 /* Next dialog in dialog set (forked) */ 814 813 dlg = dlg->next; 814 while (dlg != (pjsip_dialog*) &dlg_set->dlg_list) { 815 print_dialog(" [forked] ", dlg, dlginfo, sizeof(dlginfo)); 816 dlg = dlg->next; 817 } 815 818 } 816 819 } -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r247 r253 59 59 60 60 61 /* Default we start RTP at port 4000 */ 62 pjsua.start_rtp_port = 4000; 63 64 61 65 /* Default logging settings: */ 62 66 pjsua.log_level = 5; … … 139 143 { 140 144 enum { 141 RTP_START_PORT = 4000,142 RTP_RANDOM_START = 2,143 145 RTP_RETRY = 100 144 146 }; … … 149 151 }; 150 152 int i; 151 static pj_uint16_t rtp_port = RTP_START_PORT;153 static pj_uint16_t rtp_port; 152 154 pj_sock_t sock[3]; 153 155 pj_sockaddr_in mapped_addr[3]; 154 156 pj_status_t status = PJ_SUCCESS; 157 158 if (rtp_port == 0) 159 rtp_port = (pj_uint16_t)pjsua.start_rtp_port; 155 160 156 161 for (i=0; i<3; ++i) -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_opt.c
r238 r253 83 83 puts(" --auto-loop Automatically loop incoming RTP to outgoing RTP"); 84 84 puts(" --auto-conf Automatically put incoming calls to conference"); 85 puts(" --rtp-port=N Base port to try for RTP"); 85 86 puts(""); 86 87 puts("Buddy List (can be more than one):"); … … 212 213 OPT_AUTO_ANSWER, OPT_AUTO_HANGUP, OPT_AUTO_PLAY, OPT_AUTO_LOOP, 213 214 OPT_AUTO_CONF, 214 OPT_PLAY_FILE, 215 OPT_PLAY_FILE, OPT_RTP_PORT, 215 216 OPT_NEXT_ACCOUNT, OPT_NEXT_CRED, OPT_MAX_CALLS, 216 217 }; … … 244 245 { "auto-conf", 0, 0, OPT_AUTO_CONF}, 245 246 { "play-file", 1, 0, OPT_PLAY_FILE}, 247 { "rtp-port", 1, 0, OPT_RTP_PORT}, 246 248 { "next-account",0,0, OPT_NEXT_ACCOUNT}, 247 249 { "next-cred", 0, 0, OPT_NEXT_CRED}, … … 463 465 break; 464 466 467 case OPT_RTP_PORT: 468 pjsua.start_rtp_port = my_atoi(optarg); 469 if (pjsua.start_rtp_port < 1 || pjsua.start_rtp_port > 65535) { 470 PJ_LOG(1,(THIS_FILE, 471 "Error: rtp-port argument value (expecting 1-65535")); 472 return -1; 473 } 474 465 475 case OPT_AUTO_ANSWER: 466 476 pjsua.auto_answer = my_atoi(optarg); 467 477 if (pjsua.auto_answer < 100 || pjsua.auto_answer > 699) { 468 puts("Error: invalid code in --auto-answer (expecting 100-699"); 478 PJ_LOG(1,(THIS_FILE, 479 "Error: invalid code in --auto-answer (expecting 100-699")); 469 480 return -1; 470 481 } … … 474 485 pjsua.max_calls = my_atoi(optarg); 475 486 if (pjsua.max_calls < 1 || pjsua.max_calls > 255) { 476 puts("Too many calls for max-calls (1-255)");487 PJ_LOG(1,(THIS_FILE,"Too many calls for max-calls (1-255)")); 477 488 return -1; 478 489 } … … 578 589 pjsip_endpt_dump(pjsua.endpt, 1); 579 590 pjmedia_endpt_dump(pjsua.med_endpt); 580 pjsip_tsx_layer_dump( );581 pjsip_ua_dump( );591 pjsip_tsx_layer_dump(1); 592 pjsip_ua_dump(1); 582 593 583 594 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_reg.c
r238 r253 87 87 void pjsua_regc_update(int acc_index, pj_bool_t renew) 88 88 { 89 pj_status_t status ;90 pjsip_tx_data *tdata ;89 pj_status_t status = 0; 90 pjsip_tx_data *tdata = 0; 91 91 92 92 if (renew) { … … 99 99 } 100 100 } 101 status = pjsip_regc_register(pjsua.acc[acc_index].regc, 1, &tdata); 101 if (!pjsua.acc[acc_index].regc) 102 return; 103 104 status = pjsip_regc_register(pjsua.acc[acc_index].regc, 1, 105 &tdata); 106 102 107 } else { 103 108 if (pjsua.acc[acc_index].regc == NULL) { … … 127 132 pj_status_t status; 128 133 134 if (pjsua.acc[acc_index].reg_uri.slen == 0) { 135 PJ_LOG(3,(THIS_FILE, "Registrar URI is not specified")); 136 return PJ_SUCCESS; 137 } 138 129 139 /* initialize SIP registration if registrar is configured */ 130 if (pjsua.acc[acc_index].reg_uri.slen) {131 140 132 133 134 135 141 status = pjsip_regc_create( pjsua.endpt, 142 &pjsua.acc[acc_index], 143 ®c_cb, 144 &pjsua.acc[acc_index].regc); 136 145 137 138 139 140 141 146 if (status != PJ_SUCCESS) { 147 pjsua_perror(THIS_FILE, "Unable to create client registration", 148 status); 149 return status; 150 } 142 151 143 152 144 145 146 147 148 149 150 151 152 153 154 155 153 status = pjsip_regc_init( pjsua.acc[acc_index].regc, 154 &pjsua.acc[acc_index].reg_uri, 155 &pjsua.acc[acc_index].local_uri, 156 &pjsua.acc[acc_index].local_uri, 157 1, &pjsua.acc[acc_index].contact_uri, 158 pjsua.acc[acc_index].reg_timeout); 159 if (status != PJ_SUCCESS) { 160 pjsua_perror(THIS_FILE, 161 "Client registration initialization error", 162 status); 163 return status; 164 } 156 165 157 158 159 166 pjsip_regc_set_credentials( pjsua.acc[acc_index].regc, 167 pjsua.cred_count, 168 pjsua.cred_info ); 160 169 161 pjsip_regc_set_route_set( pjsua.acc[acc_index].regc, 162 &pjsua.acc[acc_index].route_set ); 163 } 170 pjsip_regc_set_route_set( pjsua.acc[acc_index].regc, 171 &pjsua.acc[acc_index].route_set ); 164 172 165 173 return PJ_SUCCESS;
Note: See TracChangeset
for help on using the changeset viewer.