nesterenkodm / pjsip

PJSIP is Open Source SIP, Media, and NAT Traversal Library
495 stars 220 forks source link

Win32 pjsip set log path include chinese name can't create log file #79

Closed xiaoluweiba closed 5 years ago

xiaoluweiba commented 5 years ago

compile pjsip-2.5.1 use VS 2015;

  1. set callback function:

cfg->log_cfg.cb = &log_writer;

  1. set pjlib support UNICODE

    static void log_writer(int level, const char *data, int len)
    {
    pj_status_t status;
    pj_ssize_t writelen = 0;
    pj_oshandle_t fd= NULL;
    
    status = pj_file_open(NULL, "D:\\testpjsiplog\\中文--log\\pjsip.log", PJ_O_WRONLY | PJ_O_APPEND, &androidfd);
        if (status == PJ_SUCCESS && fd) {
            writelen = len;
            status = pj_file_write(fd, data, &writelen);
            pj_file_close(fd);
        }
    }
    }
  2. If I change log path to D:\testpjsiplog\enligsh--log\pjsip.log will be OK

can you give me some advice, Thank you very much

welljsjs commented 5 years ago

Hey @xiaoluweiba, would you mind filling out the official template for reporting issues/bugs/questions?

That makes things a lot easier for everyone.

Please also note that pjsip 2.5.1 is outdated.

can you give me some advice, Thank you very much

Could you elaborate a little and provider more information? What's your question and how is it related to this project?

Are you sure that: You're reporting the issue to the correct repository as it is related to this repository and not to the official pjsip repository

github-actions[bot] commented 5 years ago

This issue is stale because it had been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.