Android Question Sip Register Problem

Hakanunver

Member
Licensed User
Hello,
We think our company buy B4X product.. we start use today trial app. We Try sip sample application . But this code note registered .. we try on asterisk , and diffrent servers. but same problem.

/
Activity_Create(FirstTime As Boolean)
If Sip.IsInitialized = False Then
'Check if SIP and VOIP are supported.
If Sip.IsSipSupported = False Or Sip.IsVoipSupported = False Then
Log("Not supported.")
ToastMessageShow("SIP not supported.", True)
Else
'Register with the VOIP service

Sip.Initialize2("SIP", "sip:[email protected]", "1234")

If Sip.IsInitialized = True Then
Log("init ok")
Sip.Register

Else
Log("init fail")
End If
End If
End If

//

server log :

//
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.149:44354;branch=z9hG4bK1e2bdae25a89e87f49470dde66e58078313331;received=192.168.1.149;rport=44354
From: <sip:[email protected]>;tag=3833725293
To: <sip:[email protected]>;tag=as0185069e
Call-ID: [email protected]
CSeq: 1016 REGISTER
Server: FPBX-2.11.0(11.20.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="6601babf"
Content-Length: 0


//


please help..
 

Hakanunver

Member
Licensed User
Please use [code]code here...[/code] tags when posting code.

Can you post the device logs?

Are you sure that the password is correct?


Hello Erel;

B4X:
Sub Activity_Create(FirstTime As Boolean)
    If Sip.IsInitialized = False Then
        'Check if SIP and VOIP are supported.
        If Sip.IsSipSupported = False Or Sip.IsVoipSupported = False Then
            Log("Not supported.")
            ToastMessageShow("SIP not supported.", True)
        Else
            'Register with the VOIP service
           
            Sip.Initialize2("SIP", "sip:[email protected]", "1234")
           
            If Sip.IsInitialized = True Then
            Log("init ok")
                Sip.Register
               
            Else
                Log("init fail")
                End If
            End If
        End If

B4x Logs:



** Activity (main) Create, isFirst = true **
init ok
** Activity (main) Resume **
Failed, ErrorCode=-10, Message=no data connection
Registering
Failed, ErrorCode=-5, Message=registration timed out
Registering
Failed, ErrorCode=-9, Message=cannot initiate a new transaction to execute: com.android.server.sip.SipSessionGroup$RegisterCommand[source=com.android.server.sip.SipSessionGroup@acad15d]
Registering
Failed, ErrorCode=-9, Message=cannot initiate a new transaction to execute: com.android.server.sip.SipSessionGroup$RegisterCommand[source=com.android.server.sip.SipSessionGroup@acad15d]
Registering
Failed, ErrorCode=-5, Message=registration timed out
Registering
Failed, ErrorCode=-5, Message=registration timed out




Server Logs : User name and pass word is right :)



<--- Transmitting (no NAT) to 192.168.1.149:49775 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.149:49775;branch=z9hG4bKba6d71471520065d2a871a3242a97314373736;received=192.168.1.149;rport=49775
From: <sip:[email protected]>;tag=2733533607
To: <sip:[email protected]>;tag=as7c31fefe
Call-ID: [email protected]
CSeq: 5364 REGISTER
Server: FPBX-2.11.0(11.20.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="30f18d9f"
Content-Length: 0


[plain]


I try same operations iptel.org ..
my account register Uri : sip:[email protected]
pass : 8922zkr

but same errors.
 
Upvote 0

Hakanunver

Member
Licensed User
I've tested it with your iptel account and it registered successfully. It was tested with Nexus 5X. Try to test it with a different device and see whether you get different results.

The SIP implementation is part of the OS.


Hello Erel My Test Device Nexus 6.
Your device how connect internet ? wifi or GSM Network ?
 
Upvote 0

Hakanunver

Member
Licensed User
Dear Erel I solved Registration problems. Native sip client only works stable English language.
if changed phone language english sip account is working perfect :)
 
Upvote 0
Top