diff options
author | Nathan Angelacos <nangel@alpinelinux.org> | 2015-10-20 16:55:53 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-10-21 06:10:33 +0000 |
commit | 166444ada7f481e2ceb4f8407cb35d7f57ec2c26 (patch) | |
tree | d330afdfa85b04bdc5f02998aa2e7d46e8b53a30 /main/kamailio | |
parent | 72353bac55bbbf45ff8a3fc0d0f0624d0e2c3205 (diff) | |
download | aports-166444ada7f481e2ceb4f8407cb35d7f57ec2c26.tar.bz2 aports-166444ada7f481e2ceb4f8407cb35d7f57ec2c26.tar.xz |
main/kamailio mohqueue 0.12
rebased mohqueue patch against the v0.12 version on github
Diffstat (limited to 'main/kamailio')
-rw-r--r-- | main/kamailio/0002-mohqueue-v0-12.patch (renamed from main/kamailio/0002-mohqueue-v0-11.patch) | 301 | ||||
-rw-r--r-- | main/kamailio/APKBUILD | 8 |
2 files changed, 160 insertions, 149 deletions
diff --git a/main/kamailio/0002-mohqueue-v0-11.patch b/main/kamailio/0002-mohqueue-v0-12.patch index f47e9f682e..63219c4b05 100644 --- a/main/kamailio/0002-mohqueue-v0-11.patch +++ b/main/kamailio/0002-mohqueue-v0-12.patch @@ -325,7 +325,7 @@ index 711f3fe..bc54aca 100644 +} \ No newline at end of file diff --git a/modules/mohqueue/mohq.h b/modules/mohqueue/mohq.h -index b23e6a3..3d5346b 100644 +index b23e6a3..207bcba 100644 --- a/modules/mohqueue/mohq.h +++ b/modules/mohqueue/mohq.h @@ -1,5 +1,5 @@ @@ -359,7 +359,7 @@ index b23e6a3..3d5346b 100644 - char call_id [101]; - char call_from [URI_LEN + 1]; + char call_buffer [1024]; -+ size_t call_bufpos; ++ size_t call_buflen; + char *call_id; + char *call_from; char call_referto [URI_LEN + 1]; @@ -584,7 +584,7 @@ index 611d455..c343601 100644 +#endif /* MOHQ_DB_H */ \ No newline at end of file diff --git a/modules/mohqueue/mohq_funcs.c b/modules/mohqueue/mohq_funcs.c -index 1d023e6..210f14e 100644 +index 1d023e6..86699ae 100644 --- a/modules/mohqueue/mohq_funcs.c +++ b/modules/mohqueue/mohq_funcs.c @@ -1,5 +1,5 @@ @@ -919,7 +919,7 @@ index 1d023e6..210f14e 100644 pfncname, pcall->call_from); bsent = 1; -@@ -447,138 +493,127 @@ return; +@@ -447,138 +493,125 @@ return; * Create New Call Record * * INPUT: @@ -983,9 +983,9 @@ index 1d023e6..210f14e 100644 -strncpy (pcall->call_id, pstr->s, pstr->len); -pcall->call_id [pstr->len] = '\0'; +char *pbuf = pcall->call_buffer; -+pcall->call_bufpos = sizeof (pcall->call_buffer); ++pcall->call_buflen = sizeof (pcall->call_buffer); +pcall->call_id = pbuf; -+if (!addstrbfr (pstr->s, pstr->len, &pbuf, &pcall->call_bufpos, 1)) ++if (!addstrbfr (pstr->s, pstr->len, &pbuf, &pcall->call_buflen, 1)) + { return 0; } pstr = &pmsg->from->body; -strncpy (pcall->call_from, pstr->s, pstr->len); @@ -995,10 +995,7 @@ index 1d023e6..210f14e 100644 - { *pcall->call_contact = '\0'; } -else +pcall->call_from = pbuf; -+if (!addstrbfr (pstr->s, pstr->len, &pbuf, &pcall->call_bufpos, 1)) -+ { return 0; } -+pcall->call_tag = pbuf; -+if (!addstrbfr (0, 0, &pbuf, &pcall->call_bufpos, 1)) ++if (!addstrbfr (pstr->s, pstr->len, &pbuf, &pcall->call_buflen, 1)) + { return 0; } +pcall->call_contact = pbuf; +if (pmsg->contact) @@ -1006,63 +1003,88 @@ index 1d023e6..210f14e 100644 pstr = &pmsg->contact->body; - strncpy (pcall->call_contact, pstr->s, pstr->len); - pcall->call_contact [pstr->len] = '\0'; -+ if (!addstrbfr (pstr->s, pstr->len, &pbuf, &pcall->call_bufpos, 0)) ++ if (!addstrbfr (pstr->s, pstr->len, &pbuf, &pcall->call_buflen, 0)) + { return 0; } } -+if (!addstrbfr (0, 0, &pbuf, &pcall->call_bufpos, 1)) ++if (!addstrbfr (0, 0, &pbuf, &pcall->call_buflen, 1)) + { return 0; } /********** * extract Via headers **********/ +-hdr_field_t *phdr = pmsg->h_via1; +-if (phdr) +pcall->call_via = pbuf; - hdr_field_t *phdr = pmsg->h_via1; - if (phdr) ++hdr_field_t *phdr; ++for (phdr = pmsg->h_via1; phdr; phdr = next_sibling_hdr (phdr)) { - int npos1 = 0; - while ((phdr = next_sibling_hdr (phdr))) +- while ((phdr = next_sibling_hdr (phdr))) ++ struct via_body *pvia; ++ char *pviabuf; ++ int npos; ++ for (pvia = (struct via_body *)phdr->parsed; pvia; pvia = pvia->next) { - struct via_body *pvia; - char *pviabuf; +- struct via_body *pvia; +- char *pviabuf; - int bovrflow = 0; - int npos2; - int nvia_max = sizeof (pcall->call_via); -+ int npos; - for (pvia = (struct via_body *)phdr->parsed; pvia; pvia = pvia->next) +- for (pvia = (struct via_body *)phdr->parsed; pvia; pvia = pvia->next) ++ /********** ++ * skip trailing whitespace ++ **********/ ++ ++ npos = pvia->bsize; ++ pviabuf = pvia->name.s; ++ while (npos) { - /********** +- /********** - * o skip trailing whitespace - * o check if overflow -+ * skip trailing whitespace - **********/ +- **********/ ++ --npos; ++ if (pviabuf [npos] == ' ' || pviabuf [npos] == '\r' ++ || pviabuf [npos] == '\n' || pviabuf [npos] == '\t' ++ || pviabuf [npos] == ',') ++ { continue; } ++ break; ++ } - npos2 = pvia->bsize; -+ npos = pvia->bsize; - pviabuf = pvia->name.s; +- pviabuf = pvia->name.s; - while (npos2) -+ while (npos) - { +- { - --npos2; - if (pviabuf [npos2] == ' ' || pviabuf [npos2] == '\r' - || pviabuf [npos2] == '\n' || pviabuf [npos2] == '\t' || pviabuf [npos2] == ',') -+ --npos; -+ if (pviabuf [npos] == ' ' || pviabuf [npos] == '\r' -+ || pviabuf [npos] == '\n' || pviabuf [npos] == '\t' -+ || pviabuf [npos] == ',') - { continue; } - break; - } +- { continue; } +- break; +- } - if ((npos2 + npos1 + 7) >= nvia_max) - { - LM_WARN ("%sVia buffer overflowed!", pfncname); - bovrflow = 1; - break; - } ++ /********** ++ * copy via ++ **********/ - /********** - * copy via - **********/ +- /********** +- * copy via +- **********/ ++ if (!addstrbfr ("Via: ", 5, &pbuf, &pcall->call_buflen, 0)) ++ { return 0; } ++ if (!addstrbfr (pviabuf, npos + 1, &pbuf, &pcall->call_buflen, 0)) ++ { return 0; } ++ if (!addstrbfr (SIPEOL, 2, &pbuf, &pcall->call_buflen, 0)) ++ { return 0; } ++ } ++ } ++if (!addstrbfr (0, 0, &pbuf, &pcall->call_buflen, 1)) ++ { return 0; } - strcpy (&pcall->call_via [npos1], "Via: "); - npos1 += 5; @@ -1070,24 +1092,10 @@ index 1d023e6..210f14e 100644 - npos1 += npos2; - strcpy (&pcall->call_via [npos1], SIPEOL); - npos1 += 2; -+ if (!addstrbfr ("Via: ", 5, &pbuf, &pcall->call_bufpos, 0)) -+ { return 0; } -+ if (!addstrbfr (pviabuf, npos, &pbuf, &pcall->call_bufpos, 0)) -+ { return 0; } -+ if (!addstrbfr (SIPEOL, 2, &pbuf, &pcall->call_bufpos, 0)) -+ { return 0; } - } +- } - if (bovrflow) - { break; } - } - } -+if (!addstrbfr (0, 0, &pbuf, &pcall->call_bufpos, 1)) -+ { return 0; } - - /********** --* o release call lock --* o update DB --* o lock MOH queue ++/********** +* extract Route headers +**********/ + @@ -1100,22 +1108,28 @@ index 1d023e6..210f14e 100644 + rr_t *prouterr; + for (prouterr = proute->parsed; prouterr; prouterr = prouterr->next) + { -+ if (!addstrbfr ("Route: ", 7, &pbuf, &pcall->call_bufpos, 0)) ++ if (!addstrbfr ("Route: ", 7, &pbuf, &pcall->call_buflen, 0)) + { return 0; } + if (!addstrbfr (prouterr->nameaddr.name.s, prouterr->len, -+ &pbuf, &pcall->call_bufpos, 0)) ++ &pbuf, &pcall->call_buflen, 0)) + { return 0; } -+ if (!addstrbfr (SIPEOL, 2, &pbuf, &pcall->call_bufpos, 0)) ++ if (!addstrbfr (SIPEOL, 2, &pbuf, &pcall->call_buflen, 0)) + { return 0; } -+ } -+ } -+if (!addstrbfr (0, 0, &pbuf, &pcall->call_bufpos, 1)) + } + } ++if (!addstrbfr (0, 0, &pbuf, &pcall->call_buflen, 1)) + { return 0; } -+ -+/********** -+* update DB + + /********** +-* o release call lock ++* o place tag at the end + * o update DB +-* o lock MOH queue **********/ ++pcall->call_tag = pbuf; ++if (!addstrbfr (0, 0, &pbuf, &pcall->call_buflen, 1)) ++ { return 0; } pcall->call_state = CLSTA_ENTER; -mohq_lock_release (pmod_data->pcall_lock); add_call_rec (ncall_idx); @@ -1127,7 +1141,7 @@ index 1d023e6..210f14e 100644 } /********** -@@ -603,15 +638,15 @@ if (pcall->call_hash || pcall->call_label) +@@ -603,15 +636,15 @@ if (pcall->call_hash || pcall->call_label) { if (ptm->t_lookup_ident (&ptrans, pcall->call_hash, pcall->call_label) < 0) { @@ -1147,7 +1161,7 @@ index 1d023e6..210f14e 100644 } } pcall->call_hash = pcall->call_label = 0; -@@ -620,14 +655,21 @@ if (pcall->call_hash || pcall->call_label) +@@ -620,14 +653,21 @@ if (pcall->call_hash || pcall->call_label) /********** * o update DB * o inactivate slot @@ -1175,7 +1189,7 @@ index 1d023e6..210f14e 100644 return; } -@@ -663,7 +705,7 @@ if (ptm->t_newtran (pmsg) < 0) +@@ -663,7 +703,7 @@ if (ptm->t_newtran (pmsg) < 0) } if (!add_lump_rpl2 (pmsg, pallowhdr->s, pallowhdr->len, LUMP_RPL_HDR)) { LM_ERR ("%sUnable to add Allow header!\n", pfncname); } @@ -1184,7 +1198,7 @@ index 1d023e6..210f14e 100644 STR_FMT (&REQ_LINE (pmsg).method), pcall->call_from); if (ptm->t_reply (pmsg, 405, presp_noallow->s) < 0) { -@@ -674,7 +716,7 @@ return; +@@ -674,7 +714,7 @@ return; } /********** @@ -1193,7 +1207,7 @@ index 1d023e6..210f14e 100644 * * INPUT: * Arg (1) = SIP message pointer -@@ -682,16 +724,15 @@ return; +@@ -682,16 +722,15 @@ return; * OUTPUT: none **********/ @@ -1214,7 +1228,7 @@ index 1d023e6..210f14e 100644 { mohq_debug (pcall->pmohq, "%sDestroying RTP link for call (%s)", pfncname, pcall->call_from); -@@ -701,7 +742,6 @@ if (pmsg != FAKED_REPLY) +@@ -701,7 +740,6 @@ if (pmsg != FAKED_REPLY) pfncname, pcall->call_from); } } @@ -1222,7 +1236,7 @@ index 1d023e6..210f14e 100644 return; } -@@ -710,62 +750,37 @@ return; +@@ -710,62 +748,37 @@ return; * * INPUT: * Arg (1) = SIP message pointer @@ -1301,7 +1315,7 @@ index 1d023e6..210f14e 100644 for (nidx = 0; nidx < pmod_data->call_cnt; nidx++) { /********** -@@ -773,21 +788,25 @@ for (nidx = 0; nidx < pmod_data->call_cnt; nidx++) +@@ -773,21 +786,25 @@ for (nidx = 0; nidx < pmod_data->call_cnt; nidx++) * o call timed out on ACK? * o callID matches? * o to tag matches? @@ -1332,7 +1346,7 @@ index 1d023e6..210f14e 100644 str tmpstr [1]; tmpstr->s = pcall->call_id; tmpstr->len = strlen (tmpstr->s); -@@ -800,31 +819,96 @@ for (nidx = 0; nidx < pmod_data->call_cnt; nidx++) +@@ -800,31 +817,96 @@ for (nidx = 0; nidx < pmod_data->call_cnt; nidx++) if (!STR_EQ (*tmpstr, *ptotag)) { continue; } } @@ -1436,7 +1450,7 @@ index 1d023e6..210f14e 100644 int nidx; str tmpstr; if (!mohq_lock_set (pmod_data->pmohq_lock, 0, 500)) -@@ -869,7 +953,7 @@ parse_to (pvalue->s, &pvalue->s [pvalue->len + 1], pref); +@@ -869,7 +951,7 @@ parse_to (pvalue->s, &pvalue->s [pvalue->len + 1], pref); if (pref->error != PARSE_OK) { // should never happen @@ -1445,7 +1459,7 @@ index 1d023e6..210f14e 100644 return -1; } if (pref->param_lst) -@@ -884,7 +968,7 @@ str tmpstr; +@@ -884,7 +966,7 @@ str tmpstr; struct to_body pfrom [1]; for (nidx = 0; nidx < pmod_data->call_cnt; nidx++) { @@ -1454,7 +1468,7 @@ index 1d023e6..210f14e 100644 { continue; } tmpstr.s = pmod_data->pcall_lst [nidx].call_from; tmpstr.len = strlen (tmpstr.s); -@@ -892,7 +976,7 @@ for (nidx = 0; nidx < pmod_data->call_cnt; nidx++) +@@ -892,7 +974,7 @@ for (nidx = 0; nidx < pmod_data->call_cnt; nidx++) if (pfrom->error != PARSE_OK) { // should never happen @@ -1463,7 +1477,7 @@ index 1d023e6..210f14e 100644 continue; } if (pfrom->param_lst) -@@ -908,55 +992,65 @@ return -1; +@@ -908,55 +990,65 @@ return -1; * * INPUT: * Arg (1) = SIP message pointer @@ -1550,7 +1564,7 @@ index 1d023e6..210f14e 100644 } /********** -@@ -969,10 +1063,11 @@ if (pmod_data->fn_rtp_offer (pmsg, 0, 0) != 1) +@@ -969,10 +1061,11 @@ if (pmod_data->fn_rtp_offer (pmsg, 0, 0) != 1) tm_api_t *ptm = pmod_data->ptm; if (ptm->t_newtran (pmsg) < 0) { @@ -1564,7 +1578,7 @@ index 1d023e6..210f14e 100644 } struct cell *ptrans = ptm->t_gett (); pcall->call_hash = ptrans->hash_index; -@@ -980,28 +1075,53 @@ pcall->call_label = ptrans->label; +@@ -980,26 +1073,50 @@ pcall->call_label = ptrans->label; str ptotag [1]; if (ptm->t_get_reply_totag (pmsg, ptotag) != 1) { @@ -1579,9 +1593,8 @@ index 1d023e6..210f14e 100644 - return 1; + return; + } -+char *pbuf = &pcall->call_buffer [pcall->call_bufpos]; -+pcall->call_tag = pbuf; -+if (!addstrbfr (ptotag->s, ptotag->len, &pbuf, &pcall->call_bufpos, 1)) ++char *pbuf = pcall->call_tag; ++if (!addstrbfr (ptotag->s, ptotag->len, &pbuf, &pcall->call_buflen, 1)) + { + LM_ERR ("%sInsufficient buffer space for call (%s)!\n", + pfncname, pcall->call_from); @@ -1607,9 +1620,9 @@ index 1d023e6..210f14e 100644 delete_call (pcall); - return 1; + return; - } - - /********** ++ } ++ ++/********** +* reply with trying +**********/ + @@ -1619,14 +1632,12 @@ index 1d023e6..210f14e 100644 + end_RTP (pmsg, pcall); + delete_call (pcall); + return; -+ } + } +pcall->call_state = CLSTA_TRYING; -+ -+/********** + + /********** * o add contact to reply - * o supports/requires PRACK? (RFC 3262 section 3) - * o exit if not ringing -@@ -1009,19 +1129,20 @@ if (ptm->register_tmcb (pmsg, 0, TMCB_DESTROY | TMCB_ON_FAILURE, +@@ -1009,19 +1126,20 @@ if (ptm->register_tmcb (pmsg, 0, TMCB_DESTROY | TMCB_ON_FAILURE, str pcontact [1]; char *pcontacthdr = "Contact: <%s>" SIPEOL; @@ -1653,7 +1664,7 @@ index 1d023e6..210f14e 100644 pfncname, pcontact->s, pcall->call_from); } pkg_free (pcontact->s); -@@ -1030,42 +1151,30 @@ if (search_hdr_ext (pmsg->require, p100rel)) +@@ -1030,42 +1148,30 @@ if (search_hdr_ext (pmsg->require, p100rel)) { if (!send_prov_rsp (pmsg, pcall)) { @@ -1666,13 +1677,13 @@ index 1d023e6..210f14e 100644 -else - { - if (ptm->t_reply (pmsg, 180, presp_ring->s) < 0) -+ if (pcall->call_state == CLSTA_CANCEL) - { +- { - LM_ERR ("%sUnable to reply to INVITE!", pfncname); - return 1; - } - else -- { ++ if (pcall->call_state == CLSTA_CANCEL) + { - pcall->call_state = CLSTA_RINGING; - mohq_debug (pcall->pmohq, "%sSent RINGING for call (%s)", - pfncname, pcall->call_from); @@ -1706,7 +1717,7 @@ index 1d023e6..210f14e 100644 } /********** -@@ -1085,6 +1194,9 @@ dlg_t *form_dialog (call_lst *pcall, struct to_body *pto_body) +@@ -1085,6 +1191,9 @@ dlg_t *form_dialog (call_lst *pcall, struct to_body *pto_body) **********/ char *pfncname = "form_dialog: "; @@ -1716,7 +1727,7 @@ index 1d023e6..210f14e 100644 struct to_body *ptob = &pto_body [0]; struct to_body *pcontact = &pto_body [1]; parse_to (pcall->call_from, -@@ -1092,12 +1204,49 @@ parse_to (pcall->call_from, +@@ -1092,12 +1201,49 @@ parse_to (pcall->call_from, if (ptob->error != PARSE_OK) { // should never happen @@ -1768,7 +1779,7 @@ index 1d023e6..210f14e 100644 if (!*pcall->call_contact) { ptarget->s = ptob->uri.s; -@@ -1110,7 +1259,7 @@ else +@@ -1110,7 +1256,7 @@ else if (pcontact->error != PARSE_OK) { // should never happen @@ -1777,7 +1788,7 @@ index 1d023e6..210f14e 100644 pcall->call_contact, pcall->call_from); return 0; } -@@ -1127,7 +1276,7 @@ else +@@ -1127,7 +1273,7 @@ else dlg_t *pdlg = (dlg_t *)pkg_malloc (sizeof (dlg_t)); if (!pdlg) { @@ -1786,7 +1797,7 @@ index 1d023e6..210f14e 100644 return 0; } memset (pdlg, 0, sizeof (dlg_t)); -@@ -1145,6 +1294,11 @@ pdlg->loc_uri.s = pcall->pmohq->mohq_uri; +@@ -1145,6 +1291,11 @@ pdlg->loc_uri.s = pcall->pmohq->mohq_uri; pdlg->loc_uri.len = strlen (pdlg->loc_uri.s); pdlg->rem_uri.s = ptob->uri.s; pdlg->rem_uri.len = ptob->uri.len; @@ -1798,7 +1809,7 @@ index 1d023e6..210f14e 100644 return pdlg; } -@@ -1171,7 +1325,7 @@ rtpmap **pmohfiles = find_MOH (pcall->pmohq->mohq_mohdir, +@@ -1171,7 +1322,7 @@ rtpmap **pmohfiles = find_MOH (pcall->pmohq->mohq_mohdir, pcall->pmohq->mohq_mohfile); if (!pmohfiles [0]) { @@ -1807,7 +1818,7 @@ index 1d023e6..210f14e 100644 pcall->pmohq->mohq_name); return 0; } -@@ -1191,7 +1345,7 @@ for (nidx = 0; pmohfiles [nidx]; nidx++) +@@ -1191,7 +1342,7 @@ for (nidx = 0; pmohfiles [nidx]; nidx++) pstr->s = pkg_malloc (nsize + 1); if (!pstr->s) { @@ -1816,7 +1827,7 @@ index 1d023e6..210f14e 100644 return 0; } strcpy (pstr->s, pSDP); -@@ -1238,7 +1392,7 @@ static void +@@ -1238,7 +1389,7 @@ static void call_lst *pcall = (call_lst *)*pcbp->param; if (ntype == TMCB_DESTROY) { pcall->call_hash = pcall->call_label = 0; } @@ -1825,7 +1836,7 @@ index 1d023e6..210f14e 100644 delete_call (pcall); return; } -@@ -1249,10 +1403,10 @@ return; +@@ -1249,10 +1400,10 @@ return; * INPUT: * Arg (1) = SIP message pointer * Arg (2) = call pointer @@ -1838,7 +1849,7 @@ index 1d023e6..210f14e 100644 { /********** -@@ -1262,11 +1416,11 @@ int notify_msg (sip_msg_t *pmsg, call_lst *pcall) +@@ -1262,11 +1413,11 @@ int notify_msg (sip_msg_t *pmsg, call_lst *pcall) char *pfncname = "notify_msg: "; if (pcall->call_state != CLSTA_RFRWAIT) { @@ -1853,7 +1864,7 @@ index 1d023e6..210f14e 100644 } /********** -@@ -1277,28 +1431,28 @@ if (pcall->call_state != CLSTA_RFRWAIT) +@@ -1277,28 +1428,28 @@ if (pcall->call_state != CLSTA_RFRWAIT) if (!search_hdr_ext (pmsg->content_type, psipfrag)) { @@ -1890,7 +1901,7 @@ index 1d023e6..210f14e 100644 } strncpy (pbody->s, pfrag, pbody->len); if (pbody->s [pbody->len - 1] != '\n') -@@ -1311,10 +1465,10 @@ parse_first_line (pbody->s, pbody->len + 1, pstart); +@@ -1311,10 +1462,10 @@ parse_first_line (pbody->s, pbody->len + 1, pstart); pkg_free (pbody->s); if (pstart->type != SIP_REPLY) { @@ -1904,7 +1915,7 @@ index 1d023e6..210f14e 100644 } /********** -@@ -1322,32 +1476,34 @@ if (pstart->type != SIP_REPLY) +@@ -1322,32 +1473,34 @@ if (pstart->type != SIP_REPLY) * o REFER done? **********/ @@ -1946,7 +1957,7 @@ index 1d023e6..210f14e 100644 } /********** -@@ -1358,7 +1514,7 @@ switch (nreply / 100) +@@ -1358,7 +1511,7 @@ switch (nreply / 100) update_call_rec (pcall); break; } @@ -1955,7 +1966,7 @@ index 1d023e6..210f14e 100644 } /********** -@@ -1367,10 +1523,10 @@ return 1; +@@ -1367,10 +1520,10 @@ return 1; * INPUT: * Arg (1) = SIP message pointer * Arg (2) = call pointer @@ -1968,7 +1979,7 @@ index 1d023e6..210f14e 100644 { /********** -@@ -1381,10 +1537,10 @@ char *pfncname = "prack_msg: "; +@@ -1381,10 +1534,10 @@ char *pfncname = "prack_msg: "; tm_api_t *ptm = pmod_data->ptm; if (pcall->call_state != CLSTA_PRACKSTRT) { @@ -1982,7 +1993,7 @@ index 1d023e6..210f14e 100644 } /********** -@@ -1394,20 +1550,20 @@ if (pcall->call_state != CLSTA_PRACKSTRT) +@@ -1394,20 +1547,20 @@ if (pcall->call_state != CLSTA_PRACKSTRT) if (ptm->t_newtran (pmsg) < 0) { @@ -2009,7 +2020,7 @@ index 1d023e6..210f14e 100644 } /********** -@@ -1448,18 +1604,22 @@ puri->s = pcall->call_referto; +@@ -1448,18 +1601,22 @@ puri->s = pcall->call_referto; puri->len = strlen (puri->s); int npos1 = sizeof (prefermsg) // REFER template + strlen (pcall->call_via) // Via @@ -2035,7 +2046,7 @@ index 1d023e6..210f14e 100644 /********** * send REFER request -@@ -1472,13 +1632,14 @@ phdrs->s = pbuf; +@@ -1472,13 +1629,14 @@ phdrs->s = pbuf; phdrs->len = strlen (pbuf); set_uac_req (puac, prefer, phdrs, 0, pdlg, TMCB_LOCAL_COMPLETED | TMCB_ON_FAILURE, refer_cb, pcall); @@ -2051,7 +2062,7 @@ index 1d023e6..210f14e 100644 pfncname, pcall->call_from); update_call_rec (pcall); goto refererr; -@@ -1512,21 +1673,23 @@ char *pfncname = "refer_cb: "; +@@ -1512,21 +1670,23 @@ char *pfncname = "refer_cb: "; call_lst *pcall = (call_lst *)*pcbp->param; if ((ntype == TMCB_ON_FAILURE) || (pcbp->req == FAKED_REPLY)) { @@ -2078,7 +2089,7 @@ index 1d023e6..210f14e 100644 pcall->call_from, nreply); if (nreply == 481) { delete_call (pcall); } -@@ -1545,10 +1708,10 @@ return; +@@ -1545,10 +1705,10 @@ return; * INPUT: * Arg (1) = SIP message pointer * Arg (2) = call pointer @@ -2091,7 +2102,7 @@ index 1d023e6..210f14e 100644 { /********** -@@ -1563,17 +1726,17 @@ if ((pcall->call_state / 100) < 2) +@@ -1563,17 +1723,17 @@ if ((pcall->call_state / 100) < 2) mohq_debug (pcall->pmohq, "%sINVITE still pending for call (%s)", pfncname, pcall->call_from); if (pmod_data->psl->freply (pmsg, 491, presp_reqpend) < 0) @@ -2114,7 +2125,7 @@ index 1d023e6..210f14e 100644 } } -@@ -1643,12 +1806,12 @@ if (!bhold) +@@ -1643,12 +1803,12 @@ if (!bhold) { if (!bmatch) { @@ -2130,7 +2141,7 @@ index 1d023e6..210f14e 100644 } } else -@@ -1657,26 +1820,26 @@ if (!bhold) +@@ -1657,26 +1817,26 @@ if (!bhold) pfncname, pcall->call_from); if (pmod_data->psl->freply (pmsg, 200, presp_ok) < 0) { @@ -2164,7 +2175,7 @@ index 1d023e6..210f14e 100644 } /********** -@@ -1744,22 +1907,21 @@ char *phdrtmplt = +@@ -1744,22 +1904,21 @@ char *phdrtmplt = "Accept-Language: en" SIPEOL "Require: 100rel" SIPEOL "RSeq: %d" SIPEOL @@ -2190,7 +2201,7 @@ index 1d023e6..210f14e 100644 pfncname, pcall->call_from); return 0; } -@@ -1780,7 +1942,7 @@ while (1) +@@ -1780,7 +1939,7 @@ while (1) { break; } if (nstart < time (0)) { @@ -2199,7 +2210,7 @@ index 1d023e6..210f14e 100644 pfncname, pcall->call_from); break; } -@@ -1820,7 +1982,7 @@ pbuf->s = build_res_buf_from_sip_req (200, presp_ok, ptotag, ptrans->uas.request +@@ -1820,7 +1979,7 @@ pbuf->s = build_res_buf_from_sip_req (200, presp_ok, ptotag, ptrans->uas.request (unsigned int *)&pbuf->len, pBM); if (!pbuf->s || !pbuf->len) { @@ -2208,7 +2219,7 @@ index 1d023e6..210f14e 100644 pfncname, pcall->call_from); return 0; } -@@ -1893,7 +2055,7 @@ npos1 += pextrahdr->len + strlen (pbodylen) + pSDP->len + 1; +@@ -1893,7 +2052,7 @@ npos1 += pextrahdr->len + strlen (pbodylen) + pSDP->len + 1; char *pnewbuf = pkg_malloc (npos1); if (!pnewbuf) { @@ -2217,7 +2228,7 @@ index 1d023e6..210f14e 100644 goto answer_done; } for (npos1 = npos2 = 0; npos2 < nhdrcnt; npos2++) -@@ -1923,7 +2085,7 @@ build_sip_msg_from_buf (pnmsg, pbuf->s, pbuf->len, 0); +@@ -1923,7 +2082,7 @@ build_sip_msg_from_buf (pnmsg, pbuf->s, pbuf->len, 0); memcpy (&pnmsg->rcv, &pmsg->rcv, sizeof (struct receive_info)); /********** @@ -2226,7 +2237,7 @@ index 1d023e6..210f14e 100644 * o form stream file * o send stream **********/ -@@ -1932,7 +2094,7 @@ mohq_debug (pcall->pmohq, "%sAnswering RTP link for call (%s)", +@@ -1932,7 +2091,7 @@ mohq_debug (pcall->pmohq, "%sAnswering RTP link for call (%s)", pfncname, pcall->call_from); if (pmod_data->fn_rtp_answer (pnmsg, 0, 0) != 1) { @@ -2235,7 +2246,7 @@ index 1d023e6..210f14e 100644 pfncname, pcall->call_from); goto answer_done; } -@@ -1949,7 +2111,7 @@ pkg_free (pnewbuf); +@@ -1949,7 +2108,7 @@ pkg_free (pnewbuf); free_sip_msg (pnmsg); if (!pbuf->s || !pbuf->len) { @@ -2244,7 +2255,7 @@ index 1d023e6..210f14e 100644 pfncname, pcall->call_from); goto answer_done; } -@@ -1973,26 +2135,26 @@ char *pfnd = strstr (pnewSDP->s, "m=audio "); +@@ -1973,26 +2132,26 @@ char *pfnd = strstr (pnewSDP->s, "m=audio "); if (!pfnd) { // should not happen @@ -2275,7 +2286,7 @@ index 1d023e6..210f14e 100644 pfncname, pcall->call_from); goto answer_done; } -@@ -2041,7 +2203,34 @@ mohq_debug (pcall->pmohq, "%sStarting RTP link for call (%s)", +@@ -2041,7 +2200,34 @@ mohq_debug (pcall->pmohq, "%sStarting RTP link for call (%s)", pfncname, pcall->call_from); if (fn_stream (pmsg, (char *)pmodel, (char *)-1) != 1) { @@ -2311,7 +2322,7 @@ index 1d023e6..210f14e 100644 pfncname, pcall->call_from); return 0; } -@@ -2062,7 +2251,7 @@ char *form_tmpstr (str *pstr) +@@ -2062,7 +2248,7 @@ char *form_tmpstr (str *pstr) char *pcstr = malloc (pstr->len + 1); if (!pcstr) { @@ -2320,7 +2331,7 @@ index 1d023e6..210f14e 100644 return NULL; } memcpy (pcstr, pstr->s, pstr->len); -@@ -2162,7 +2351,7 @@ struct mi_root *mi_debug (struct mi_root *pcmd_tree, void *parms) +@@ -2162,7 +2348,7 @@ struct mi_root *mi_debug (struct mi_root *pcmd_tree, void *parms) struct mi_node *pnode = pcmd_tree->node.kids; if (!pnode || !pnode->next || pnode->next->next) { return init_mi_tree (400, MI_MISSING_PARM_S, MI_MISSING_PARM_LEN); } @@ -2329,7 +2340,7 @@ index 1d023e6..210f14e 100644 if (nq_idx == -1) { return init_mi_tree (400, pmi_noqueue->s, pmi_noqueue->len); } char pint [20]; -@@ -2215,7 +2404,7 @@ struct mi_root *mi_drop_call (struct mi_root *pcmd_tree, void *parms) +@@ -2215,7 +2401,7 @@ struct mi_root *mi_drop_call (struct mi_root *pcmd_tree, void *parms) struct mi_node *pnode = pcmd_tree->node.kids; if (!pnode || !pnode->next || pnode->next->next) { return init_mi_tree (400, MI_MISSING_PARM_S, MI_MISSING_PARM_LEN); } @@ -2338,7 +2349,7 @@ index 1d023e6..210f14e 100644 if (nq_idx == -1) { return init_mi_tree (400, pmi_noqueue->s, pmi_noqueue->len); } if (!mohq_lock_set (pmod_data->pcall_lock, 0, 5000)) -@@ -2238,7 +2427,7 @@ for (nidx = 0; nidx < pmod_data->call_cnt; nidx++) +@@ -2238,7 +2424,7 @@ for (nidx = 0; nidx < pmod_data->call_cnt; nidx++) **********/ call_lst *pcall = &pmod_data->pcall_lst [nidx]; @@ -2347,7 +2358,7 @@ index 1d023e6..210f14e 100644 { continue; } if (pqueue->mohq_id != pcall->pmohq->mohq_id) { continue; } -@@ -2277,12 +2466,12 @@ char *pfncname = "mohq_count: "; +@@ -2277,12 +2463,12 @@ char *pfncname = "mohq_count: "; str pqname [1]; if (!pqueue || !presult) { @@ -2362,7 +2373,7 @@ index 1d023e6..210f14e 100644 return -1; } -@@ -2292,12 +2481,12 @@ if (fixup_get_svalue (pmsg, (gparam_p)pqueue, pqname)) +@@ -2292,12 +2478,12 @@ if (fixup_get_svalue (pmsg, (gparam_p)pqueue, pqname)) * o count items in queue **********/ @@ -2377,7 +2388,7 @@ index 1d023e6..210f14e 100644 else { if (nq_idx != -1) -@@ -2305,7 +2494,7 @@ else +@@ -2305,7 +2491,7 @@ else mohq_id = pmod_data->pmohq_lst [nq_idx].mohq_id; for (ncall_idx = 0; ncall_idx < pmod_data->call_cnt; ncall_idx++) { @@ -2386,7 +2397,7 @@ index 1d023e6..210f14e 100644 { continue; } if (pcalls [ncall_idx].pmohq->mohq_id == mohq_id && pcalls [ncall_idx].call_state == CLSTA_INQUEUE) -@@ -2326,7 +2515,7 @@ pavp_val->ri = ncount; +@@ -2326,7 +2512,7 @@ pavp_val->ri = ncount; pavp_val->flags = PV_TYPE_INT | PV_VAL_INT; if (presult->setf (pmsg, &presult->pvp, (int)EQ_T, pavp_val) < 0) { @@ -2395,7 +2406,7 @@ index 1d023e6..210f14e 100644 return -1; } return 1; -@@ -2364,7 +2553,7 @@ va_list ap; +@@ -2364,7 +2550,7 @@ va_list ap; va_start (ap, pfmt); vsnprintf (ptext, sizeof (ptext), pfmt, ap); va_end (ap); @@ -2404,7 +2415,7 @@ index 1d023e6..210f14e 100644 if (nsys_log < nmohq_log) { reset_local_debug_level (); } return; -@@ -2375,39 +2564,28 @@ return; +@@ -2375,39 +2561,28 @@ return; * * INPUT: * Arg (1) = SIP message pointer @@ -2449,7 +2460,7 @@ index 1d023e6..210f14e 100644 **********/ if (pmod_data->mohq_update + 60 < time (0)) -@@ -2421,22 +2599,51 @@ if (pconn) +@@ -2421,22 +2596,51 @@ if (pconn) } mohq_dbdisconnect (pconn); } @@ -2503,7 +2514,7 @@ index 1d023e6..210f14e 100644 switch (pmsg->REQ_METHOD) { case METHOD_INVITE: -@@ -2444,33 +2651,35 @@ switch (pmsg->REQ_METHOD) +@@ -2444,33 +2648,35 @@ switch (pmsg->REQ_METHOD) * initial INVITE? **********/ @@ -2549,7 +2560,7 @@ index 1d023e6..210f14e 100644 } /********** -@@ -2495,28 +2704,28 @@ char *pfncname = "mohq_retrieve: "; +@@ -2495,28 +2701,28 @@ char *pfncname = "mohq_retrieve: "; str puri [1], pqname [1]; if (!pqueue || !pURI) { @@ -2583,7 +2594,7 @@ index 1d023e6..210f14e 100644 return -1; } -@@ -2526,12 +2735,12 @@ if (parse_uri (puri->s, puri->len, puri_parsed)) +@@ -2526,12 +2732,12 @@ if (parse_uri (puri->s, puri->len, puri_parsed)) * o find oldest call **********/ @@ -2598,7 +2609,7 @@ index 1d023e6..210f14e 100644 return -1; } call_lst *pcall = 0; -@@ -2544,15 +2753,27 @@ for (ncall_idx = 0; ncall_idx < pmod_data->call_cnt; ncall_idx++) +@@ -2544,15 +2750,27 @@ for (ncall_idx = 0; ncall_idx < pmod_data->call_cnt; ncall_idx++) /********** * o active call? * o matching queue? @@ -2627,7 +2638,7 @@ index 1d023e6..210f14e 100644 if (pcall->call_state != CLSTA_INQUEUE) { continue; } if (!ntime) -@@ -2571,7 +2792,7 @@ for (ncall_idx = 0; ncall_idx < pmod_data->call_cnt; ncall_idx++) +@@ -2571,7 +2789,7 @@ for (ncall_idx = 0; ncall_idx < pmod_data->call_cnt; ncall_idx++) } if (nfound == -1) { @@ -2636,7 +2647,7 @@ index 1d023e6..210f14e 100644 mohq_lock_release (pmod_data->pcall_lock); return -1; } -@@ -2586,7 +2807,7 @@ strncpy (pcall->call_referto, puri->s, puri->len); +@@ -2586,7 +2804,7 @@ strncpy (pcall->call_referto, puri->s, puri->len); pcall->call_referto [puri->len] = '\0'; if (refer_call (pcall, pmod_data->pcall_lock)) { return 1; } @@ -2645,7 +2656,7 @@ index 1d023e6..210f14e 100644 return -1; } -@@ -2610,24 +2831,24 @@ int mohq_send (sip_msg_t *pmsg, char *pqueue) +@@ -2610,24 +2828,24 @@ int mohq_send (sip_msg_t *pmsg, char *pqueue) char *pfncname = "mohq_send: "; if (pmsg->REQ_METHOD != METHOD_INVITE) { @@ -2674,7 +2685,7 @@ index 1d023e6..210f14e 100644 return -1; } -@@ -2637,14 +2858,14 @@ if (fixup_get_svalue (pmsg, (gparam_p)pqueue, pqname)) +@@ -2637,14 +2855,14 @@ if (fixup_get_svalue (pmsg, (gparam_p)pqueue, pqname)) * o relay message **********/ @@ -2691,7 +2702,7 @@ index 1d023e6..210f14e 100644 return -1; } strcpy (pruri->s, pmod_data->pmohq_lst [nq_idx].mohq_uri); -@@ -2656,8 +2877,8 @@ pmsg->parsed_uri_ok = 0; +@@ -2656,8 +2874,8 @@ pmsg->parsed_uri_ok = 0; pmsg->parsed_orig_ruri_ok = 0; if (pmod_data->ptm->t_relay (pmsg, 0, 0) < 0) { diff --git a/main/kamailio/APKBUILD b/main/kamailio/APKBUILD index 737bfdcb85..9e4ead1bed 100644 --- a/main/kamailio/APKBUILD +++ b/main/kamailio/APKBUILD @@ -230,7 +230,7 @@ done source="http://www.kamailio.org/pub/kamailio/$pkgver/src/${pkgname}-${pkgver}${_suffix}.tar.gz 0001-musl-fixes.patch - 0002-mohqueue-v0-11.patch + 0002-mohqueue-v0-12.patch 0003-kamdbctl-backslash.patch kamailio.cfg kamailio.initd @@ -499,19 +499,19 @@ redis() { md5sums="823b3fc52837cd7be5a4b43a18510277 kamailio-4.3.3_src.tar.gz 18863791d386659eae6ef0c82a2517ae 0001-musl-fixes.patch -3b1a7b9e21d5af55827514cadd7cbf71 0002-mohqueue-v0-11.patch +324ce879bceac05b30aa9466bb74916d 0002-mohqueue-v0-12.patch fe8f61c73264cd1c360f3876f664464d 0003-kamdbctl-backslash.patch 299706d97e30a4f0d9b4c873df422866 kamailio.cfg 39dc9355fa7d8fec425d3b17c2fb26e0 kamailio.initd" sha256sums="ae0e03da373e8d4a45194a27a2bacf88f9e17900c428f98278ac87da30a9188a kamailio-4.3.3_src.tar.gz 254ea5d4699417aec49e1aae45398a802067a8967060f2a469e278779d876d22 0001-musl-fixes.patch -e4cfb439d2969801ca1e0bf890643b4a906c36f8ce7aa08d52a15a10525619b6 0002-mohqueue-v0-11.patch +93e8ed5bbe16535286ab4cb586caf01cdf11f405492d36271108333210f0c58b 0002-mohqueue-v0-12.patch 46026949a3a367ebaf0c8a7d1ffeeaa3dc67588c94dd8d558991a54996877c1f 0003-kamdbctl-backslash.patch 8b742ff710ef67ff59ec07a260690ebcdda24fb6f0b7b64dc50433a1bacf99f2 kamailio.cfg ba928fa914feea2b95b8c659832e3fbea25eb6ac1ce56e4c23ff58c09f1ec3b8 kamailio.initd" sha512sums="e21c500f53751de7ce2323b375cdca0501fb23770127e71fe567318e682722cde1daaa9384b219f9ebdb3d0f1bb489ed237051bca3c3207bcb557eb20b967213 kamailio-4.3.3_src.tar.gz 32c8e723ee858b24a3bd1313537e9348bdd895e709041d52199b7d2c4054565f3f8d203458b5a7bd5f4b09a782a972cf87f931de5bb8199e6f9786a3c9bfb3ba 0001-musl-fixes.patch -dbc230e39b2dc4fbf14f2649a50065947688c55e4d697fdafb8afa70e4ffdd2de91d1ac60d107ee494f59399aa27eaacf3e8411aa6f22459ade2f16a1bd5e232 0002-mohqueue-v0-11.patch +782e70cd6c17f37ca613b05c86a2ddca71b1f0d58361345ddecede2743de65095f058916e049db98e4033b937bcb7a94df77f4b5e1a78e1346d07c8d22dd51d5 0002-mohqueue-v0-12.patch d96600f1047eac65c0eba34030baa26ee6ee953434ae5808b203cba979fbed616289d40fc588939222371d832f54cbda0a5e8ba9baa16913363e204490758167 0003-kamdbctl-backslash.patch c1abf69b48847dc8c7ab0d11ef9adb531aa4635f9d44db6933981edc5a47df374664fb24867b19aa64abbcc9777bf1cd0360d9aea54e27b081065928c61e0f0b kamailio.cfg cd6e3b677d803cd78561ad14d9b2589fd35ad0096f48047fdcb4ddc7d9103871357efba3b350946844cb53dbb081210746421fc420c22ac845b90251168a628e kamailio.initd" |