Description

I put a dispatcher between PCSCF and UE. When I tried to register, Pcscf's save function saved dispatcher's via IP and via port instead of UE's via IP and via port.

When I checked save function of ims_registrar_pcscf module , I saw that cscf_get_ue_via function is used for that. And It gives wrong via value. Instead of giving last via , it gives the first via in the via list.

Here is the function:

https://github.com/kamailio/kamailio/blob/master/src/lib/ims/ims_getters.c

/**
 * Looks for the UE Via in First Via header if its a request
 * or in the last if its a response and returns its body
 * @param msg - the SIP message
 * @returns the via of the UE
 */
struct via_body* cscf_get_ue_via(struct sip_msg *msg)
{
	struct via_body *vb=0;

	if (msg->first_line.type==SIP_REQUEST) vb = cscf_get_first_via(msg,0);
	else vb = cscf_get_last_via(msg);

	if (!vb) return 0;

	if (vb->port == 0) vb->port=5060;
	return vb;	
}

Troubleshooting

I corrected the code as below:

/**
 * Looks for the UE Via in Last Via header and returns its body
 * @param msg - the SIP message
 * @returns the via of the UE
 */
struct via_body* cscf_get_ue_via(struct sip_msg *msg)
{
	struct via_body *vb=0;

	vb = cscf_get_last_via(msg);

	if (!vb) return 0;

	if (vb->port == 0) vb->port=5060;
	return vb;	
}

Reproduction

Try to put a dispatcher between PCSCF and UE. save function of ims_registrar_pcscf module saves dispatcher's IP and port as UE's IP and port.

Debugging Data

(paste your debugging data here)

Log Messages

(paste your log messages here)

SIP Traffic

(paste your sip traffic here)

Possible Solutions

Additional Information

(paste your output here)
(paste your output here)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.