public void setAsText(String text) throws IllegalArgumentException { try { int delimerSize = 2; int delimiter = text.indexOf(": "); if (delimiter == -1) { delimerSize = 1; delimiter = text.indexOf(":"); } if (delimiter == -1) { throw new IllegalArgumentException("text arg should be \"address plan as string\" + \": \" + \"address as string\""); } String addressPlan = text.substring(0,delimiter); String address = text.substring(delimiter+delimerSize); this.setValue(new Address(AddressPlan.fromString(addressPlan),address)); } catch (Throwable ex) { throw new IllegalArgumentException(ex.getMessage(),ex); } }
/** * Attempt to find a Backup Address, but the method returns null if there * isn't any address to forward the INVITE. */ private Address getBackupAddress(String sipAddress) { Address backupAddress = null; CallControlProfileCMP profile = this.lookup(new javax.slee.Address( AddressPlan.SIP, sipAddress)); if (profile != null) { javax.slee.Address address = profile.getBackupAddress(); if (address != null) { try { backupAddress = getAddressFactory().createAddress( address.getAddressString()); } catch (ParseException e) { log.error(e.getMessage(), e); } } } return backupAddress; }
/** * Stores the attr value, converting and storing in the string field of the * entity * * @param attrValue */ public void setAddress(Address attrValue) { if (attrValue != null) { setString(attrValue.toString()); } else { setString(null); } setSerializable(attrValue); }
public void verifyAddress(Address address) throws ProfileVerificationException { // Check address plan if (address.getAddressPlan() != AddressPlan.SIP) throw new ProfileVerificationException("Address \"" + address + "\" is not a SIP address"); // Check URI scheme - must be sip: or sips: String uri = address.getAddressString().toLowerCase(); if (!(uri.startsWith("sip:") || uri.startsWith("sips:"))) throw new ProfileVerificationException("Address \"" + address + "\" is not a SIP address"); }
buff.append("null"); else buff.append(address.toString()); } else buff.append("null"); if ( logger.isDebugEnabled() ) { logger.debug("profileName = " + profileName + " addressString = " + selector.getAddress().getAddressString());
public String toString() { return new StringBuffer().append("SleeEventImpl.toString() = { "). append("\n eventID = " + eventID). append("\n activitycontext = " + activityContextId). append("\n eventObject = " + eventObject). append("\n address = " + ( address != null ? address.getAddressString() : null )). append("\n activity = " + activity). append("}").toString(); }
/** * * @param profileEntityAfterAction */ AbstractProfileEvent(ProfileEntity profileEntityAfterAction, ProfileManagementImpl profileManagement) { this.profileManagement = profileManagement; this.profileAfterAction = profileEntityAfterAction; this.profileAddress = new Address(AddressPlan.SLEE_PROFILE, profileEntityAfterAction.getTableName() + "/" + profileEntityAfterAction.getProfileName()); this.profileID = new ProfileID(this.profileAddress); }
/** * Attempt to find a Backup Address, but the method returns null if there * isn't any address to forward the INVITE. */ private Address getBackupAddress(String sipAddress) { Address backupAddress = null; CallControlProfileCMP profile = this.lookup(new javax.slee.Address(AddressPlan.SIP, sipAddress)); if (profile != null) { javax.slee.Address address = profile.getBackupAddress(); if (address != null) { try { backupAddress = getAddressFactory().createAddress(address.getAddressString()); } catch (ParseException e) { log.severe(e.getMessage(), e); } } } return backupAddress; }
Address[] blockedAddresses = {new Address(AddressPlan.SIP, "sip:restcomm@"+domain),new Address(AddressPlan.SIP, "sip:hugo@"+domain)}; newProfile(adaptor,sci,profileTableName, "torosvi", "sip:torosvi@"+domain, blockedAddresses, null, true, user,password); log.info("********** CREATED PROFILE: torosvi **********"); log.info("********** CREATED PROFILE: mobicents **********"); Address backupAddress = new Address(AddressPlan.SIP, "sip:torosvi@"+domain); newProfile(adaptor,sci,profileTableName, "victor", "sip:victor@"+domain, null, backupAddress, false,user,password); log.info("********** CREATED PROFILE: victor **********");
/** * Attempt to find a list of Blocked Addresses (SIP URIs), but the method * returns null if the called user (sipAddress) does not block to any user. */ private ArrayList getBlockedArrayList(String sipAddress) { //sipAddress is AOR: sip:newbie@restcomm.com ArrayList uris = null; CallControlProfileCMP profile = super.lookup(new Address(AddressPlan.SIP, sipAddress)); if (profile != null) { Address[] addresses = profile.getBlockedAddresses(); if (addresses != null) { uris = new ArrayList(addresses.length); for (int i = 0; i < addresses.length; i++) { String address = addresses[i].getAddressString(); try { SipURI uri = (SipURI) getAddressFactory().createURI(address); uris.add(uri); } catch (ParseException e) { log.severe(e.getMessage(), e); } } } } return uris; }
/** * To know whether or not the called user has the Voice Mail service * enabled. * * @param sipAddress * : Called user address. * @return boolean: TRUE -> Voice Mail enabled. FALSE -> Voice Mail disabled * for the given user identified by sip address. */ private boolean isSubscriber(String sipAddress) { boolean state = false; CallControlProfileCMP profile = lookup(new Address(AddressPlan.SIP, sipAddress)); log.info("Retrieved CallControllProfile["+(profile!=null)+"] for user: "+sipAddress); if (profile != null) { state = profile.getVoicemailState(); } return state; }
address = new Address(AddressPlan.IP, this.MAGIIP );
protected void fireEvent(RequestEvent event, TransferActivity activity, String address) throws UnrecognizedActivityHandleException, IllegalEventException, ActivityIsEndingException, NullPointerException, SLEEException, FireEventException { if (trc.isFineEnabled()) trc.fine("About to fire event " + EventIDCache.getEventName(event)); FireableEventType eventType = eventIdCache.getEventType(eventLookup, event); sleeEndpoint.fireEvent(getActivityHandle(activity), eventType, event, new javax.slee.Address(AddressPlan.IP, address), null); }
Address userAddress = new Address(AddressPlan.SIP, callee); Attribute userAttr = new Attribute("UserAddress", userAddress); Attribute blockedAttr = new Attribute("BlockedAddresses", block);
protected void fireEvent(RequestEvent event, TransferActivity activity, String address) throws UnrecognizedActivityHandleException, IllegalEventException, ActivityIsEndingException, NullPointerException, SLEEException, FireEventException { if (trc.isFineEnabled()) trc.fine("About to fire event " + EventIDCache.getEventName(event)); FireableEventType eventType = eventIdCache.getEventType(eventLookup, event); sleeEndpoint.fireEvent(getActivityHandle(activity), eventType, event, new javax.slee.Address(AddressPlan.IP, address), null); }
Address profileAddress = new Address(AddressPlan.SLEE_PROFILE, profileTableName + "/" + profileName); ProfileTableActivityImpl profileTableActivity = this
Address profileAddress = new Address(AddressPlan.SLEE_PROFILE, profileTableName + "/" + profileName); ProfileTableActivityContextInterfaceFactoryImpl profileTableActivityContextInterfaceFactory;
protected void fireEvent(String eventName, Object activity, SmppEvent event) { final ActivityHandle handle = this.getActivityHandle(activity); final FireableEventType eventType = eventTypeCache.getEventType(eventLookup, eventName); if (eventTypeFilter.filterEvent(eventType)) { if (tracer.isFineEnabled()) { tracer.fine("event " + eventName + " filtered"); } return; } final Address address = new Address(AddressPlan.E164_MOBILE, event.getMessage().getOriginator()); try { sleeEndpoint.fireEvent(handle, eventType, event, address, null, EVENT_FLAGS); if (tracer.isInfoEnabled()) { tracer.info("Fired event: " + eventName); } } catch (Throwable e) { tracer.severe("Failed to fire event", e); } }
protected void fireEvent(String eventName, SmppTransactionImpl activity, Object event) { final ActivityHandle handle = this.getActivityHandle(activity); if (handle == null) { this.tracer.warning("Firing event " + eventName + " for null ActivityHandle Activity=" + activity); return; } final FireableEventType eventType = eventTypeCache.getEventType(eventLookup, eventName); if (eventTypeFilter.filterEvent(eventType)) { if (tracer.isFineEnabled()) { tracer.fine("event " + eventName + " filtered"); } return; } final String addressStr = this.utils.getAddressForEventFire(activity.getSmppRequest()); final Address address = new Address(AddressPlan.E164_MOBILE, addressStr); try { sleeEndpoint.fireEvent(handle, eventType, event, address, null); if (tracer.isInfoEnabled()) { tracer.info("Fired event: " + eventName); } } catch (Throwable e) { tracer.severe("Failed to fire event", e); } }