- Call logging: display FROM & TO for calls.
This commit is contained in:
parent
9fd646574e
commit
888f998c8d
@ -1,5 +1,6 @@
|
|||||||
0.5.12
|
0.5.12
|
||||||
======
|
======
|
||||||
|
28-Dec-2005: - Call logging: display FROM & TO for calls.
|
||||||
26-Dec-2005: - Added a short-dial feature ("pi_shortdial_*" config options)
|
26-Dec-2005: - Added a short-dial feature ("pi_shortdial_*" config options)
|
||||||
18-Dec-2005: - Grandstream "unregister at startup" works now
|
18-Dec-2005: - Grandstream "unregister at startup" works now
|
||||||
9-Oct-2005: - Expiration timeout is now taken from the REGISTER response
|
9-Oct-2005: - Expiration timeout is now taken from the REGISTER response
|
||||||
|
|||||||
65
src/proxy.c
65
src/proxy.c
@ -111,38 +111,47 @@ int proxy_request (sip_ticket_t *ticket) {
|
|||||||
* logging of passing calls
|
* logging of passing calls
|
||||||
*/
|
*/
|
||||||
if (configuration.log_calls) {
|
if (configuration.log_calls) {
|
||||||
osip_uri_t *cont_url = NULL;
|
osip_uri_t *from_url = NULL;
|
||||||
if (!osip_list_eol(request->contacts, 0))
|
osip_uri_t *to_url = NULL;
|
||||||
cont_url = ((osip_contact_t*)(request->contacts->node->element))->url;
|
char *to_username =NULL;
|
||||||
|
char *to_host = NULL;
|
||||||
|
char *from_username =NULL;
|
||||||
|
char *from_host = NULL;
|
||||||
|
|
||||||
|
/* From: 1st preference is contact header, then use From field */
|
||||||
|
if (!osip_list_eol(request->contacts, 0)) {
|
||||||
|
from_url = ((osip_contact_t*)(request->contacts->node->element))->url;
|
||||||
|
} else {
|
||||||
|
from_url = request->from->url;
|
||||||
|
}
|
||||||
|
|
||||||
|
to_url = request->to->url;
|
||||||
|
|
||||||
|
if (to_url) {
|
||||||
|
to_username = to_url->username;
|
||||||
|
to_host = to_url->host;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (from_url) {
|
||||||
|
from_username = from_url->username;
|
||||||
|
from_host = from_url->host;
|
||||||
|
}
|
||||||
|
|
||||||
/* INVITE */
|
/* INVITE */
|
||||||
if (MSG_IS_INVITE(request)) {
|
if (MSG_IS_INVITE(request)) {
|
||||||
if (cont_url) {
|
INFO("%s Call: %s@%s -> %s@%s",
|
||||||
INFO("%s Call from: %s@%s",
|
(type==REQTYP_INCOMING) ? "Incoming":"Outgoing",
|
||||||
(type==REQTYP_INCOMING) ? "Incoming":"Outgoing",
|
from_username ? from_username: "*NULL*",
|
||||||
cont_url->username ? cont_url->username:"*NULL*",
|
from_host ? from_host : "*NULL*",
|
||||||
cont_url->host ? cont_url->host : "*NULL*");
|
to_username ? to_username : "*NULL*",
|
||||||
} else {
|
to_host ? to_host : "*NULL*");
|
||||||
INFO("%s Call (w/o contact header) from: %s@%s",
|
|
||||||
(type==REQTYP_INCOMING) ? "Incoming":"Outgoing",
|
|
||||||
request->from->url->username ?
|
|
||||||
request->from->url->username:"*NULL*",
|
|
||||||
request->from->url->host ?
|
|
||||||
request->from->url->host : "*NULL*");
|
|
||||||
}
|
|
||||||
/* BYE / CANCEL */
|
/* BYE / CANCEL */
|
||||||
} else if (MSG_IS_BYE(request) || MSG_IS_CANCEL(request)) {
|
} else if (MSG_IS_BYE(request) || MSG_IS_CANCEL(request)) {
|
||||||
if (cont_url) {
|
INFO("Ending Call: %s@%s -> %s@%s",
|
||||||
INFO("Ending Call from: %s@%s",
|
from_username ? from_username: "*NULL*",
|
||||||
cont_url->username ? cont_url->username:"*NULL*",
|
from_host ? from_host : "*NULL*",
|
||||||
cont_url->host ? cont_url->host : "*NULL*");
|
to_username ? to_username : "*NULL*",
|
||||||
} else {
|
to_host ? to_host : "*NULL*");
|
||||||
INFO("Ending Call (w/o contact header) from: %s@%s",
|
|
||||||
request->from->url->username ?
|
|
||||||
request->from->url->username:"*NULL*",
|
|
||||||
request->from->url->host ?
|
|
||||||
request->from->url->host : "*NULL*");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} /* log_calls */
|
} /* log_calls */
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user