[pjsip] Missing host and port in Contact- header- URI

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

 



Hi Benny,

In stateful_proxy.c --> proxy_on_rx_request:

Example: I am receiving an REGISTER- Request with an Contact header like:

Contact: <sip:192.168.16.168:7176>;methods="INVITE, MESSAGE, INFO, SUBSCRIBE, OPTIONS, BYE, CANCEL, NOTIFY, ACK, REFER"

Now I want to get the IP and Port from the contact header using the following code in proxy_on_rx_request():

pjsip_contact_hdr *hcontact;
pjsip_sip_uri *uri;

hcontact = (pjsip_contact_hdr*) pjsip_msg_find_hdr (rdata->msg_info.msg, PJSIP_H_CONTACT, NULL);
		
if (hcontact != NULL)
	uri = (pjsip_sip_uri*)hcontact->uri;
...

The contact header is found but uri->host is null and uri->port is 0. How can I get this ?

Best regards,
Helmut





[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