Changeset 253


Ignore:
Timestamp:
Mar 1, 2006 7:29:10 PM (18 years ago)
Author:
bennylp
Message:

Moved pjsua to pjsip-apps

Location:
pjproject/trunk/pjsip
Files:
4 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/build/Makefile

    r249 r253  
    7575 
    7676 
    77 ############################################################################### 
    78 # Defines for building PJSUA 
    79 # 
    80 export PJSUA_SRCDIR = ../src/pjsua 
    81 export PJSUA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ 
    82                         main.o  
    83 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  
    8977export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT  
    9078############################################################################### 
     
    9280# 
    9381# 
    94 TARGETS := pjsip pjsip-ua pjsip-simple pjsua-lib pjsua 
     82TARGETS := pjsip pjsip-ua pjsip-simple pjsua-lib 
    9583 
    9684.PHONY: $(TARGETS) 
     
    10492distclean: realclean 
    10593 
    106 .PHONY: dep depend pjsip pjsip-ua pjsua-lib pjsua clean realclean distclean 
     94.PHONY: dep depend pjsip pjsip-ua pjsua-lib clean realclean distclean 
    10795 
    10896pjsip: 
     
    117105pjsua-lib:  
    118106        $(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) 
    122107 
    123108.PHONY: ../lib/pjsip.ko 
     
    141126        $(MAKE) -f $(RULES_MAK) APP=PJSUA_LIB app=pjsua-lib $@ 
    142127 
    143 .PHONY: ../lib/pjsua.ko 
    144 ../lib/pjsua.ko: 
    145         $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $@ 
    146  
    147128clean depend realclean: 
    148129        $(MAKE) -f $(RULES_MAK) APP=PJSIP app=pjsip $@ 
     
    150131        $(MAKE) -f $(RULES_MAK) APP=PJSIP_SIMPLE app=pjsip-simple $@ 
    151132        $(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         fi 
    156133 
    157134 
  • pjproject/trunk/pjsip/include/pjsip/sip_transaction.h

    r230 r253  
    284284 * Dump transaction layer. 
    285285 */ 
    286 PJ_DECL(void) pjsip_tsx_layer_dump(void); 
     286PJ_DECL(void) pjsip_tsx_layer_dump(pj_bool_t detail); 
    287287 
    288288/* 
  • pjproject/trunk/pjsip/include/pjsip/sip_ua_layer.h

    r230 r253  
    7575/** 
    7676 * Dump user agent contents (e.g. all dialogs). 
     77 * 
     78 * @param detail        If non-zero, list of dialogs will be printed. 
    7779 */ 
    78 PJ_DEF(void) pjsip_ua_dump(void); 
     80PJ_DEF(void) pjsip_ua_dump(pj_bool_t detail); 
    7981 
    8082/** 
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r238 r253  
    176176 
    177177    /* Media:  */ 
     178    int              start_rtp_port;/**< Start of RTP port to try.      */ 
    178179    pjmedia_endpt   *med_endpt;     /**< Media endpoint.                */ 
    179180    pjmedia_conf    *mconf;         /**< Media conference.              */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c

    r248 r253  
    606606    timeout.sec = timeout.msec = 0; 
    607607    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); 
    608613 
    609614    /* If caller specifies maximum time to wait, then compare the value with 
  • pjproject/trunk/pjsip/src/pjsip/sip_transaction.c

    r230 r253  
    762762 * Dump transaction layer. 
    763763 */ 
    764 PJ_DEF(void) pjsip_tsx_layer_dump(void) 
     764PJ_DEF(void) pjsip_tsx_layer_dump(pj_bool_t detail) 
    765765{ 
    766766#if PJ_LOG_MAX_LEVEL >= 3 
     
    771771 
    772772    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            } 
    788794        } 
    789795    } 
  • pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c

    r230 r253  
    778778 * Dump user agent contents (e.g. all dialogs). 
    779779 */ 
    780 PJ_DEF(void) pjsip_ua_dump(void) 
     780PJ_DEF(void) pjsip_ua_dump(pj_bool_t detail) 
    781781{ 
    782782#if PJ_LOG_MAX_LEVEL >= 3 
     
    786786    pj_mutex_lock(mod_ua.mutex); 
    787787 
    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) */ 
    814813            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            } 
    815818        } 
    816819    } 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c

    r247 r253  
    5959 
    6060 
     61    /* Default we start RTP at port 4000 */ 
     62    pjsua.start_rtp_port = 4000; 
     63 
     64 
    6165    /* Default logging settings: */ 
    6266    pjsua.log_level = 5; 
     
    139143{ 
    140144    enum {  
    141         RTP_START_PORT = 4000, 
    142         RTP_RANDOM_START = 2, 
    143145        RTP_RETRY = 100 
    144146    }; 
     
    149151    }; 
    150152    int i; 
    151     static pj_uint16_t rtp_port = RTP_START_PORT; 
     153    static pj_uint16_t rtp_port; 
    152154    pj_sock_t sock[3]; 
    153155    pj_sockaddr_in mapped_addr[3]; 
    154156    pj_status_t status = PJ_SUCCESS; 
     157 
     158    if (rtp_port == 0) 
     159        rtp_port = (pj_uint16_t)pjsua.start_rtp_port; 
    155160 
    156161    for (i=0; i<3; ++i) 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_opt.c

    r238 r253  
    8383    puts("  --auto-loop         Automatically loop incoming RTP to outgoing RTP"); 
    8484    puts("  --auto-conf         Automatically put incoming calls to conference"); 
     85    puts("  --rtp-port=N        Base port to try for RTP"); 
    8586    puts(""); 
    8687    puts("Buddy List (can be more than one):"); 
     
    212213           OPT_AUTO_ANSWER, OPT_AUTO_HANGUP, OPT_AUTO_PLAY, OPT_AUTO_LOOP, 
    213214           OPT_AUTO_CONF, 
    214            OPT_PLAY_FILE, 
     215           OPT_PLAY_FILE, OPT_RTP_PORT, 
    215216           OPT_NEXT_ACCOUNT, OPT_NEXT_CRED, OPT_MAX_CALLS, 
    216217    }; 
     
    244245        { "auto-conf",  0, 0, OPT_AUTO_CONF}, 
    245246        { "play-file",  1, 0, OPT_PLAY_FILE}, 
     247        { "rtp-port",   1, 0, OPT_RTP_PORT}, 
    246248        { "next-account",0,0, OPT_NEXT_ACCOUNT}, 
    247249        { "next-cred",  0, 0, OPT_NEXT_CRED}, 
     
    463465            break; 
    464466 
     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 
    465475        case OPT_AUTO_ANSWER: 
    466476            pjsua.auto_answer = my_atoi(optarg); 
    467477            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")); 
    469480                return -1; 
    470481            } 
     
    474485            pjsua.max_calls = my_atoi(optarg); 
    475486            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)")); 
    477488                return -1; 
    478489            } 
     
    578589    pjsip_endpt_dump(pjsua.endpt, 1); 
    579590    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); 
    582593 
    583594 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_reg.c

    r238 r253  
    8787void pjsua_regc_update(int acc_index, pj_bool_t renew) 
    8888{ 
    89     pj_status_t status; 
    90     pjsip_tx_data *tdata; 
     89    pj_status_t status = 0; 
     90    pjsip_tx_data *tdata = 0; 
    9191 
    9292    if (renew) { 
     
    9999            } 
    100100        } 
    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 
    102107    } else { 
    103108        if (pjsua.acc[acc_index].regc == NULL) { 
     
    127132    pj_status_t status; 
    128133 
     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 
    129139    /* initialize SIP registration if registrar is configured */ 
    130     if (pjsua.acc[acc_index].reg_uri.slen) { 
    131140 
    132         status = pjsip_regc_create( pjsua.endpt,  
    133                                     &pjsua.acc[acc_index],  
    134                                     &regc_cb,  
    135                                     &pjsua.acc[acc_index].regc); 
     141    status = pjsip_regc_create( pjsua.endpt,  
     142                                &pjsua.acc[acc_index],  
     143                                &regc_cb,  
     144                                &pjsua.acc[acc_index].regc); 
    136145 
    137         if (status != PJ_SUCCESS) { 
    138             pjsua_perror(THIS_FILE, "Unable to create client registration",  
    139                         status); 
    140             return status; 
    141         } 
     146    if (status != PJ_SUCCESS) { 
     147        pjsua_perror(THIS_FILE, "Unable to create client registration",  
     148                    status); 
     149        return status; 
     150    } 
    142151 
    143152 
    144         status = pjsip_regc_init( pjsua.acc[acc_index].regc,  
    145                                   &pjsua.acc[acc_index].reg_uri,  
    146                                   &pjsua.acc[acc_index].local_uri,  
    147                                   &pjsua.acc[acc_index].local_uri, 
    148                                   1, &pjsua.acc[acc_index].contact_uri,  
    149                                   pjsua.acc[acc_index].reg_timeout); 
    150         if (status != PJ_SUCCESS) { 
    151             pjsua_perror(THIS_FILE,  
    152                         "Client registration initialization error",  
    153                         status); 
    154             return status; 
    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    } 
    156165 
    157         pjsip_regc_set_credentials( pjsua.acc[acc_index].regc,  
    158                                     pjsua.cred_count,  
    159                                     pjsua.cred_info ); 
     166    pjsip_regc_set_credentials( pjsua.acc[acc_index].regc,  
     167                                pjsua.cred_count,  
     168                                pjsua.cred_info ); 
    160169 
    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 ); 
    164172 
    165173    return PJ_SUCCESS; 
Note: See TracChangeset for help on using the changeset viewer.