本文整理汇总了C++中pjsip_sip_uri_create函数的典型用法代码示例。如果您正苦于以下问题:C++ pjsip_sip_uri_create函数的具体用法?C++ pjsip_sip_uri_create怎么用?C++ pjsip_sip_uri_create使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pjsip_sip_uri_create函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pjsip_sip_uri_create
/* "sip:[::1];maddr=[::01]" */
static pjsip_uri *create_uri36( pj_pool_t *pool )
{
pjsip_sip_uri *url;
url = pjsip_sip_uri_create(pool, 0);
url->host = pj_str("::1");
url->maddr_param = pj_str("::01");
return (pjsip_uri*)url;
}
开发者ID:ChrisKwon,项目名称:spore,代码行数:10,代码来源:uri_test.c
示例2: pjsip_sip_uri_create
static pjsip_uri *create_uri16(pj_pool_t *pool)
{
/* "sip:" USER_CHAR ":" PASS_CHAR "@host" */
pjsip_sip_uri *url;
url = pjsip_sip_uri_create(pool, 0);
pj_strdup2(pool, &url->user, USER_CHAR);
pj_strdup2(pool, &url->passwd, PASS_CHAR);
pj_strdup2(pool, &url->host, "host");
return (pjsip_uri*)url;
}
开发者ID:Netrounds,项目名称:pjproject-old,代码行数:10,代码来源:uri_test.c
示例3: pjsip_name_addr_create
static pjsip_uri *create_uri7(pj_pool_t *pool)
{
/* "<sip:localhost>" */
pjsip_name_addr *name_addr = pjsip_name_addr_create(pool);
pjsip_sip_uri *url;
url = pjsip_sip_uri_create(pool, 0);
name_addr->uri = (pjsip_uri*) url;
pj_strdup2(pool, &url->host, "localhost");
return (pjsip_uri*)name_addr;
}
开发者ID:Netrounds,项目名称:pjproject-old,代码行数:12,代码来源:uri_test.c
示例4: pjsip_rr_hdr_create
/// Adds a Record-Route header to the message with the specified user name,
/// port and transport. If the user parameter is NULL the user field is left
/// blank.
void PJUtils::add_record_route(pjsip_tx_data* tdata,
const char* transport,
int port,
const char* user)
{
pjsip_rr_hdr* rr = pjsip_rr_hdr_create(tdata->pool);
pjsip_sip_uri* uri = pjsip_sip_uri_create(tdata->pool, PJ_FALSE);
uri->host = stack_data.name[0];
uri->port = port;
pj_strdup2(tdata->pool, &uri->transport_param, transport);
uri->lr_param = PJ_TRUE;
if (user != NULL)
{
pj_strdup2(tdata->pool, &uri->user, user);
}
rr->name_addr.uri = (pjsip_uri*)uri;
pjsip_msg_insert_first_hdr(tdata->msg, (pjsip_hdr*)rr);
LOG_DEBUG("Added Record-Route header, URI = %s", uri_to_string(PJSIP_URI_IN_ROUTING_HDR, rr->name_addr.uri).c_str());
}
开发者ID:telecore-ivan,项目名称:sprout,代码行数:25,代码来源:pjutils.cpp
示例5: process_register_request
//.........这里部分代码省略.........
if (uri != NULL)
{
// Contact URI is well formed, so include this in the response.
pjsip_contact_hdr* contact = pjsip_contact_hdr_create(tdata->pool);
contact->star = 0;
contact->uri = uri;
contact->q1000 = binding->_priority;
contact->expires = binding->_expires - now;
pj_list_init(&contact->other_param);
for (std::list<std::pair<std::string, std::string> >::iterator j = binding->_params.begin();
j != binding->_params.end();
++j)
{
pjsip_param *new_param = PJ_POOL_ALLOC_T(tdata->pool, pjsip_param);
pj_strdup2(tdata->pool, &new_param->name, j->first.c_str());
pj_strdup2(tdata->pool, &new_param->value, j->second.c_str());
pj_list_insert_before(&contact->other_param, new_param);
}
pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)contact);
}
else
{
// Contact URI is malformed. Log an error, but otherwise don't try and
// fix it.
// LCOV_EXCL_START hard to hit - needs bad data in the store
LOG_WARNING("Badly formed contact URI %s for address of record %s",
binding->_uri.c_str(), aor.c_str());
// LCOV_EXCL_STOP
}
}
}
// Deal with path header related fields in the response.
pjsip_generic_string_hdr* path_hdr =
(pjsip_generic_string_hdr*)pjsip_msg_find_hdr_by_name(msg, &STR_PATH, NULL);
if ((path_hdr != NULL) &&
(!aor_data->bindings().empty()))
{
// We have bindings with path headers so we must require outbound.
pjsip_require_hdr* require_hdr = pjsip_require_hdr_create(tdata->pool);
require_hdr->count = 1;
require_hdr->values[0] = STR_OUTBOUND;
pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)require_hdr);
}
// Echo back any Path headers as per RFC 3327, section 5.3. We take these
// from the request as they may not exist in the bindings any more if the
// bindings have expired.
while (path_hdr)
{
pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, path_hdr));
path_hdr = (pjsip_generic_string_hdr*)pjsip_msg_find_hdr_by_name(msg, &STR_PATH, path_hdr->next);
}
// Construct a Service-Route header pointing at the sprout cluster. We don't
// care which sprout handles the subsequent requests as they all have access
// to all subscriber information.
pjsip_sip_uri* service_route_uri = pjsip_sip_uri_create(tdata->pool, false);
pj_strdup(tdata->pool,
&service_route_uri->host,
&stack_data.sprout_cluster_domain);
service_route_uri->port = stack_data.trusted_port;
service_route_uri->transport_param = pj_str("TCP");
service_route_uri->lr_param = 1;
pjsip_route_hdr* service_route = pjsip_route_hdr_create(tdata->pool);
service_route->name = STR_SERVICE_ROUTE;
service_route->sname = pj_str("");
service_route->name_addr.uri = (pjsip_uri*)service_route_uri;
pjsip_msg_insert_first_hdr(tdata->msg, (pjsip_hdr*)service_route);
// Add P-Associated-URI headers for all of the associated URIs.
static const pj_str_t p_associated_uri_hdr_name = pj_str("P-Associated-URI");
for (Json::ValueIterator it = uris->begin(); it != uris->end(); it++)
{
pj_str_t associated_uri = {(char*)(*it).asCString(), strlen((*it).asCString())};
pjsip_hdr* associated_uri_hdr =
(pjsip_hdr*)pjsip_generic_string_hdr_create(tdata->pool,
&p_associated_uri_hdr_name,
&associated_uri);
pjsip_msg_add_hdr(tdata->msg, associated_uri_hdr);
}
delete uris;
// Send the response, but prevent the transmitted data from being freed, as we may need to inform the
// ASes of the 200 OK response we sent.
pjsip_tx_data_add_ref(tdata);
status = pjsip_endpt_send_response2(stack_data.endpt, rdata, tdata, NULL, NULL);
RegistrationUtils::register_with_application_servers(ifchandler, store, rdata, tdata, "");
// Now we can free the tdata.
pjsip_tx_data_dec_ref(tdata);
LOG_DEBUG("Report SAS end marker - trail (%llx)", trail);
SAS::Marker end_marker(trail, SASMarker::END_TIME, 1u);
SAS::report_marker(end_marker);
delete aor_data;
}
开发者ID:sa4250mnpo70,项目名称:sprout,代码行数:101,代码来源:registrar.cpp
示例6: dummy_function
//.........这里部分代码省略.........
#endif
#ifdef HAS_PJLIB_HMAC_SHA1
pj_hmac_sha1(NULL, 0, NULL, 0, NULL);
#endif
#ifdef HAS_PJNATH_STUN
pj_stun_session_create(NULL, NULL, NULL, PJ_FALSE, NULL);
pj_stun_session_destroy(NULL);
pj_stun_session_set_credential(NULL, NULL);
pj_stun_session_create_req(NULL, 0, NULL, NULL);
pj_stun_session_create_ind(NULL, 0, NULL);
pj_stun_session_create_res(NULL, NULL, 0, NULL, NULL);
pj_stun_session_send_msg(NULL, PJ_FALSE, NULL, 0, NULL);
#endif
#ifdef HAS_PJNATH_ICE
pj_ice_strans_create(NULL, NULL, 0, NULL, NULL, NULL);
pj_ice_strans_set_stun_domain(NULL, NULL, NULL);
pj_ice_strans_create_comp(NULL, 0, 0, NULL);
pj_ice_strans_add_cand(NULL, 0, PJ_ICE_CAND_TYPE_HOST, 0, NULL, PJ_FALSE);
pj_ice_strans_init_ice(NULL, PJ_ICE_SESS_ROLE_CONTROLLED, NULL, NULL);
pj_ice_strans_start_ice(NULL, NULL, NULL, 0, NULL);
pj_ice_strans_stop_ice(NULL);
pj_ice_strans_sendto(NULL, 0, NULL, 0, NULL, 0);
#endif
#ifdef HAS_PJSIP_CORE_MSG_ELEM
/* Parameter container */
pjsip_param_find(NULL, NULL);
pjsip_param_print_on(NULL, NULL, 0, NULL, NULL, 0);
/* SIP URI */
pjsip_sip_uri_create(NULL, 0);
pjsip_name_addr_create(NULL);
/* TEL URI */
pjsip_tel_uri_create(NULL);
/* Message and headers */
pjsip_msg_create(NULL, PJSIP_REQUEST_MSG);
pjsip_msg_print(NULL, NULL, 0);
pjsip_accept_hdr_create(NULL);
pjsip_allow_hdr_create(NULL);
pjsip_cid_hdr_create(NULL);
pjsip_clen_hdr_create(NULL);
pjsip_cseq_hdr_create(NULL);
pjsip_contact_hdr_create(NULL);
pjsip_ctype_hdr_create(NULL);
pjsip_expires_hdr_create(NULL, 0);
pjsip_from_hdr_create(NULL);
pjsip_max_fwd_hdr_create(NULL, 0);
pjsip_min_expires_hdr_create(NULL, 0);
pjsip_rr_hdr_create(NULL);
pjsip_require_hdr_create(NULL);
pjsip_retry_after_hdr_create(NULL, 0);
pjsip_supported_hdr_create(NULL);
pjsip_unsupported_hdr_create(NULL);
pjsip_via_hdr_create(NULL);
pjsip_warning_hdr_create(NULL, 0, NULL, NULL);
pjsip_parse_uri(NULL, NULL, 0, 0);
pjsip_parse_msg(NULL, NULL, 0, NULL);
pjsip_parse_rdata(NULL, 0, NULL);
pjsip_find_msg(NULL, 0, 0, NULL);
#endif
开发者ID:0x0B501E7E,项目名称:pjproject,代码行数:67,代码来源:footprint.c
注:本文中的pjsip_sip_uri_create函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论