SIP-utils :: Only allow one 183 message per call-id
More...#include <stdio.h>#include <string.h>#include <stdlib.h>#include <assert.h>#include "../../parser/msg_parser.h"#include "../../dprint.h"#include "../../error.h"#include "../../ut.h"#include "../../mem/mem.h"#include "../../mem/shm_mem.h"#include "../../timer.h"#include "../../locking.h"#include "../../md5.h"#include "config.h"#include "ring.h"
Go to the source code of this file.
In a parallel forking scenario you may get several 183s with SDP. You don't want that your customers hear more than one ringtone or answer machine in parallel on the phone. So its necessary to drop the 183 in these cases and send a 180 instead.
Definition in file ring.c.
| static int contains | ( | str | callid | ) | [static] |
| callid | Call-ID that is searched |
Definition at line 227 of file ring.c.
References ring_record_t::callid, hash(), _str::len, remove_timeout(), and _str::s.
Referenced by ring_filter(), and ring_insert_callid().


| static int conv183 | ( | struct sip_msg * | msg | ) | [static] |
| msg | SIP message |
Definition at line 247 of file ring.c.
References sip_msg::buf, sip_msg::first_line, sip_msg::len, and sip_msg::unparsed.
Referenced by ring_filter().

| static unsigned int hash | ( | char * | buf, | |
| int | len | |||
| ) | [static] |
| buf | hashed buffer | |
| len | length of buffer |
Definition at line 152 of file ring.c.
References MD5Final(), MD5Init(), and MD5Update().
Referenced by contains(), insert(), pv_mcd_key_check(), and update_route_data_recursor().


| static void insert | ( | str | callid | ) | [static] |
| callid | Call-ID string |
Definition at line 195 of file ring.c.
References ring_record_t::callid, hash(), hashtable, _str::len, remove_timeout(), _str::s, and ring_record_t::time.
Referenced by db_cluster_insert(), and ring_insert_callid().


| static void remove_timeout | ( | unsigned int | index | ) | [static] |
| index | array index that should expired |
Definition at line 175 of file ring.c.
References ring_record_t::callid, hashtable, and ring_record_t::time.
Referenced by contains(), and insert().

| int ring_filter | ( | struct sip_msg * | msg, | |
| unsigned int | flags, | |||
| void * | bar | |||
| ) |
| msg | SIP message | |
| flags | unused | |
| bar | unused |
Definition at line 342 of file ring.c.
References hdr_field::body, contains(), conv183(), sip_msg::first_line, _str::len, and _str::s.

| int ring_fixup | ( | void ** | param, | |
| int | param_no | |||
| ) |
| int ring_insert_callid | ( | struct sip_msg * | msg, | |
| char * | unused1, | |||
| char * | unused2 | |||
| ) |
Inserts callid of message into hashtable. Any 183 messages with this callid that occur in the next ring_timeout seconds, will be converted to 180.
| msg | SIP message | |
| unused1 | unused | |
| unused2 | unused |
Definition at line 90 of file ring.c.
References hdr_field::body, contains(), and insert().

1.7.1