Changeset 5308
- Timestamp:
- May 19, 2016 6:55:16 AM (8 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r5170 r5308 1665 1665 if (app_config.udp_cfg.port == 0) { 1666 1666 pjsua_transport_info ti; 1667 pj_sockaddr_in *a;1668 1667 1669 1668 pjsua_transport_get_info(transport_id, &ti); 1670 a = (pj_sockaddr_in*)&ti.local_addr; 1671 1672 tcp_cfg.port = pj_ntohs(a->sin_port); 1669 tcp_cfg.port = pj_sockaddr_get_port(&ti.local_addr); 1673 1670 } 1674 1671 } -
pjproject/trunk/pjsip/include/pjsip/sip_transport.h
r5246 r5308 995 995 char *type_name; /**< Type string name. */ 996 996 unsigned flag; /**< Transport flag. */ 997 char *info; /**< Transport info/description.*/ 997 998 998 999 pj_sockaddr local_addr; /**< Bound address. */ -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
r5244 r5308 252 252 ) 253 253 { 254 enum { INFO_LEN = 100 }; 255 char local_addr[PJ_INET6_ADDRSTRLEN+10]; 254 256 pj_pool_t *pool; 255 257 pj_sock_t sock = PJ_INVALID_SOCKET; … … 474 476 475 477 #endif 478 479 /* Set transport info. */ 480 if (listener->factory.info == NULL) { 481 listener->factory.info = (char*) pj_pool_alloc(listener->factory.pool, 482 INFO_LEN); 483 } 484 pj_sockaddr_print(listener_addr, local_addr, sizeof(local_addr), 3); 485 pj_ansi_snprintf( 486 listener->factory.info, INFO_LEN, "tcp %s [published as %.*s:%d]", 487 local_addr, 488 (int)listener->factory.addr_name.host.slen, 489 listener->factory.addr_name.host.ptr, 490 listener->factory.addr_name.port); 476 491 477 492 if (has_listener) { -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c
r5244 r5308 310 310 pjsip_tpfactory **p_factory) 311 311 { 312 enum { INFO_LEN = 100 }; 313 char local_addr[PJ_INET6_ADDRSTRLEN+10]; 312 314 pj_pool_t *pool; 313 315 pj_bool_t is_ipv6; … … 546 548 goto on_error; 547 549 } 550 551 /* Set transport info. */ 552 if (listener->factory.info == NULL) { 553 listener->factory.info = (char*) pj_pool_alloc(listener->factory.pool, 554 INFO_LEN); 555 } 556 pj_sockaddr_print(listener_addr, local_addr, sizeof(local_addr), 3); 557 pj_ansi_snprintf( 558 listener->factory.info, INFO_LEN, "tls %s [published as %.*s:%d]", 559 local_addr, 560 (int)listener->factory.addr_name.host.slen, 561 listener->factory.addr_name.host.ptr, 562 listener->factory.addr_name.port); 548 563 549 564 if (has_listener) { -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r5249 r5308 1945 1945 /* Send raw packet */ 1946 1946 status = pjsip_tpmgr_send_raw(pjsip_endpt_get_tpmgr(pjsua_var.endpt), 1947 PJSIP_TRANSPORT_UDP, &tp_sel,1947 acc->ka_transport->key.type, &tp_sel, 1948 1948 NULL, acc->cfg.ka_data.ptr, 1949 1949 acc->cfg.ka_data.slen, … … 2012 2012 if (/*pjsua_var.stun_srv.ipv4.sin_family == 0 ||*/ 2013 2013 acc->cfg.ka_interval == 0 || 2014 param->rdata->tp_info.transport->key.type != PJSIP_TRANSPORT_UDP) 2014 (param->rdata->tp_info.transport->key.type & PJSIP_TRANSPORT_UDP)!= 2015 PJSIP_TRANSPORT_UDP) 2015 2016 { 2016 2017 /* Keep alive is not necessary */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r5307 r5308 2448 2448 PJSUA_LOCK(); 2449 2449 2450 if ( t->type== PJSIP_TRANSPORT_UDP) {2450 if ((t->type & PJSIP_TRANSPORT_UDP) == PJSIP_TRANSPORT_UDP) { 2451 2451 2452 2452 pjsip_transport *tp = t->data.tp; … … 2469 2469 status = PJ_SUCCESS; 2470 2470 2471 } else if ( t->type== PJSIP_TRANSPORT_TCP ||2472 t->type== PJSIP_TRANSPORT_TLS)2471 } else if ((t->type & PJSIP_TRANSPORT_TCP) == PJSIP_TRANSPORT_TCP || 2472 (t->type & PJSIP_TRANSPORT_TLS) == PJSIP_TRANSPORT_TLS) 2473 2473 { 2474 2474 … … 2482 2482 info->id = id; 2483 2483 info->type = t->type; 2484 info->type_name = (t->type==PJSIP_TRANSPORT_TCP)? pj_str("TCP"): 2485 pj_str("TLS"); 2486 info->info = (t->type==PJSIP_TRANSPORT_TCP)? pj_str("TCP transport"): 2487 pj_str("TLS transport"); 2484 info->type_name = pj_str(factory->type_name); 2485 info->info = pj_str(factory->info); 2488 2486 info->flag = factory->flag; 2489 2487 info->addr_len = sizeof(factory->local_addr); … … 2535 2533 { 2536 2534 pj_status_t status; 2535 pjsip_transport_type_e tp_type; 2537 2536 2538 2537 /* Make sure id is in range. */ … … 2542 2541 /* Make sure that transport exists */ 2543 2542 PJ_ASSERT_RETURN(pjsua_var.tpdata[id].data.ptr != NULL, PJ_EINVAL); 2543 2544 tp_type = pjsua_var.tpdata[id].type & ~PJSIP_TRANSPORT_IPV6; 2544 2545 2545 2546 /* Note: destroy() may not work if there are objects still referencing … … 2547 2548 */ 2548 2549 if (force) { 2549 switch ( pjsua_var.tpdata[id].type) {2550 switch (tp_type) { 2550 2551 case PJSIP_TRANSPORT_UDP: 2551 2552 status = pjsip_transport_shutdown(pjsua_var.tpdata[id].data.tp); … … 2580 2581 * descriptor. 2581 2582 */ 2582 switch ( pjsua_var.tpdata[id].type) {2583 switch (tp_type) { 2583 2584 case PJSIP_TRANSPORT_UDP: 2584 2585 return pjsip_transport_shutdown(pjsua_var.tpdata[id].data.tp);
Note: See TracChangeset
for help on using the changeset viewer.