* Create a response with given code and reason phrase * Optionally add new headers specified in hdrs */
| 76 | * Optionally add new headers specified in hdrs |
| 77 | */ |
| 78 | int send_resp(struct sip_msg* _m, int _code, const str* _reason, |
| 79 | const str hdrs[], int nhdrs) |
| 80 | { |
| 81 | int i; |
| 82 | |
| 83 | /* Add new headers if there are any */ |
| 84 | for (i = 0; i < nhdrs; i++) { |
| 85 | if (add_lump_rpl( _m, hdrs[i].s, hdrs[i].len, LUMP_RPL_HDR)==0) { |
| 86 | LM_ERR("unable to append hdr\n"); |
| 87 | return -1; |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | return sigb.reply(_m, _code, (_reason?_reason:_str(error_text(_code))), NULL); |
| 92 | } |
no test coverage detected