Re: Custom Registration Header

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

 



If it makes any difference, I'm actually looking to have this header change on every registration request. The use case is to include a JWT in the registration (instead of a standard username and password)

Thanks,
Colin

On Wed, May 25, 2016 at 9:54 PM Colin Morelli <colin.morelli@xxxxxxxxx> wrote:
Hey all,

I'm trying to send a custom header in my registration request. However, my app always ends up crashing when trying to set it. I'm calling:

  pj_list_init(&config->reg_hdr_list);
  pjsip_generic_string_hdr generic_hdr;
  pj_str_t name = pj_str("name");
  pj_str_t value = pj_str("value");
  pjsip_generic_string_hdr_init2(&generic_hdr, &name, &value);
  pj_list_push_back(&config->reg_hdr_list, &generic_hdr);

The backtrace from the crash is:

    frame #0: 0x348dcae6 libsystem_platform.dylib`_platform_memmove + 486
    frame #1: 0x347ebc64 libsystem_c.dylib`__memcpy_chk + 16
    frame #2: 0x347ebc64 libsystem_c.dylib`__memcpy_chk + 16
    frame #3: 0x0026f34a MyApp`pj_memcpy + 26
    frame #4: 0x0026f31c MyApp`pj_strdup + 68
    frame #5: 0x002c58f2 MyApp`pjsip_generic_string_hdr_init + 38
    frame #6: 0x002c5948 MyApp`pjsip_generic_string_hdr_create + 36
    frame #7: 0x002c6d1c MyApp`pjsip_generic_string_hdr_clone + 24
    frame #8: 0x002c4d62 MyApp`pjsip_hdr_clone + 34
    frame #9: 0x00301aae MyApp`pjsua_acc_config_dup + 420
    frame #10: 0x00301e68 MyApp`pjsua_acc_add + 666

I'm assuming I need to be allocating the strings on the pool but I'm not sure which pool to use without causing a leak.

Best,
Colin
_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[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