5 Replies Latest reply on Mar 12, 2015 3:11 PM by Kevin Hawkins

    Asterisk-IM to Asterisk: remote users stuck On The Phone

      HI all,


      I know i've been asking a lot of questions lately..


      But still, i have a problem that drives me crazy. The thing is, i have openfire with asterisk-im. and in asterisk-im i have added four asterisk server connections (ami port - 5038). two of these asterisk servers are within the same LAN as openfire/asterisk-im. and other two asterisk servers are in remote locations connected through VPN.


      Now, everything is working, phone mappings, calls, etc..


      But i have problem with presence and On The Phone status. Actually, everything is working fine with the two asterisk servers that are in the same LAN as openfire server.

      But the other two, that are connecting through VPN to my oipenfire server are having problems - a user (from one the remote asterisk servers) that initiates a call goes On The Phone and stays stuck in this status forever. It goes again to Online only after asterisk-im has been restarted.


      Now, can someone please provide a hint where i should search for a solution? is it some problem with NATing? i have all ports opened on these routes.. and still, i'm having the same problem.


      How asterisk sends information about presence changes to Openfire? is it via AMI port (5038)?? if it is using the same port, how come it si able to send messages to initate a call and initiate On The Phone presence, but not able to send the signal that user has hang-up? or is it using some other port for the hang-up messages?


      Also, i am even willing to forget abt On The Phone presence, if someone can tell me where in MysSQL db is that flag stored, and ill make a mysql script that shall set it to online every minute or so.. just to avoid all my remote users staying On The Phone 99% of time.



      Thanks in advance!!!!

        • Asterisk-IM to Asterisk: remote users stuck On The Phone

          just to make it clear:



          openfire - asterisk  within the same LAN = everything is OK


          openfire - asterisk  through VPN = everything is OK except going back to Online once a call is terminated

          • Asterisk-IM to Asterisk: remote users stuck On The Phone

            ok, i guess this could be a monologue


            I eventually solved the problem. Once i spent days eliminating all other possibilities (NAT complications, masquearding, bugs in Java, etc.) i was left with one single possible cause for this: latency


            And it turned out that Asterisk's manager.conf has a parameter called writetimeout which "sets the timeout used by Asterisk when writing data to the AMI connection for this user" (in this case, this user is Openfire). By default, this value is 100ms which is usually enough when Openfire server is within the same LAN as Asterisk server. But for WAN and geographically distributed architectures, ping/latency is usually much more. I  increased  writetimeout from 100 to 1000 and it worked like a charm.


            If it was only explicitly stated within manager.conf by default.. it could have saved me a lot of time. I would have seen it and experimented with its values. Anyway, that solves the problem.

            • Re: Asterisk-IM to Asterisk: remote users stuck On The Phone

              Dear Marko,



              I am new to the communicty. i am working on openfire to asterisk integration from a couple of days. but i am unable to solve the issue, when i am trying to activate client from asterisk side i am getting following error

                                       manager.c: tried to authenticate with nonexistent user '6010'

              NOTICE[5894] manager.c: failed to authenticate as '6010'

              NOTICE[6036] manager.c: tried to authenticate with nonexistent user '6010'

              NOTICE[6036] manager.c: failed to authenticate as '6010'


              Please help me to get out of this issue


              My ASTERIK-IM Details:

              server name:

              server address:





              Thanks in advance