This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
asterisk:realtime:kamailio-3.3.x-asterisk-10.7.0-astdb [2013/05/14 11:58] – [Asterisk Database] admin | asterisk:realtime:kamailio-3.3.x-asterisk-10.7.0-astdb [2013/05/14 12:01] (current) – old revision restored (2013/05/14 09:43) admin | ||
---|---|---|---|
Line 373: | Line 373: | ||
</ | </ | ||
- | < | ||
- | </ | ||
===== UnixODBC Configuration ===== | ===== UnixODBC Configuration ===== | ||
Line 512: | Line 510: | ||
#!define WITH_ASTERISK | #!define WITH_ASTERISK | ||
- | # Kamailio (OpenSER) SIP Server | + | # |
+ | # Kamailio (OpenSER) SIP Server | ||
# - web: http:// | # - web: http:// | ||
# - git: http:// | # - git: http:// | ||
Line 518: | Line 517: | ||
# Direct your questions about this file to: < | # Direct your questions about this file to: < | ||
# | # | ||
- | # Refer to the Core CookBook at http:// | + | # Refer to the Core CookBook at http:// |
# for an explanation of possible statements, functions and parameters. | # for an explanation of possible statements, functions and parameters. | ||
# | # | ||
Line 610: | Line 609: | ||
ALTER TABLE missed_calls ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT ''; | ALTER TABLE missed_calls ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT ''; | ||
#!endif | #!endif | ||
- | |||
- | ####### Include Local Config If Exists ######### | ||
- | import_file " | ||
####### Defined Values ######### | ####### Defined Values ######### | ||
Line 620: | Line 616: | ||
# - database URL - used to connect to database server by modules such | # - database URL - used to connect to database server by modules such | ||
# as: auth_db, acc, usrloc, a.s.o. | # as: auth_db, acc, usrloc, a.s.o. | ||
- | #!ifndef DBURL | + | #!define DBURL " |
- | #!define DBURL " | + | |
- | #!endif | + | |
#!ifdef WITH_ASTERISK | #!ifdef WITH_ASTERISK | ||
#!define DBASTURL " | #!define DBASTURL " | ||
Line 647: | Line 641: | ||
####### Global Parameters ######### | ####### Global Parameters ######### | ||
- | ### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR | ||
#!ifdef WITH_DEBUG | #!ifdef WITH_DEBUG | ||
debug=4 | debug=4 | ||
Line 707: | Line 700: | ||
# - by default is empty to avoid misrouting | # - by default is empty to avoid misrouting | ||
pstn.gw_ip = "" | pstn.gw_ip = "" | ||
- | pstn.gw_port = "" | ||
#!endif | #!endif | ||
Line 717: | Line 709: | ||
voicemail.srv_port = " | voicemail.srv_port = " | ||
#!endif | #!endif | ||
+ | |||
#!ifdef WITH_ASTERISK | #!ifdef WITH_ASTERISK | ||
Line 740: | Line 733: | ||
loadmodule " | loadmodule " | ||
loadmodule " | loadmodule " | ||
- | loadmodule " | ||
loadmodule " | loadmodule " | ||
loadmodule " | loadmodule " | ||
Line 834: | Line 826: | ||
modparam(" | modparam(" | ||
#!endif | #!endif | ||
- | |||
# ----- registrar params ----- | # ----- registrar params ----- | ||
Line 916: | Line 907: | ||
- | # ----- speeddial | + | # ----- speedial |
#!ifdef WITH_SPEEDDIAL | #!ifdef WITH_SPEEDDIAL | ||
modparam(" | modparam(" | ||
Line 997: | Line 988: | ||
# NAT detection | # NAT detection | ||
route(NATDETECT); | route(NATDETECT); | ||
+ | |||
+ | # handle requests within SIP dialogs | ||
+ | route(WITHINDLG); | ||
+ | |||
+ | ### only initial requests (no To tag) | ||
# CANCEL processing | # CANCEL processing | ||
if (is_method(" | if (is_method(" | ||
{ | { | ||
- | if (t_check_trans()) | + | if (t_check_trans()) |
- | route(RELAY); | + | t_relay(); |
- | } | + | |
exit; | exit; | ||
} | } | ||
- | |||
- | # handle requests within SIP dialogs | ||
- | route(WITHINDLG); | ||
- | |||
- | ### only initial requests (no To tag) | ||
t_check_trans(); | t_check_trans(); | ||
Line 1052: | Line 1042: | ||
# user location service | # user location service | ||
route(LOCATION); | route(LOCATION); | ||
+ | |||
+ | route(RELAY); | ||
} | } | ||
Line 1059: | Line 1051: | ||
# enable additional event routes for forwarded requests | # enable additional event routes for forwarded requests | ||
# - serial forking, RTP relaying handling, a.s.o. | # - serial forking, RTP relaying handling, a.s.o. | ||
- | if (is_method(" | + | if (is_method(" |
- | if(!t_is_set(" | + | t_on_branch(" |
- | } | + | t_on_reply(" |
- | if (is_method(" | + | |
- | if(!t_is_set(" | + | |
} | } | ||
if (is_method(" | if (is_method(" | ||
- | if(!t_is_set(" | + | t_on_failure(" |
} | } | ||
Line 1116: | Line 1106: | ||
# take the path determined by record-routing | # take the path determined by record-routing | ||
if (loose_route()) { | if (loose_route()) { | ||
- | route(DLGURI); | ||
if (is_method(" | if (is_method(" | ||
setflag(FLT_ACC); | setflag(FLT_ACC); | ||
setflag(FLT_ACCFAILED); | setflag(FLT_ACCFAILED); | ||
} | } | ||
- | else if ( is_method(" | + | if ( is_method(" |
# ACK is forwarded statelessy | # ACK is forwarded statelessy | ||
route(NATMANAGE); | route(NATMANAGE); | ||
- | } | ||
- | else if ( is_method(" | ||
- | # Add Record-Route for in-dialog NOTIFY as per RFC 6665. | ||
- | record_route(); | ||
} | } | ||
route(RELAY); | route(RELAY); | ||
Line 1141: | Line 1126: | ||
# must be an ACK after a 487 | # must be an ACK after a 487 | ||
# or e.g. 404 from upstream server | # or e.g. 404 from upstream server | ||
- | route(RELAY); | + | t_relay(); |
exit; | exit; | ||
} else { | } else { | ||
Line 1178: | Line 1163: | ||
route[LOCATION] { | route[LOCATION] { | ||
- | # | + | # |
# search for short dialing - 2-digit extension | # search for short dialing - 2-digit extension | ||
if($rU=~" | if($rU=~" | ||
Line 1222: | Line 1207: | ||
setflag(FLT_ACCMISSED); | setflag(FLT_ACCMISSED); | ||
} | } | ||
- | |||
- | route(RELAY); | ||
- | exit; | ||
} | } | ||
Line 1315: | Line 1297: | ||
fix_nated_register(); | fix_nated_register(); | ||
} else { | } else { | ||
- | add_contact_alias(); | + | fix_nated_contact(); |
} | } | ||
setflag(FLT_NATS); | setflag(FLT_NATS); | ||
Line 1345: | Line 1327: | ||
if (is_reply()) { | if (is_reply()) { | ||
if(isbflagset(FLB_NATB)) { | if(isbflagset(FLB_NATB)) { | ||
- | add_contact_alias(); | + | fix_nated_contact(); |
} | } | ||
- | } | ||
- | #!endif | ||
- | return; | ||
- | } | ||
- | |||
- | # URI update for dialog requests | ||
- | route[DLGURI] { | ||
- | #!ifdef WITH_NAT | ||
- | if(!isdsturiset()) { | ||
- | handle_ruri_alias(); | ||
} | } | ||
#!endif | #!endif | ||
Line 1392: | Line 1364: | ||
} | } | ||
- | if (strempty($sel(cfg_get.pstn.gw_port))) { | + | $ru = " |
- | $ru = " | + | |
- | } else { | + | |
- | $ru = " | + | |
- | + $sel(cfg_get.pstn.gw_port); | + | |
- | } | + | |
route(RELAY); | route(RELAY); | ||
Line 1525: | Line 1492: | ||
} | } | ||
#!endif | #!endif | ||
+ | |||
</ | </ |