mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
support referTo with tel: prefix (#1297)
* support referTo with tel: prefix * fix review comment
This commit is contained in:
@@ -111,7 +111,12 @@ class TaskSipRefer extends Task {
|
||||
/* get IP address of the SBC to use as hostname if needed */
|
||||
const {host} = parseUri(dlg.remote.uri);
|
||||
|
||||
if (!referTo.startsWith('<') && !referTo.startsWith('sip') && !referTo.startsWith('"')) {
|
||||
if (
|
||||
!referTo.startsWith('<') &&
|
||||
!referTo.startsWith('sip:') &&
|
||||
!referTo.startsWith('"') &&
|
||||
!referTo.startsWith('tel:')
|
||||
) {
|
||||
/* they may have only provided a phone number/user */
|
||||
referTo = `sip:${referTo}@${host}`;
|
||||
}
|
||||
@@ -124,7 +129,12 @@ class TaskSipRefer extends Task {
|
||||
if (!referredByDisplayName) {
|
||||
referredByDisplayName = cs.req?.callingName;
|
||||
}
|
||||
if (!referredBy.startsWith('<') && !referredBy.startsWith('sip') && !referredBy.startsWith('"')) {
|
||||
if (
|
||||
!referredBy.startsWith('<') &&
|
||||
!referredBy.startsWith('sip:') &&
|
||||
!referredBy.startsWith('"') &&
|
||||
!referredBy.startsWith('tel:')
|
||||
) {
|
||||
/* they may have only provided a phone number/user */
|
||||
referredBy = `${referredByDisplayName ? `"${referredByDisplayName}"` : ''}<sip:${referredBy}@${host}>`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user