[sr-dev] [kamailio/kamailio] ims_usrloc_pcscf can not read protocol field from mysql DB's location table (#2871)

Erhan Onur Sendag notifications at github.com
Wed Oct 6 15:18:21 CEST 2021


Hi,

There is one more issue. ims_usrloc_pcscf's  db_insert_pcontact function is not able to write protocol value into database.

https://github.com/kamailio/kamailio/blob/c3629f877500373028d2c7cdefd976cddda31c15/src/modules/ims_usrloc_pcscf/usrloc_db.c#L243

In db_insert_pcontact function, Value array's length is 16, but while inserting, this value is given as 15. So contact's protocol value which is the last item of the array is not being written to the database.

```
int db_insert_pcontact(struct pcontact* _c)
{
....
	db_key_t keys[16] = {
				&domain_col,
				&aor_col,
				&received_col,
				&received_port_col,	&received_proto_col,
				&path_col,		&rinstance_col,
                                &rx_session_id_col,	&reg_state_col,
				&expires_col,		&service_routes_col,
				&socket_col,		&public_ids_col, &host_col, &port_col, &protocol_col
	};
	db_val_t values[16];
...
...
	if (ul_dbf.insert(ul_dbh, keys, values, 15) < 0) {
		LM_ERR("inserting contact in db failed\n");
		return -1;
	}

	return 0;
}
```



  


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2871#issuecomment-936220889
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20211006/0d0b507d/attachment-0001.htm>


More information about the sr-dev mailing list