Question

  NOTIFY sip:98901@xx.xx.xx.xx SIP/2.0
    To: sip:98901@xx.xx.xx.xx:1234
    From: sip:sipsak@xx.xx.xx.xx
    CSeq: 1 NOTIFY
    Call-ID:1234
    Event: check-sync;reboot=false

I want to Extract event header with the connected string check-sync;reboot=false

Was it helpful?

Solution 2

I had to deal with an custom header, a bit similar to your case. It may help you.

You'll have to start with init_parser. Here SIP messages are parsed. Add your own custom function here. Add an element in pjsip_rx_data and store the result. This information will be passed downstream. Finally implement your stuff here pres_process_rx_notify

OTHER TIPS

pj_str_t event_hdr_name = pj_str("Event");
pjsip_generic_string_hdr *event_hdr = (pjsip_generic_string_hdr*)pjsip_msg_find_hdr_by_name(message, &event_hdr_name, NULL);
if (event_hdr == NULL)
    return NULL;
pj_str_t event_value = event_hdr->value;`
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top