diff options
author | Alexei Gradinari <alex2grad@gmail.com> | 2016-05-19 15:56:26 -0400 |
---|---|---|
committer | Alexei Gradinari <alex2grad@gmail.com> | 2016-05-26 16:18:11 -0500 |
commit | 31f17abe449c2a9b43ef4e820792fb52d4b27d7a (patch) | |
tree | dc5464d92bce81601bcd240c0bdb9b397822bcb4 /res/res_pjsip/pjsip_options.c | |
parent | a6b16d7029a7a44c6a43b3b0f1cbc74cecd11454 (diff) |
res_pjsip: add "via_addr", "via_port", "call_id" to contact
As res_pjsip_nat rewrites contact's address, only the last Via header
can contain the source address of registered endpoint.
Also Call-Id header may contain the source address of registered
endpoint.
Added "via_addr", "via_port", "call_id" to contact.
Added new fields ViaAddress, CallID to AMI event ContactStatus.
ASTERISK-26011
Change-Id: I36bcc0bf422b3e0623680152d80486aeafe4c576
Diffstat (limited to 'res/res_pjsip/pjsip_options.c')
-rw-r--r-- | res/res_pjsip/pjsip_options.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c index 62640fe4e..1114336bd 100644 --- a/res/res_pjsip/pjsip_options.c +++ b/res/res_pjsip/pjsip_options.c @@ -1156,6 +1156,16 @@ static int format_contact_status(void *obj, void *arg, int flags) ast_str_append(&buf, 0, "URI: %s\r\n", contact->uri); ast_str_append(&buf, 0, "UserAgent: %s\r\n", contact->user_agent); ast_str_append(&buf, 0, "RegExpire: %ld\r\n", contact->expiration_time.tv_sec); + if (!ast_strlen_zero(contact->via_addr)) { + ast_str_append(&buf, 0, "ViaAddress: %s", contact->via_addr); + if (contact->via_port) { + ast_str_append(&buf, 0, ":%d", contact->via_port); + } + ast_str_append(&buf, 0, "\r\n"); + } + if (!ast_strlen_zero(contact->call_id)) { + ast_str_append(&buf, 0, "CallID: %s\r\n", contact->call_id); + } ast_str_append(&buf, 0, "Status: %s\r\n", ast_sip_get_contact_status_label(status->status)); if (status->status == UNKNOWN) { ast_str_append(&buf, 0, "RoundtripUsec: N/A\r\n"); |