Issam,

mohqueue was designed to provide a way for unanswered calls to a call center or answer group to be dropped into a holding queue until it could be processed.  While in queue an audio recording would be played for the caller and when a line was open to receive calls it could be directed out of the FIFO queue.  It was not designed to put a call on hold, although that could be a future enhancement.

With regard to the error you identified, it appears that the INVITE did not complete.  You might want to do a SIP trace and look at requests and responses to try to identify why the call failed.

Hope this helps,
Bob

On Mon, Jun 12, 2017 at 4:25 PM, Issam Hambouz <ihambouz@gmail.com> wrote:
Hello!

I am exploring mohqueue module and have few questions:

- Could it be used to provide MOH service for SIP endpoints? I am aware that its main functionality is to queue calls (along playing a MOH for queued calls) and provides a mechanism to retrieve calls (FIFO), but I had the impression, reading several emails in this group, that it can be used in a way to provide MOH whenever a call is put on-hold
-- I tried to use it with the re-INVITE received when a call is put on-hold, but got a log message stating that it works with initial INVITEs only (something like that)

- On a test setup (Kamailio 4.2.3 / 2.0.0), I was able to reach the queue / listen to the MOH but encountered a strange case where the call gets automatically removed from the queue after 4-5 seconds (can be seen removed from kamailio.mohqcalls as well)

Jun 12 22:58:30 - DEBUG: mohqueue [mohq_funcs.c:2369]: mohq_debug(): mohq_process: Processing INVITE, queue (demo)
Jun 12 22:58:30 - DEBUG: mohqueue [mohq_funcs.c:2369]: mohq_debug(): create_call: Added call (<sip:6010@10.110.3.57>;tag=c97a6b26-2bfe-4271-9db1-cee38ea96c47) to queue (demo)
Jun 12 22:58:30 - DEBUG: mohqueue [mohq_funcs.c:2369]: mohq_debug(): first_invite_msg: Making offer for RTP link for call (<sip:6010@10.110.3.57>;tag=c97a6b26-2bfe-4271-9db1-cee38ea96c47)
Jun 12 22:58:30 - DEBUG: mohqueue [mohq_funcs.c:2369]: mohq_debug(): first_invite_msg: Sent RINGING for call (<sip:6010@10.110.3.57>;tag=c97a6b26-2bfe-4271-9db1-cee38ea96c47)
Jun 12 22:58:30 - DEBUG: mohqueue [mohq_funcs.c:2369]: mohq_debug(): send_rtp_answer: Answering RTP link for call (<sip:6010@10.110.3.57>;tag=c97a6b26-2bfe-4271-9db1-cee38ea96c47)
Jun 12 22:58:30 - DEBUG: mohqueue [mohq_funcs.c:2369]: mohq_debug(): start_stream: Starting RTP link for call (<sip:6010@10.110.3.57>;tag=c97a6b26-2bfe-4271-9db1-cee38ea96c47)
Jun 12 22:58:30 - DEBUG: mohqueue [mohq_funcs.c:2369]: mohq_debug(): send_rtp_answer: Responded to INVITE with RTP for call (<sip:6010@10.110.3.57>;tag=c97a6b26-2bfe-4271-9db1-cee38ea96c47)
Jun 12 22:58:35 ERROR: mohqueue [mohq_funcs.c:1243]: invite_cb(): invite_cb: INVITE failed for call (<sip:6010@10.110.3.57>;tag=c97a6b26-2bfe-4271-9db1-cee38ea96c47)!
Jun 12 22:58:35 DEBUG: mohqueue [mohq_funcs.c:2369]: mohq_debug(): delete_call: Deleting call (<sip:6010@10.110.3.57>;tag=c97a6b26-2bfe-4271-9db1-cee38ea96c47) from queue (demo)

-- route[MOH] is called first at the beginning of request_route()
route[MOH] {
  if (has_totag()) return;
  if (mohq_process ()) {
    xlog ("mohqueue: mohq_process");
    exit;
  }
}

-- Looking at the SIP trace, all seems ok, except receiving a 404 response after BYE (that's me hanging up after few seconds from getting the above error message)

Your comments and hints are appreciated!

Thank you
Issam

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users