* Handles a CANCEL message received over anycast * Returns: * 0: message was successfully handled * -1: message was not handled */
| 592 | * -1: message was not handled |
| 593 | */ |
| 594 | int tm_anycast_cancel(struct sip_msg *msg) |
| 595 | { |
| 596 | struct cell *t; |
| 597 | if (!tm_repl_auto_cancel || !tm_repl_cluster) |
| 598 | return -1; |
| 599 | |
| 600 | if (!tm_existing_invite_trans(msg)) |
| 601 | return tm_replicate_cancel(msg)? 0: -2; |
| 602 | t = get_cancelled_t(); |
| 603 | if (t!=NULL && t!=T_UNDEFINED) |
| 604 | t_unref_cell(t); |
| 605 | |
| 606 | if (t_relay_to(msg, NULL, 0) < 0) { |
| 607 | LM_ERR("cannot handle auto-CANCEL here - send to script!\n"); |
| 608 | return -1; |
| 609 | } |
| 610 | t_unref(msg); |
| 611 | |
| 612 | return 0; |
| 613 | } |
no test coverage detected