[Solved] PJSIP Contact was deleted while dialing extension

Hello,
I have a very strange problem with pjsip and odbc.

System:
Ubuntu VM configured as described in the book “Asterisk The definitive Guide 5th Edition”. Because they describe it for CentOS there are some minor changes.

When I configure the system without realtime db access everything is fine.

Situation when I want to use realtime with mysql odbc:
I register my 2 phones:

-- Added contact 'sip:00156594E191@10.20.30.131:5060' to AOR '00156594E191' with expiration of 3600 seconds
  == Endpoint 00156594E191 is now Reachable
  == Endpoint 0015659491C3 is now Reachable
    -- Added contact 'sip:0015659491C3@10.20.30.116:5060' to AOR '0015659491C3' with expiration of 3600 secondsode here

Now I have 2 rows in table ps_contacs.

When I try to call the second phone from the first this happens:

    -- Added contact 'sip:0015659491C3@10.20.30.116:5060' to AOR '0015659491C3' with expiration of 3600 seconds
  == Setting global variable 'SIPDOMAIN' to '10.20.30.242'
    -- Executing [101@intern:1] Gosub("PJSIP/00156594E191-00000001", "subDialUser,101,1(PJSIP/0015659491C3,101,default,10)") in new stack
    -- Executing [101@subDialUser:1] NoOp("PJSIP/00156594E191-00000001", "Dial extension 101,channel: PJSIP/0015659491C3, mailbox: 101") in new stack
    -- Executing [101@subDialUser:2] NoOp("PJSIP/00156594E191-00000001", "mboxcontext: default, timeout 10") in new stack
    -- Executing [101@subDialUser:3] Dial("PJSIP/00156594E191-00000001", "PJSIP/0015659491C3,10") in new stack
[Nov 30 18:04:36] ERROR[3220]: res_pjsip.c:3533 ast_sip_create_dialog_uac: Endpoint '0015659491C3': Could not create dialog to invalid URI '0015659491C3'.  Is endpoint registered and reachable?
[Nov 30 18:04:36] ERROR[3220]: chan_pjsip.c:2649 request: Failed to create outgoing session to endpoint '0015659491C3'
[Nov 30 18:04:36] WARNING[3225][C-00000002]: app_dial.c:2578 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [101@subDialUser:4] GotoIf("PJSIP/00156594E191-00000001", "0?busy:unavail") in new stack
    -- Goto (subDialUser,101,5)
    -- Executing [101@subDialUser:5] VoiceMail("PJSIP/00156594E191-00000001", "101@default,u") in new stack
       > 0x7f70d00146b0 -- Strict RTP learning after remote address set to: 10.20.30.131:12174
  == Contact 0015659491C3/sip:0015659491C3@10.20.30.116:5060 has been deleted
  == Endpoint 0015659491C3 is now Unreachable
       > 0x7f70d00146b0 -- Strict RTP switching to RTP target address 10.20.30.131:12174 as source
    -- <PJSIP/00156594E191-00000001> Playing 'vm-theperson.slin' (language 'en')
    -- <PJSIP/00156594E191-00000001> Playing 'digits/1.slin' (language 'en')
    -- <PJSIP/00156594E191-00000001> Playing 'digits/0.slin' (language 'en')
    -- <PJSIP/00156594E191-00000001> Playing 'digits/1.slin' (language 'en')
  == Spawn extension (subDialUser, 101, 5) exited non-zero on 'PJSIP/00156594E191-00000001'

As you can see the contact row was deleted. So I have now only one row in ps_contacts.

When I execute “pjsip show endpoints” all existing (at this time the last one) phones were deleted:

pjsip show endpoints

 Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
    I/OAuth:  <AuthId/UserName...........................................................>
        Aor:  <Aor............................................>  <MaxContact>
      Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
  Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
   Identify:  <Identify/Endpoint.........................................................>
        Match:  <criteria.........................>
    Channel:  <ChannelId......................................>  <State.....>  <Time.....>
        Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================

 Endpoint:  0015659491C3                                         Unavailable   0 of inf
     InAuth:  0015659491C3/0015659491C3
        Aor:  0015659491C3                                       1
  Transport:  transport-udp             udp      0      0  0.0.0.0:5060

 Endpoint:  00156594E191                                         Not in use    0 of inf
     InAuth:  00156594E191/00156594E191
        Aor:  00156594E191                                       1
  Transport:  transport-udp             udp      0      0  0.0.0.0:5060


Objects found: 2

  == Contact 00156594E191/sip:00156594E191@10.20.30.131:5060 has been deleted
  == Endpoint 00156594E191 is now Unreachable

Here is the debug output from the 1. part (dialing phone 2 from phone1 = phone 2 was deleted)

[Nov 30 18:13:51] DEBUG[2933] res_pjsip/pjsip_distributor.c: Could not find matching transaction for Request msg REGISTER/cseq=1 (rdata0x7f70e4002138)
[Nov 30 18:13:51] DEBUG[2933] res_pjsip/pjsip_distributor.c: Calculated serializer pjsip/distributor-0000002d to use for Request msg REGISTER/cseq=1 (rdata0x7f70e4002138)
[Nov 30 18:13:51] DEBUG[3324] netsock2.c: Splitting '10.20.30.131' into...
[Nov 30 18:13:51] DEBUG[3324] netsock2.c: ...host '10.20.30.131' and port ''.
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_endpoint_id_ips WHERE id LIKE ? ORDER BY id
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id LIKE') = '%'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] res_pjsip_endpoint_identifier_ip.c: No identify sections to match against
[Nov 30 18:13:51] DEBUG[3324] res_pjsip_endpoint_identifier_user.c: Attempting identify by From username '00156594E191' domain '10.20.30.242'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id') = '00156594E191@10.20.30.242'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_domain_aliases WHERE id = ?
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id') = '10.20.30.242'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id') = '00156594E191'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] res_sorcery_realtime.c: Filtering out realtime field 'disallow' from retrieval
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [1800] in [0, 4294967295] gives [1800](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [1] in [0, 4294967295] gives [1](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [1] in [0, 4294967295] gives [1](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [90] in [0, 4294967295] gives [90](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] res_pjsip_endpoint_identifier_user.c: Identified by From username '00156594E191' domain '10.20.30.242'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_auths WHERE id = ?
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id') = '00156594E191'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [32] in [0, 4294967295] gives [32](0)
[Nov 30 18:13:51] DEBUG[3324] res_pjsip_authenticator_digest.c: Using default realm 'asterisk' on incoming auth '00156594E191'.
[Nov 30 18:13:51] DEBUG[3324] netsock2.c: Splitting '10.20.30.242' into...
[Nov 30 18:13:51] DEBUG[3324] netsock2.c: ...host '10.20.30.242' and port ''.
[Nov 30 18:13:51] DEBUG[3324] netsock2.c: Splitting '10.20.30.131' into...
[Nov 30 18:13:51] DEBUG[3324] netsock2.c: ...host '10.20.30.131' and port ''.
[Nov 30 18:13:51] DEBUG[2933] res_pjsip/pjsip_distributor.c: Could not find matching transaction for Request msg REGISTER/cseq=2 (rdata0x7f70e4002138)
[Nov 30 18:13:51] DEBUG[2933] res_pjsip/pjsip_distributor.c: Calculated serializer pjsip/distributor-0000002d to use for Request msg REGISTER/cseq=2 (rdata0x7f70e4002138)
[Nov 30 18:13:51] DEBUG[3324] netsock2.c: Splitting '10.20.30.131' into...
[Nov 30 18:13:51] DEBUG[3324] netsock2.c: ...host '10.20.30.131' and port ''.
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_endpoint_id_ips WHERE id LIKE ? ORDER BY id
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id LIKE') = '%'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] res_pjsip_endpoint_identifier_ip.c: No identify sections to match against
[Nov 30 18:13:51] DEBUG[3324] res_pjsip_endpoint_identifier_user.c: Attempting identify by From username '00156594E191' domain '10.20.30.242'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id') = '00156594E191@10.20.30.242'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_domain_aliases WHERE id = ?
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id') = '10.20.30.242'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id') = '00156594E191'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] res_sorcery_realtime.c: Filtering out realtime field 'disallow' from retrieval
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [1800] in [0, 4294967295] gives [1800](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [1] in [0, 4294967295] gives [1](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [1] in [0, 4294967295] gives [1](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [90] in [0, 4294967295] gives [90](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] res_pjsip_endpoint_identifier_user.c: Identified by From username '00156594E191' domain '10.20.30.242'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_auths WHERE id = ?
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id') = '00156594E191'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [32] in [0, 4294967295] gives [32](0)
[Nov 30 18:13:51] DEBUG[3324] res_pjsip_authenticator_digest.c: Using default realm 'asterisk' on incoming auth '00156594E191'.
[Nov 30 18:13:51] DEBUG[3324] res_pjsip_authenticator_digest.c: Calculated nonce 1575134031/7819820e42d7fc218ac17181a7dea939. Actual nonce is 1575134031/7819820e42d7fc218ac17181a7dea939
[Nov 30 18:13:51] DEBUG[3324] netsock2.c: Splitting '10.20.30.242' into...
[Nov 30 18:13:51] DEBUG[3324] netsock2.c: ...host '10.20.30.242' and port ''.
[Nov 30 18:13:51] DEBUG[3324] netsock2.c: Splitting '10.20.30.131' into...
[Nov 30 18:13:51] DEBUG[3324] netsock2.c: ...host '10.20.30.131' and port ''.
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_domain_aliases WHERE id = ?
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id') = '10.20.30.242'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] res_pjsip_registrar.c: Matched id '00156594E191' to aor '00156594E191'
[Nov 30 18:13:51] DEBUG[3324] res_pjsip_registrar.c: Matched aor '00156594E191' by To username
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_aors WHERE id = ?
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id') = '00156594E191'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] config.c: extract double from [3.0] in [-inf, inf] gives [3.000000](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [7200] in [0, 4294967295] gives [7200](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [3600] in [0, 4294967295] gives [3600](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [60] in [0, 4294967295] gives [60](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [1] in [0, 4294967295] gives [1](0)
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_contacts WHERE id LIKE ? ORDER BY id
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id LIKE') = '00156594E191;@%'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] config.c: extract double from [3.0] in [-inf, inf] gives [3.000000](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: INSERT INTO ps_contacts (id, via_addr, qualify_timeout, call_id, reg_server, prune_on_boot, path, endpoint, via_port, authenticate_qualify, uri, qualify_frequency, user_agent, expiration_time, outbound_proxy) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id') = '00156594E191;@17b0c485200c2590f8a9039c526e0a89'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 2 ('via_addr') = '10.20.30.131'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 3 ('qualify_timeout') = '3.000000'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 4 ('call_id') = '0_3258360544@10.20.30.131'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 5 ('reg_server') = ''
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 6 ('prune_on_boot') = 'no'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 7 ('path') = ''
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 8 ('endpoint') = '00156594E191'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 9 ('via_port') = '5060'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 10 ('authenticate_qualify') = 'no'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 11 ('uri') = 'sip:00156594E191@10.20.30.131:5060'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 12 ('qualify_frequency') = '0'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 13 ('user_agent') = 'Yealink SIP-T46G 28.83.0.120'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 14 ('expiration_time') = '1575137631'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 15 ('outbound_proxy') = ''
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[2910] threadpool.c: Increasing threadpool sorcery/pool's size by 1
[Nov 30 18:13:51] VERBOSE[3324] res_pjsip_registrar.c: Added contact 'sip:00156594E191@10.20.30.131:5060' to AOR '00156594E191' with expiration of 3600 seconds
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_aors WHERE id = ?
[Nov 30 18:13:51] DEBUG[3324] res_config_odbc.c: Parameter 1 ('id') = '00156594E191'
[Nov 30 18:13:51] DEBUG[3324] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[3324] config.c: extract double from [3.0] in [-inf, inf] gives [3.000000](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [7200] in [0, 4294967295] gives [7200](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [3600] in [0, 4294967295] gives [3600](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [60] in [0, 4294967295] gives [60](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[3324] config.c: extract uint from [1] in [0, 4294967295] gives [1](0)
[Nov 30 18:13:51] DEBUG[3325] res_pjsip/pjsip_options.c: An unqualified contact has been added to AOR '00156594E191' so it is now available
[Nov 30 18:13:51] DEBUG[3325] res_pjsip/pjsip_options.c: Endpoint state compositor '00156594E191' is online as AOR '00156594E191' is available
[Nov 30 18:13:51] VERBOSE[3325] res_pjsip/pjsip_configuration.c: Endpoint 00156594E191 is now Reachable
[Nov 30 18:13:51] DEBUG[2916] devicestate.c: No provider found, checking channel drivers for PJSIP - 00156594E191
[Nov 30 18:13:51] DEBUG[2916] res_odbc.c: Reusing ODBC handle 0x560d15ff8fc0 from class 'asterisk'
[Nov 30 18:13:51] DEBUG[2916] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Nov 30 18:13:51] DEBUG[2916] res_config_odbc.c: Parameter 1 ('id') = '00156594E191'
[Nov 30 18:13:51] DEBUG[2916] res_odbc.c: Releasing ODBC handle 0x560d15ff8fc0 into pool
[Nov 30 18:13:51] DEBUG[2916] res_sorcery_realtime.c: Filtering out realtime field 'disallow' from retrieval
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [1800] in [0, 4294967295] gives [1800](0)
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [1] in [0, 4294967295] gives [1](0)
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [1] in [0, 4294967295] gives [1](0)
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [90] in [0, 4294967295] gives [90](0)
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[2916] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Nov 30 18:13:51] DEBUG[2916] devicestate.c: Changing state for PJSIP/00156594E191 - state 1 (Not in use)

Any help would be greatly appreceated.

Thanks in advance

Buschi

Hello again,

I found a solution:

If anyone runs into the same trouble you should read:

https://community.asterisk.org/t/realtime-pjsip-trouble-failed-to-create-outgoing-session/79914/17

But don`t forget to update odbcinst.ini after changing the driver! - like me ;-))

The link provided by peter doesn`t work anymore. I found the driver at:

https://community.asterisk.org/t/realtime-pjsip-trouble-failed-to-create-outgoing-session/79914/17

Thanks you very much for filling this forum with so many useful informations!

Buschi

Hi @Buschi

I have downgraded the version of ODBC from 8.0 to 5.3.14 in my Centos 7.
and got two .so file in /usr/lib64/
libmyodbc5a.so
libmyodbc5w.so

and also change in odbcinst.ini.
But after that asterisk is not starting and giving error in console of not loading odbc.so.

Please Look into my configuration.

odbcinst.ini
[MySQL]
Description=ODBC for MySQL
Driver=/usr/lib64/libmyodbc5a.so
Setup = /usr/lib64/libodbcmyS.so
FileUsage = 1

odbc.ini

[ABC]
Driver = MySQL
Description = MySQL connection to ‘asterisk’ database
ServerName = localhost
Port = 3306
Database = XXXX
UserName = root
Password = XXXX
Socket = /var/lib/mysql/mysql.sock
option = 3

Please suggest.