Hi All,
I am trying to customize the MESSAGE(pager) IM
sip message by adding an extension header into the message.
It looks like the routine to send a SIMPLE IM
here is as follows:
string to = “sip:user@xxxxxxxxxxxxxxx”;
ClientPagerMessageHandle cpmh = mDum.makePagerMessage(NameAddr(to));
cpmh.get()->page(“a message to be sent”);
However, I am looking to add an extra header in
the message for the usage of my own application.(PS. Will this extra header and its value be copied into the
corresponding response of the message? This extra header is important because
it will be used to match the request from the non-SIP domain and the response
from the SIP domain) I noticed that there is a “getMessageRequest()”function in the class ClientpagerMessage that allows the user to
“adorn
the MESSAGE message if desired” and it returns the actual reference of the request SIP message,
so I gave it a go with the following code:
static const resip::ExtensionHeader h_CustomizedHeader("CustomizedHeader");
SipMessage msg = cpmh.get()->getMessageRequest();
msg.header(h_CustomizedHeader).push_back(StringCategory("1122334455"));
cpmh.get()->page(“a message to be sent”);
The MESSAGE message got sent out, but I didn’t
see the “h_CustomizedHeader”header in the SIP message when I have captured
it in Wireshark.
I am confused because the “getMessageRequest()” function returns the reference of the request SIP message and I
see the “pager()/pageFirstMsgQueued()”is sending out the same request SIP message.
Could anybody shed some light on why the extension header was not added into
the message that got sent and how I can add an extension header correctly into
the MESSAGE sip message? Thanks a million!
Regards,
Alex