SIP Attended Call Transfer In Cluster
(Created page with " This page documents how to configure Yate to handle a SIP attended call transfer for an unknown call leg.<br> If the SIP module can't find the call in its list it will try to...") |
(→Configure cdrbuild to copy extra parameter(s)) |
||
(33 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | This page documents how to configure Yate to handle a SIP attended call transfer for an unknown call leg.<br> | + | This page documents how to configure Yate to handle a SIP attended call transfer for an unknown call leg in the cluster node.<br> |
− | If the SIP module can't find the call in its list it will try to route and execute the transfer request. | + | If the SIP module can't find the call in its list, it will try to route and execute the transfer request. |
− | + | Below are the steps to follow. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | ===Enable REFER method handler in the [[ | + | ===Enable REFER method handler in the [[SIP Configuration File#Configuration|SIP module]]=== |
− | + | ysipchan.conf | |
− | + | ||
[general] | [general] | ||
+ | ;Allow handling the REFER message to perform transfers | ||
transfer=yes | transfer=yes | ||
Line 22: | Line 17: | ||
'''REMEMBER: It is mandatory to choose node names that can be easily resolved to an IP address.<br> | '''REMEMBER: It is mandatory to choose node names that can be easily resolved to an IP address.<br> | ||
The SIP call to another cluster will fail if its name can't be resolved.'''<br> | The SIP call to another cluster will fail if its name can't be resolved.'''<br> | ||
− | See also [[ | + | See also [[Node Name]] and [[clustering]]. |
− | + | '''Set node name''' | |
− | + | yate.conf | |
− | + | ||
[general] | [general] | ||
+ | ;Name of this node in a cluster | ||
nodename=somehost | nodename=somehost | ||
− | |||
=== Enable and configure the clustering module=== | === Enable and configure the clustering module=== | ||
− | + | clustering.conf | |
− | + | ||
[general] | [general] | ||
+ | ;Regular expression describing node name match rules | ||
regexp=^[[:alnum:].-]\+$ | regexp=^[[:alnum:].-]\+$ | ||
+ | ;Template for forwarding the call to target node | ||
callto=sip/sip:cluster/${called}@\0 | callto=sip/sip:cluster/${called}@\0 | ||
− | |||
=== Enable and configure the line tracker === | === Enable and configure the line tracker === | ||
The line tracker is used to maintain the list of call legs in the database.<br> | The line tracker is used to maintain the list of call legs in the database.<br> | ||
− | The example below assumes the existence of a 'cluster' account in a database module containing a 'lines' table with the following text columns: 'nodeprefix','chan','callid','nodename'.<br> | + | The example below assumes the existence of a 'cluster' account in a database module containing a 'lines' table with the following text columns: 'nodeprefix','chan','callid','nodename'. The database can be configured in [[Modules#Database_Drivers| mysqldb.conf]] or [[Modules#Database_Drivers|pgsqldb.conf]]<br> |
See also [[register]]. | See also [[register]]. | ||
− | + | register.conf | |
− | + | ||
[general] | [general] | ||
+ | ;Activate line status tracking on "call.cdr" | ||
linetracker=yes | linetracker=yes | ||
[linetracker] | [linetracker] | ||
+ | ; Queries for the line usage tracker | ||
account=cluster | account=cluster | ||
initquery=DELETE FROM lines WHERE nodename='${nodename}' | initquery=DELETE FROM lines WHERE nodename='${nodename}' | ||
Line 63: | Line 58: | ||
cdr_finalize=DELETE FROM lines WHERE nodeprefix='${nodeprefix}' AND chan='${chan}' | cdr_finalize=DELETE FROM lines WHERE nodeprefix='${nodeprefix}' AND chan='${chan}' | ||
cdr_update=UPDATE lines SET callid='${callid}' WHERE nodeprefix='${nodeprefix}' AND chan='${chan}' | cdr_update=UPDATE lines SET callid='${callid}' WHERE nodeprefix='${nodeprefix}' AND chan='${chan}' | ||
− | |||
===Route transfer requests using the line tracker=== | ===Route transfer requests using the line tracker=== | ||
Line 69: | Line 63: | ||
The example below returns a cluster pickup target. | The example below returns a cluster pickup target. | ||
− | + | register.conf | |
− | + | ||
[general] | [general] | ||
+ | ;Activate handler on the "call.route" message | ||
call.route=yes | call.route=yes | ||
[call.route] | [call.route] | ||
+ | ; Query and result name for the routing message | ||
account=cluster | account=cluster | ||
query=SELECT nodeprefix || 'pickup/' || chan AS location FROM routes WHERE callid='${callid}' AND '${reason}'='transfer' | query=SELECT nodeprefix || 'pickup/' || chan AS location FROM routes WHERE callid='${callid}' AND '${reason}'='transfer' | ||
result=location | result=location | ||
− | |||
− | ===Configure [[cdrbuild]] to copy extra parameter(s)=== | + | ===Configure [[CDR Build Module|cdrbuild]] to copy extra parameter(s)=== |
− | We need the [[cdrbuild]] module to update and forward the '''callid''' parameter.<br> | + | We need the [[CDR Build Module|cdrbuild]] module to update and forward the '''callid''' parameter.<br> |
− | The '''callid''' parameter is added by the [[ | + | The '''callid''' parameter is added by the [[SIP_Configuration_File#Configuration|SIP module]].<br> |
It is built from SIP dialog data ('Call-ID', 'From' tag, 'To' tag).<br> | It is built from SIP dialog data ('Call-ID', 'From' tag, 'To' tag).<br> | ||
− | + | cdrbuild.conf | |
− | + | ||
[parameters] | [parameters] | ||
+ | ;added parameter '''callid''' to be monitorized, will appear in "call.cdr" | ||
callid=true | callid=true | ||
+ | |||
+ | '''See also''' | ||
+ | |||
+ | * [[Register]] | ||
+ | * [[Clustering]] | ||
+ | * [[CDR Build Module]] | ||
+ | * [[SIP Configuration File]] | ||
+ | * [[Telephony]] | ||
+ | |||
+ | [[Category:SIP]] [[Category:Call tranfer]] [[Category:Cluster]] |
Latest revision as of 11:00, 4 November 2013
This page documents how to configure Yate to handle a SIP attended call transfer for an unknown call leg in the cluster node.
If the SIP module can't find the call in its list, it will try to route and execute the transfer request.
Below are the steps to follow.
Contents |
[edit] Enable REFER method handler in the SIP module
ysipchan.conf
[general] ;Allow handling the REFER message to perform transfers transfer=yes
[edit] Enable and configure clustering
REMEMBER: It is mandatory to choose node names that can be easily resolved to an IP address.
The SIP call to another cluster will fail if its name can't be resolved.
See also Node Name and clustering.
Set node name
yate.conf
[general] ;Name of this node in a cluster nodename=somehost
[edit] Enable and configure the clustering module
clustering.conf
[general] ;Regular expression describing node name match rules regexp=^[[:alnum:].-]\+$ ;Template for forwarding the call to target node callto=sip/sip:cluster/${called}@\0
[edit] Enable and configure the line tracker
The line tracker is used to maintain the list of call legs in the database.
The example below assumes the existence of a 'cluster' account in a database module containing a 'lines' table with the following text columns: 'nodeprefix','chan','callid','nodename'. The database can be configured in mysqldb.conf or pgsqldb.conf
See also register.
register.conf
[general] ;Activate line status tracking on "call.cdr" linetracker=yes [linetracker] ; Queries for the line usage tracker account=cluster initquery=DELETE FROM lines WHERE nodename='${nodename}' cdr_initialize=INSERT INTO lines(nodeprefix,chan,callid,nodename)\ VALUES('${nodeprefix}', '${chan}', '${callid}', '${nodename}') cdr_finalize=DELETE FROM lines WHERE nodeprefix='${nodeprefix}' AND chan='${chan}' cdr_update=UPDATE lines SET callid='${callid}' WHERE nodeprefix='${nodeprefix}' AND chan='${chan}'
[edit] Route transfer requests using the line tracker
The example below returns a cluster pickup target.
register.conf
[general] ;Activate handler on the "call.route" message call.route=yes [call.route] ; Query and result name for the routing message account=cluster query=SELECT nodeprefix || 'pickup/' || chan AS location FROM routes WHERE callid='${callid}' AND '${reason}'='transfer' result=location
[edit] Configure cdrbuild to copy extra parameter(s)
We need the cdrbuild module to update and forward the callid parameter.
The callid parameter is added by the SIP module.
It is built from SIP dialog data ('Call-ID', 'From' tag, 'To' tag).
cdrbuild.conf
[parameters] ;added parameter callid to be monitorized, will appear in "call.cdr" callid=true
See also