PJSIP Custom Registration Header (iOS)
- by Daniel Redington
I am attempting to setup SIP communication with an internal server (using the PJSIP library), however, this server requires a custom header field with a specified header value for the REGISTRATION call. For example's sake we'll call this required header "MyHeader".
From what I've found, the pjsua_acc_add() function will add an account and register it to the server using a config struct.
The parameter "reg_hdr_list" of the config struct has the description "The optional custom SIP headers to be put in the registration request." Which sounds like exactly what I need, however doesn't seem to have any effect on the call itself.
Here's what I have so far:
pjsua_acc_config cfg;
pjsua_acc_config_default(&cfg);
//...Some other config stuff related to the server...
pjsip_hdr test;
test.name = pj_str("MyHeader");
test.sname = pj_str("MyHdr");
test.type = PJSIP_H_OTHER;
test.prev = cfg.reg_hdr_list.prev;
test.next = cfg.reg_hdr_list.next;
cfg.reg_hdr_list = test;
pj_status_t status;
status = pjsua_acc_add(&cfg, PJ_TRUE, &acc_id);
From the server side, there are no extra header fields or anything. And the struct that is used to define the header (pjsua_hdr) has no "value" or equivalent field, so even if it did create the header, how does it set the value?
Here's the refrence for the header list definition: Link
And the reference for the header struct: Link
Any help would be greatly appreciated!