Re: change (spoof) originator phone number in outgoing call using pjsip/pjsua

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 28.07.20 17:52, r.b.muller@xxxxxxxxx wrote:
> @Andeas, @Somedick
> I managed to compile PJSIP with the changes Andreas sent
> However, I must admit defeat in understanding how to set the new variables
> set_from_display_name, from_display_name and from_user
> I am using the demo program "simple_pjsua.c" as a base.
> Could you enlighten me on how to set the outging from number.
> Met Vriendelijke Groet, Regards,
> Rob Muller
> mailto:r.b.muller@xxxxxxxxx

You need to look at how pjsua_call_make_call() works.
If you look  at the docs, you'll see that it takes a pointer to
pjsua_call_setting as third parameter,
so looking at the code at simple_pjsua.c, the code would need to look
something like this:

    /* If URL is specified, make call to the URL. */
    if (argc > 1) {
        pjsua_call_setting call_setting;
        pjsua_call_setting_default( &call_setting );

        /* set From userpart */
        pj_cstr( &call_setting.from_user, "12345custom" );

        /* if you'd want to set display name as well: */
        if( 1 ) /* your condition goes here */
            call_setting.set_from_display_name = PJ_TRUE;
            pj_cstr( &call_setting.from_display_name, "Doctor Who" );

        pj_str_t uri = pj_str(argv[1]);
        status = pjsua_call_make_call(acc_id, &uri, &call_setting, NULL,
        if (status != PJ_SUCCESS) error_exit("Error making call", status);

All the best,

Visit our blog:

pjsip mailing list

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux