I’ve been working on an interactive XMPP interface so users at my office can interact with the timeclock and queues by XMPP (in addition to IVR menu, which has been running just fine for quite a while before the XMPP interface). I’m using sendtodialplan=yes to handling the incoming unsolicited messages, and typically will have at least one point of interaction where Asterisk requests authentication from the user and then waits with XMPP_RECEIVE for the response. Asterisk then processes the reply and finishes out the “call” as expected, no problems there. However, I’m seeing some behavior that I don’t really expect after the call finishes.
After my call finishes, sendtodialplan triggers again one time for each message that was sent back (and caught by XMPP_RECEIVE) during the just completed call. I’ve avoided unwanted extra processing by using XMPP_RECEIVE on a short timeout to process incoming unsolicited messages, so the net effect of this extra trigger is one or more “XMPP calls” that trip the 1 second timeout on this XMPP_RECEIVE and then fall through and clean up. However, when I initially started setting this up, my expectation was that sendtodialplan would only trigger on messages that weren’t solicited.
Obviously, it’s not a huge cost and it’s not breaking my implementation. But I wonder if anyone might know of something I’m doing wrong that is causing the “extra” sendtodialplan triggers. Alternately, if this is “expected” or “normal” behavior, I would like to propose that the expected behavior be changed if possible so that sendtodialplan only fires on truly unsolicited messages.