Changeset 2852
- Timestamp:
- Aug 4, 2009 2:36:17 PM (15 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r2824 r2852 181 181 puts (" --id=url Set the URL of local ID (used in From header)"); 182 182 puts (" --contact=url Optionally override the Contact information"); 183 puts (" --contact-params=S Append the specified parameters S in Contact URI"); 183 puts (" --contact-params=S Append the specified parameters S in Contact header"); 184 puts (" --contact-uri-params=S Append the specified parameters S in Contact URI"); 184 185 puts (" --proxy=url Optional URL of proxy server to visit"); 185 186 puts (" May be specified multiple times"); … … 472 473 OPT_LOCAL_PORT, OPT_IP_ADDR, OPT_PROXY, OPT_OUTBOUND_PROXY, 473 474 OPT_REGISTRAR, OPT_REG_TIMEOUT, OPT_PUBLISH, OPT_ID, OPT_CONTACT, 474 OPT_BOUND_ADDR, OPT_CONTACT_PARAMS, 475 OPT_BOUND_ADDR, OPT_CONTACT_PARAMS, OPT_CONTACT_URI_PARAMS, 475 476 OPT_100REL, OPT_USE_IMS, OPT_REALM, OPT_USERNAME, OPT_PASSWORD, 476 477 OPT_NAMESERVER, OPT_STUN_DOMAIN, OPT_STUN_SRV, … … 530 531 { "contact", 1, 0, OPT_CONTACT}, 531 532 { "contact-params",1,0, OPT_CONTACT_PARAMS}, 533 { "contact-uri-params",1,0, OPT_CONTACT_URI_PARAMS}, 532 534 { "auto-update-nat", 1, 0, OPT_AUTO_UPDATE_NAT}, 533 535 { "use-compact-form", 0, 0, OPT_USE_COMPACT_FORM}, … … 852 854 break; 853 855 856 case OPT_CONTACT_URI_PARAMS: 857 cur_acc->contact_uri_params = pj_str(pj_optarg); 858 break; 859 854 860 case OPT_AUTO_UPDATE_NAT: /* OPT_AUTO_UPDATE_NAT */ 855 861 cur_acc->allow_contact_rewrite = pj_strtoul(pj_cstr(&tmp, pj_optarg)); … … 1406 1412 } 1407 1413 1408 /* Contact parameters */1414 /* Contact header parameters */ 1409 1415 if (acc_cfg->contact_params.slen) { 1410 1416 pj_ansi_sprintf(line, "--contact-params %.*s\n", 1411 1417 (int)acc_cfg->contact_params.slen, 1412 1418 acc_cfg->contact_params.ptr); 1419 pj_strcat2(result, line); 1420 } 1421 1422 /* Contact URI parameters */ 1423 if (acc_cfg->contact_uri_params.slen) { 1424 pj_ansi_sprintf(line, "--contact-uri-params %.*s\n", 1425 (int)acc_cfg->contact_uri_params.slen, 1426 acc_cfg->contact_uri_params.ptr); 1413 1427 pj_strcat2(result, line); 1414 1428 } -
pjproject/trunk/pjsip-apps/src/python/_pjsua.h
r2394 r2852 1654 1654 PyObject *auth_initial_algorithm; 1655 1655 PyObject *pidf_tuple_id; 1656 PyObject *contact_params; 1657 PyObject *contact_uri_params; 1656 1658 int require_100rel; 1657 1659 int allow_contact_rewrite; … … 1676 1678 Py_XDECREF(self->auth_initial_algorithm); 1677 1679 Py_XDECREF(self->pidf_tuple_id); 1680 Py_XDECREF(self->contact_params); 1681 Py_XDECREF(self->contact_uri_params); 1678 1682 Py_XDECREF(self->ka_data); 1679 1683 self->ob_type->tp_free((PyObject*)self); … … 1722 1726 Py_XDECREF(obj->pidf_tuple_id); 1723 1727 obj->pidf_tuple_id = PyString_FromPJ(&cfg->pidf_tuple_id); 1728 Py_XDECREF(obj->contact_params); 1729 obj->contact_params = PyString_FromPJ(&cfg->contact_params); 1730 Py_XDECREF(obj->contact_uri_params); 1731 obj->contact_uri_params = PyString_FromPJ(&cfg->contact_uri_params); 1724 1732 obj->require_100rel = cfg->require_100rel; 1725 1733 obj->allow_contact_rewrite = cfg->allow_contact_rewrite; … … 1766 1774 cfg->auth_pref.algorithm = PyString_ToPJ(obj->auth_initial_algorithm); 1767 1775 cfg->pidf_tuple_id = PyString_ToPJ(obj->pidf_tuple_id); 1776 cfg->contact_params = PyString_ToPJ(obj->contact_params); 1777 cfg->contact_uri_params = PyString_ToPJ(obj->contact_uri_params); 1768 1778 cfg->require_100rel = obj->require_100rel; 1769 1779 cfg->allow_contact_rewrite = obj->allow_contact_rewrite; … … 1797 1807 self->auth_initial_algorithm = PyString_FromString(""); 1798 1808 self->pidf_tuple_id = PyString_FromString(""); 1809 self->contact_params = PyString_FromString(""); 1810 self->contact_uri_params = PyString_FromString(""); 1799 1811 self->ka_data = PyString_FromString(""); 1800 1812 } … … 1893 1905 offsetof(PyObj_pjsua_acc_config, pidf_tuple_id), 0, 1894 1906 "PIDF tuple id." 1907 }, 1908 { 1909 "contact_params", T_OBJECT_EX, 1910 offsetof(PyObj_pjsua_acc_config, contact_params), 0, 1911 "Additional parameters for Contact header." 1912 }, 1913 { 1914 "contact_uri_params", T_OBJECT_EX, 1915 offsetof(PyObj_pjsua_acc_config, contact_uri_params), 0, 1916 "Additional parameters for Contact URI." 1895 1917 }, 1896 1918 { -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r2824 r2852 1667 1667 1668 1668 /** 1669 * Additional URIparameters that will be appended in the Contact header1669 * Additional parameters that will be appended in the Contact header 1670 1670 * for this account. This will affect the Contact header in all SIP 1671 1671 * messages sent on behalf of this account, including but not limited to … … 1677 1677 */ 1678 1678 pj_str_t contact_params; 1679 1680 /** 1681 * Additional URI parameters that will be appended in the Contact URI 1682 * for this account. This will affect the Contact URI in all SIP 1683 * messages sent on behalf of this account, including but not limited to 1684 * REGISTER, INVITE, and SUBCRIBE requests or responses. 1685 * 1686 * The parameters should be preceeded by semicolon, and all strings must 1687 * be properly escaped. Example: 1688 * ";my-param=X;another-param=Hi%20there" 1689 */ 1690 pj_str_t contact_uri_params; 1679 1691 1680 1692 /** -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r2745 r2852 713 713 tmp = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); 714 714 len = pj_ansi_snprintf(tmp, PJSIP_MAX_URL_SIZE, 715 "<sip:%.*s%s%s%.*s%s:%d;transport=%s%.*s> ",715 "<sip:%.*s%s%s%.*s%s:%d;transport=%s%.*s>%.*s", 716 716 (int)acc->user_part.slen, 717 717 acc->user_part.ptr, … … 723 723 rport, 724 724 tp->type_name, 725 (int)acc->cfg.contact_uri_params.slen, 726 acc->cfg.contact_uri_params.ptr, 725 727 (int)acc->cfg.contact_params.slen, 726 728 acc->cfg.contact_params.ptr); … … 1699 1701 contact->ptr = (char*)pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); 1700 1702 contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE, 1701 "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s> ",1703 "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s>%.*s", 1702 1704 (int)acc->display.slen, 1703 1705 acc->display.ptr, … … 1713 1715 local_port, 1714 1716 transport_param, 1717 (int)acc->cfg.contact_uri_params.slen, 1718 acc->cfg.contact_uri_params.ptr, 1715 1719 (int)acc->cfg.contact_params.slen, 1716 1720 acc->cfg.contact_params.ptr); … … 1851 1855 contact->ptr = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); 1852 1856 contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE, 1853 "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s> ",1857 "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s>%.*s", 1854 1858 (int)acc->display.slen, 1855 1859 acc->display.ptr, … … 1865 1869 local_port, 1866 1870 transport_param, 1871 (int)acc->cfg.contact_uri_params.slen, 1872 acc->cfg.contact_uri_params.ptr, 1867 1873 (int)acc->cfg.contact_params.slen, 1868 1874 acc->cfg.contact_params.ptr);
Note: See TracChangeset
for help on using the changeset viewer.