そのため、コンパイルして実行中の Siphon アプリがありますが、呼び出しが行われません。私は得る:
登録エラー - デフォルトのエラー メッセージ。
完全なエラーは次のとおりです。
15:04:02.032 pjsua_call.c acc #0 で sip:6476805821@voip5-2.acanac.com に電話をかけています 15:04:02.032 pjsua_call.c .アカウントが無効なため電話をかけられません: 無効な操作 (PJ_EINVALIDOP) [status=70013] 15:04:05.580 call.m 発信エラー: 無効な操作 (PJ_EINVALIDOP) [status=70013]
しかし、別の SIP アプリで同じアカウントを使用すると、問題なく動作します。
pjsip が sip_dial_with_uri(_sip_acc_id, [url UTF8String], &call_id); を呼び出すと、
_sip_acc_id は 0 です。これは、サイフォンの設定にある 0 番目のアカウントだと思われるためです。url は、ダイヤルしようとしている正しい電話番号ですが、sip:62304892@url.com のようなものを示しています。また、通話 ID は単なる参照であるため、重要かどうかはわかりません。
他の voip アプリを見ると、登録プロセスがあります。ユーザー名、パスワード、sip サーバーのドメインまたは IP を入力する場所。
Siphon の場合、これは設定ファイルで行われます。ただし、「登録またはログイン」がサイフォンのコードで行われるかどうかはわかりません。それが問題でしょうか?
これは、実際の呼び出しを試みるコードです。
/** FIXME plutôt à mettre dans l'objet qui gère les appels **/
-(void) dialup:(NSString *)phoneNumber number:(BOOL)isNumber
{
pjsua_call_id call_id;
pj_status_t status;
NSString *number;
UInt32 hasMicro, size;
// Verify if microphone is available (perhaps we should verify in another place ?)
size = sizeof(hasMicro);
AudioSessionGetProperty(kAudioSessionProperty_AudioInputAvailable,
&size, &hasMicro);
/*if (!hasMicro)
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"No Microphone Available", @"SiphonApp")
message:NSLocalizedString(@"Connect a microphone to phone", @"SiphonApp")
delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK", @"SiphonApp")
otherButtonTitles:nil];
[alert show];
[alert release];
return;
}*/
if (isNumber)
number = [self normalizePhoneNumber:phoneNumber];
else
number = phoneNumber;
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"removeIntlPrefix"])
{
number = [number stringByReplacingOccurrencesOfString:@"+"
withString:@""
options:0
range:NSMakeRange(0,1)];
}
else
{
NSString *prefix = [[NSUserDefaults standardUserDefaults] stringForKey:
@"intlPrefix"];
if ([prefix length] > 0)
{
number = [number stringByReplacingOccurrencesOfString:@"+"
withString:prefix
options:0
range:NSMakeRange(0,1)];
}
}
// Manage pause symbol
NSArray * array = [number componentsSeparatedByString:@","];
[callViewController setDtmfCmd:@""];
if ([array count] > 1)
{
number = [array objectAtIndex:0];
[callViewController setDtmfCmd:[array objectAtIndex:1]];
}
if (!isConnected && [self wakeUpNetwork] == NO)
{
_phoneNumber = [[NSString stringWithString: number] retain];
if (isIpod)
{
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:nil
message:NSLocalizedString(@"You must enable Wi-Fi or SIP account to place a call.",@"SiphonApp")
delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK",@"SiphonApp")
otherButtonTitles:nil] autorelease];
[alertView show];
}
else
{
UIActionSheet *actionSheet = [[[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"The SIP server is unreachable!",@"SiphonApp")
delegate:self
cancelButtonTitle:NSLocalizedString(@"Cancel",@"SiphonApp")
destructiveButtonTitle:nil
otherButtonTitles:NSLocalizedString(@"Cellular call",@"SiphonApp"),
nil] autorelease];
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[actionSheet showInView: self.window];
}
return;
}
if ([self sipConnect])
{
NSRange range = [number rangeOfString:@"@"];
NSLog(@"%i", _sip_acc_id);
if (range.location != NSNotFound)
{
status = sip_dial_with_uri(_sip_acc_id, [[NSString stringWithFormat:@"sip:%@", number] UTF8String], &call_id);
}
else
status = sip_dial(_sip_acc_id, [number UTF8String], &call_id);
if (status != PJ_SUCCESS)
{
// FIXME
//[self displayStatus:status withTitle:nil];
const pj_str_t *str = pjsip_get_status_text(status);
NSString *msg = [[NSString alloc]
initWithBytes:str->ptr
length:str->slen
encoding:[NSString defaultCStringEncoding]];
[self displayError:msg withTitle:@"registration error"];
}
}
}
また、誰かが Siphon アプリのコードへのリンクを持っていて、それがより新しく、よりうまく機能する可能性がある場合は、それも感謝します。
より詳しい情報:
call.m ファイルでは、本質的にこれが呼び出されます。
status = pjsua_call_make_call(acc_id, &pj_uri, 0, NULL, NULL, call_id);
そしてここ
acc_id = 0
pj_uri = char *-> "sip:6476805821@voip5-2.acanac.com" pj_ssize_t -> 33
call_id = 803203976