will return the method ID for a reply by inspecting the Cseq header
| 1034 | |
| 1035 | // will return the method ID for a reply by inspecting the Cseq header |
| 1036 | static int |
| 1037 | get_method_from_reply(struct sip_msg *reply) |
| 1038 | { |
| 1039 | struct cseq_body *cseq; |
| 1040 | |
| 1041 | if (reply->first_line.type != SIP_REPLY) |
| 1042 | return -1; |
| 1043 | |
| 1044 | if (!reply->cseq && parse_headers(reply, HDR_CSEQ_F, 0) < 0) { |
| 1045 | LM_ERR("failed to parse the CSeq header\n"); |
| 1046 | return -1; |
| 1047 | } |
| 1048 | if (!reply->cseq) { |
| 1049 | LM_ERR("missing CSeq header\n"); |
| 1050 | return -1; |
| 1051 | } |
| 1052 | cseq = reply->cseq->parsed; |
| 1053 | return cseq->method_id; |
| 1054 | } |
| 1055 | |
| 1056 | static Bool |
| 1057 | supported_transport(str transport) |