Przeglądaj źródła

mohqueue: small fixes for header check

- updated to v1.6
- handle change to register_tmcb ()
- updated copyright
- header check stops at semicolon
Robert Boisvert 6 lat temu
rodzic
commit
a4ac4b3c0b

+ 1 - 1
src/modules/mohqueue/doc/mohqueue.xml

@@ -21,7 +21,7 @@
       </author>
     </authorgroup>
     <copyright>
-      <year>2013-2017</year>
+      <year>2013-2019</year>
       <holder>Robert Boisvert, [email protected]</holder>
     </copyright>
   </bookinfo>

+ 1 - 1
src/modules/mohqueue/mohq_common.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-17 Robert Boisvert
+ * Copyright (C) 2013-19 Robert Boisvert
  *
  * This file is part of the mohqueue module for Kamailio, a free SIP server.
  *

+ 1 - 1
src/modules/mohqueue/mohq_db.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-17 Robert Boisvert
+ * Copyright (C) 2013-19 Robert Boisvert
  *
  * This file is part of the mohqueue module for Kamailio, a free SIP server.
  *

+ 1 - 1
src/modules/mohqueue/mohq_db.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-15 Robert Boisvert
+ * Copyright (C) 2013-19 Robert Boisvert
  *
  * This file is part of the mohqueue module for Kamailio, a free SIP server.
  *

+ 12 - 7
src/modules/mohqueue/mohq_funcs.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-17 Robert Boisvert
+ * Copyright (C) 2013-19 Robert Boisvert
  *
  * This file is part of the mohqueue module for Kamailio, a free SIP server.
  *
@@ -32,7 +32,7 @@
 #define ALLOWHDR "Allow: INVITE, ACK, BYE, CANCEL, NOTIFY, PRACK"
 #define CLENHDR "Content-Length"
 #define SIPEOL  "\r\n"
-#define USRAGNT "Kamailio MOH Queue v1.4"
+#define USRAGNT "Kamailio MOH Queue v1.6"
 
 /**********
 * local constants
@@ -1405,9 +1405,12 @@ static void
 
 {
 call_lst *pcall = (call_lst *)*pcbp->param;
+if (pcall->call_state >= CLSTA_INQUEUE)
+  { return; }
+LM_ERR ("invite_cb: INVITE failed for call (%s), code=%x, callstate=%x!\n",
+  pcall->call_from, ntype, pcall->call_state);
 if (ntype == TMCB_DESTROY)
   { pcall->call_hash = pcall->call_label = 0; }
-LM_ERR ("invite_cb: INVITE failed for call (%s)!\n", pcall->call_from);
 delete_call (pcall);
 return;
 }
@@ -1904,7 +1907,7 @@ for (npos1 = 0; npos1 < pstr->len; npos1++)
   {
   /**********
   * o find non-space
-  * o search to end, space or comma
+  * o search to end, space, semicolon or comma
   * o same size?
   * o same name?
   **********/
@@ -1913,7 +1916,8 @@ for (npos1 = 0; npos1 < pstr->len; npos1++)
     { continue; }
   for (npos2 = npos1++; npos1 < pstr->len; npos1++)
     {
-    if (pstr->s [npos1] == ' ' || pstr->s [npos1] == ',')
+    if (pstr->s [npos1] == ' ' || pstr->s [npos1] == ';'
+      || pstr->s [npos1] == ',')
       { break; }
     }
   if (npos1 - npos2 != pext->len)
@@ -2238,10 +2242,11 @@ strcpy (&pfile [npos], pcall->pmohq->mohq_mohfile);
 npos += strlen (&pfile [npos]);
 str pMOH [1] = {{pfile, npos}};
 pv_elem_t *pmodel;
-if(pv_parse_format (pMOH, &pmodel)<0) {
+if (pv_parse_format (pMOH, &pmodel) < 0)
+  {
   LM_ERR("failed to parse pv format string\n");
   return 0;
-}
+  }
 cmd_function fn_stream = bserver ? pmod_data->fn_rtp_stream_s
   : pmod_data->fn_rtp_stream_c;
 mohq_debug (pcall->pmohq, "%sStarting RTP link for call (%s)",

+ 1 - 1
src/modules/mohqueue/mohq_funcs.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-17 Robert Boisvert
+ * Copyright (C) 2013-19 Robert Boisvert
  *
  * This file is part of the mohqueue module for Kamailio, a free SIP server.
  *

+ 1 - 1
src/modules/mohqueue/mohq_locks.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-17 Robert Boisvert
+ * Copyright (C) 2013-19 Robert Boisvert
  *
  * This file is part of the mohqueue module for Kamailio, a free SIP server.
  *

+ 1 - 1
src/modules/mohqueue/mohq_locks.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-17 Robert Boisvert
+ * Copyright (C) 2013-19 Robert Boisvert
  *
  * This file is part of the mohqueue module for Kamailio, a free SIP server.
  *

+ 5 - 5
src/modules/mohqueue/mohqueue_mod.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-17 Robert Boisvert
+ * Copyright (C) 2013-19 Robert Boisvert
  *
  * This file is part of the mohqueue module for Kamailio, a free SIP server.
  *
@@ -276,14 +276,14 @@ if (!pconn)
 if (db_check_table_version (pdb, pconn,
   &pmod_data->pcfg->db_ctable, MOHQ_CTABLE_VERSION) < 0)
   {
-    DB_TABLE_VERSION_ERROR(pmod_data->pcfg->db_ctable);
-    goto dberror;
+  DB_TABLE_VERSION_ERROR (pmod_data->pcfg->db_ctable);
+  goto dberror;
   }
 if (db_check_table_version (pdb, pconn,
   &pmod_data->pcfg->db_qtable, MOHQ_QTABLE_VERSION) < 0)
   {
-    DB_TABLE_VERSION_ERROR(pmod_data->pcfg->db_qtable);
-    goto dberror;
+  DB_TABLE_VERSION_ERROR (pmod_data->pcfg->db_qtable);
+  goto dberror;
   }
 clear_calls (pconn);
 update_mohq_lst (pconn);

+ 1 - 1
src/modules/mohqueue/mohqueue_mod.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-17 Robert Boisvert
+ * Copyright (C) 2013-19 Robert Boisvert
  *
  * This file is part of the mohqueue module for Kamailio, a free SIP server.
  *