PFLAG_FUNNY_STUN = (1 << 26),
PFLAG_STUN_ENABLED = (1 << 27),
PFLAG_STUN_AUTO_DISABLE = (1 << 28),
- PFLAG_3PCC_PROXY = (1 << 29)
+ PFLAG_3PCC_PROXY = (1 << 29),
+ PFLAG_CALLID_AS_UUID = (1 << 30),
+ PFLAG_UUID_AS_CALLID = (1 << 31)
} PFLAGS;
typedef enum {
} else {
switch_clear_flag(profile, TFLAG_PROXY_MEDIA);
}
+ } else if (!strcasecmp(var, "inbound-use-callid-as-uuid")) {
+ if (switch_true(val)) {
+ profile->pflags |= PFLAG_CALLID_AS_UUID;
+ } else {
+ profile->pflags &= ~PFLAG_CALLID_AS_UUID;
+ }
+ } else if (!strcasecmp(var, "outbound-use-uuid-as-callid")) {
+ if (switch_true(val)) {
+ profile->pflags |= PFLAG_UUID_AS_CALLID;
+ } else {
+ profile->pflags &= ~PFLAG_UUID_AS_CALLID;
+ }
} else if (!strcasecmp(var, "NDLB-received-in-nat-reg-contact")) {
if (switch_true(val)) {
profile->pflags |= PFLAG_RECIEVED_IN_NAT_REG_CONTACT;
switch_set_flag(profile, TFLAG_LATE_NEGOTIATION);
} else if (!strcasecmp(var, "inbound-proxy-media") && switch_true(val)) {
switch_set_flag(profile, TFLAG_PROXY_MEDIA);
+ } else if (!strcasecmp(var, "inbound-use-callid-as-uuid")) {
+ if (switch_true(val)) {
+ profile->pflags |= PFLAG_CALLID_AS_UUID;
+ } else {
+ profile->pflags &= ~PFLAG_CALLID_AS_UUID;
+ }
+ } else if (!strcasecmp(var, "outbound-use-uuid-as-callid")) {
+ if (switch_true(val)) {
+ profile->pflags |= PFLAG_UUID_AS_CALLID;
+ } else {
+ profile->pflags &= ~PFLAG_UUID_AS_CALLID;
+ }
} else if (!strcasecmp(var, "NDLB-received-in-nat-reg-contact") && switch_true(val)) {
profile->pflags |= PFLAG_RECIEVED_IN_NAT_REG_CONTACT;
} else if (!strcasecmp(var, "aggressive-nat-detection") && switch_true(val)) {
return;
}
- if (!sofia_endpoint_interface || !(session = switch_core_session_request(sofia_endpoint_interface, NULL))) {
+ if (sofia_endpoint_interface) {
+ if (tech_pvt->profile->pflags & PFLAG_CALLID_AS_UUID) {
+ session = switch_core_session_request_uuid(sofia_endpoint_interface, NULL, sip->sip_call_id->i_id);
+ } else {
+ session = switch_core_session_request(sofia_endpoint_interface, NULL);
+ }
+ }
+
+ if (!session) {
nua_respond(nh, 503, "Maximum Calls In Progress", SIPTAG_RETRY_AFTER_STR("300"), TAG_END());
return;
}
from_str = switch_core_session_sprintf(session, "\"%s\" <%s>", tech_pvt->caller_profile->caller_id_name, use_from_str);
if (!(call_id = switch_channel_get_variable(channel, "sip_outgoing_call_id"))) {
- call_id = switch_core_session_get_uuid(session);
+ if (tech_pvt->profile->pflags & PFLAG_UUID_AS_CALLID) {
+ call_id = switch_core_session_get_uuid(session);
+ }
}
tech_pvt->nh = nua_handle(tech_pvt->profile->nua, NULL,