Commit 0a22c8fd authored by Alexandre Lision's avatar Alexandre Lision Committed by Alexandre Lision

call: detect ring calls to prepend 'ring:'

Refs #67102

Change-Id: I7655cf5ffe3c63e459636bdd72e1ed9505627bdb
parent bb306135
......@@ -201,7 +201,17 @@ static NSString* const kCallButtonIdentifer = @"CallButtonIdentifier";
- (IBAction)placeCall:(id)sender
{
Call* c = CallModel::instance()->dialingCall();
c->setDialNumber(QString::fromNSString([callField stringValue]));
// check for a valid ring hash
NSCharacterSet *hexSet = [NSCharacterSet characterSetWithCharactersInString:@"0123456789abcdefABCDEF"];
BOOL valid = [[[callField stringValue] stringByTrimmingCharactersInSet:hexSet] isEqualToString:@""];
if(valid && callField.stringValue.length == 40) {
c->setDialNumber(QString::fromNSString([NSString stringWithFormat:@"ring:%@",[callField stringValue]]));
} else {
c->setDialNumber(QString::fromNSString([callField stringValue]));
}
c << Call::Action::ACCEPT;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment