[pjsip] How to create acc_id without registering on the server

Thomas Plotkowiak plotti at gmx.net
Tue Nov 20 05:39:45 EST 2007


So far I've been using the code provided by the tutorial to create the
acc_id, but since the registration always times out, since there is no
registrar server I would like to initiate it without registration.

/* Register to SIP server by creating SIP account. */
    {
    pjsua_acc_config cfg;
    pjsua_acc_config_default(&cfg);
    cfg.id = pj_str("sip:" SIP_USER "@" SIP_DOMAIN);
    cfg.reg_uri = pj_str("sip:" SIP_DOMAIN);
    cfg.cred_count = 1;
    cfg.cred_info[0].realm = pj_str(SIP_DOMAIN);
    cfg.cred_info[0].scheme = pj_str("digest");
    cfg.cred_info[0].username = pj_str(SIP_USER);
    cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD;
    cfg.cred_info[0].data = pj_str(SIP_PASSWD);

    status = pjsua_acc_add(&cfg, PJ_TRUE, &acc_id);
    if (status != PJ_SUCCESS) error_exit("Error adding account", status);
    }

I know that there is a way of calling:
pj_status_t pjsua_acc_add_local (
pjsua_transport_id<http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__TRANSPORT.htm#g584ec6d58b3a63a43f9360522700e683>
  *tid*,

pj_bool_t  *is_default*,

pjsua_acc_id<http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__BASE.htm#g01a78e17d7787f7e0ea5efd240f3e427>*
*p_acc_id*
)
But i dont get what the transport id should be..

I am guessing it has to do with the transport I initiate
    /* Add UDP transport. */
    {
    pjsua_transport_config cfg;

    pjsua_transport_config_default(&cfg);
    cfg.port = 5060;
    status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &cfg, NULL);
    if (status != PJ_SUCCESS) error_exit("Error creating transport",
status);
    }

but how to find out its transport id?

Cheers
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20071120/8957f975/attachment.html>


More information about the pjsip mailing list