Documentation |
Documentation.Tutorials-Emergency-2-2 HistoryHide minor edits - Show changes to markup December 11, 2015, at 01:30 PM
by
- Changed lines 208-211 from:
to:
Changed lines 257-258 from:
/*emergency module tables in this role: no table needs to be created. to:
/* emergency module tables in this role: * no table needs to be created. Changed lines 322-325 from:
/*emergency module tables in this role: *emergency_service_provider - need be created and inserted registers with organization information of VPC, Source and VSP nodes (attribution 0, 1 and 2 respectively). *emergency_routing - not need be created . *emergency_report - need be only created. to:
/* emergency module tables in this role: * emergency_service_provider - need be created and inserted registers with organization information of VPC, Source and VSP nodes (attribution 0, 1 and 2 respectively). * emergency_routing - not need be created . * emergency_report - need be only created. December 11, 2015, at 01:28 PM
by
- Changed line 257 from:
to:
/*emergency module tables in this role: Changed line 259 from:
to:
Changed lines 279-280 from:
emergency_service_provider – not need be created. to:
/* emergency module tables in this role: * emergency_service_provider – not need be created. Changed lines 282-283 from:
emergency_report - need be only created. to:
* emergency_report - need be only created.
Changed lines 322-326 from:
###emergency module tables in this role: emergency_service_provider - need be created and inserted registers with organization information of VPC, Source and VSP nodes (attribution 0, 1 and 2 respectively). emergency_routing - not need be created . emergency_report - need be only created. to:
/*emergency module tables in this role: *emergency_service_provider - need be created and inserted registers with organization information of VPC, Source and VSP nodes (attribution 0, 1 and 2 respectively). *emergency_routing - not need be created . *emergency_report - need be only created.
December 11, 2015, at 01:23 PM
by
- Added lines 150-185:
Emergency Module Tables
- selectiveRoutingID: The Common Language Location Indicator (CLLI) code associated with the Selective Router to which the emergency call is to be directed. - routingESN: The Emergency Services Number associated with a particular ESZ that represents a unique combination of Police, Fire and EMS emergency responders. - npa: The Numbering Plan Area associated with the outgoing route to the Selective Router that is appropriate for caller’s location. - esgwri: this field will contain the Routing Key that allows routing of the call to the Selective Router servicing the local area in which the call was made.
- organizationName: provider company name’s. This parameter is optional field in the NENA v2 interface (call server - VPC). - hostId: provider hostname’s. This parameter is mandatory if attribution is 0(source) or 2(VSP), otherwise it is optional. - nenaId: the NENA administered company identifier (NENA Company ID) of provider. This parameter is optional field in the NENA v2 interface (call server - VPC). - contact: telephone number by which the provider operator can be reached 24 hours a day, 7 days a week. This parameter is mandatory if attribution is 0(source) or 2(VSP), otherwise it is optional. - certUri: provides a means of directly obtaining the VESA(Valid Emergency Services Authority) issued certificate for the provider. This parameter is optional field in the NENA v2 interface (call server - VPC). - nodeIp: IP address of the node that is being registered. This parameter is mandatory. - attribution: It is a field of type int designating the function of the organization involved in the composition of architecture NENA being registered in this table. This parameter is mandatory.
1 - the organization is a Source. Source is node directly requesting emergency call routing from the VPC; 2 - the organization is a VPC. VPC is the routing information provider to emengency call; 3 - the organization is a VSP. VSP is the caller's voice service provider;
- callid: INVITE header that uniquely identifies the call at the Call Server. - vpc_organizationName: is VPC company name’s - vpc_hostname: is VPC hostname. - vpc_timestamp: is the date time stamp in UTC time format indicating the time that the message was sent from the VPC node. - selectiveRoutingID: The Common Language Location Indicator (CLLI) code associated with the Selective Router to which the emergency call is to be directed. - routingESN: The Emergency Services Number associated with a particular ESZ that represents a unique combination of Police, Fire and EMS emergency responders. - npa: The Numbering Plan Area (NPA) associated with the outgoing route tothe Selective Router that is appropriate for caller’s location. - lro: last routing option.This routing option should only be used by the call server or proxy as a last resort. - result: code indicating the reason for success or failure to VPC determine an routing. - disposition: disposition of the call (e.g., ESGWRI or LRO used). Configuration Script Added lines 202-203:
The other parameters and tasks which the functions execute depends on its role within the possible scenarios. Added lines 207-212:
/*
Changed lines 214-259 from:
modparam("emergency", "proxy_role", 0)
modparam("emergency", "url_vpc", "http://192.268.0.103/fcgi-bin/fcgid.fcgi")
modparam("emergency", "source_hostname", "rp34.example.com") modparam("emergency", "source_contact" , "tel:+398348975439823")
modparam("emergency", "vsp_hostname" ,"cs98.example.com") modparam("emergency", "vsp_contact" , "tel:+15554476632")
modparam("emergency", "source_hostname", "rp34.example.com") modparam("emergency", "source_contact" , "tel:+398348975439823")
modparam("emergency", "vsp_organization_name" ,"Nadine Call-Server") modparam("emergency", "vsp_nena_id" , "nena2") modparam("emergency", "vsp_cert_uri" , "https://cs98.example.com/certificate.crt"
modparam("emergency", "source_organization_name","Terry re-direct proxy") modparam("emergency", "source_nena_id", "nena1") modparam("emergency", "source_cert_uri" , "https://rp34.example.com/certificate.crt")
modparam("emergency", "vpc_organization_name","Anand VPC") modparam("emergency", "vpc_hostname","vpc.example.com") modparam("emergency", "vpc_nena_id","nena1") modparam("emergency", "vpc_contact" ,"tel:+398348975439823") modparam("emergency", "vpc_cert_uri","https://rp34.example.com/certificate.crt")
modparam("emergency", "contingency_hostname","192.268.0.105")
modparam("emergency", "db_table_routing","emergency_routing")
modparam("emergency", "db_table_report","emergency_report") to:
modparam("emergency", "proxy_role", 0)
modparam("emergency", "proxy_role", 1)
modparam("emergency", "url_vpc", "http://192.168.0.103/fcgi-bin/fcgid.fcgi")
modparam("emergency", "contingency_hostname","192.168.0.105")
modparam("emergency", "db_table_routing","emergency_routing")
modparam("emergency", "db_table_report","emergency_report")
modparam("emergency", "db_table_provider","emergency_service_provider") Changed lines 257-262 from:
modparam("emergency", "proxy_role", 2)
modparam("emergency", "emergency_call_server","192.268.0.105") to:
no table needs to be created. ###mandatory parameters to configure in this roles:
modparam("emergency", "proxy_role", 2)
modparam("emergency", "emergency_call_server","192.168.0.105") Changed lines 279-294 from:
modparam("emergency", "proxy_role", 3)
modparam("emergency", "emergency_call_server","192.268.0.105")
modparam("emergency", "contingency_hostname","192.268.0.105")
modparam("emergency", "db_table_routing","emergency_routing")
modparam("emergency", "db_table_report","emergency_report") to:
emergency_service_provider – not need be created. emergency_routing - need be created and inserted with ERT information and its ESGWRI matching , only in case of VPC don't do it. emergency_report - need be only created. ###mandatory parameters to configure in this roles:
modparam("emergency", "proxy_role", 3)
modparam("emergency", "emergency_call_server","192.168.0.105") ###optional parameters to configure in this roles:
modparam("emergency", "contingency_hostname","192.168.0.105")
modparam("emergency", "db_table_routing","emergency_routing")
modparam("emergency", "db_table_report","emergency_report") Changed lines 322-355 from:
modparam("emergency", "proxy_role", 4)
modparam("emergency", "url_vpc", "http://192.268.0.103/fcgi-bin/fcgid.fcgi")
modparam("emergency", "source_hostname", "rp34.example.com") modparam("emergency", "source_contact" , "tel:+398348975439823")
modparam("emergency", "vsp_hostname" ,"cs98.example.com") modparam("emergency", "vsp_contact" , "tel:+15554476632")
modparam("emergency", "vsp_organization_name" ,"Nadine Call-Server") modparam("emergency", "vsp_nena_id" , "nena2") modparam("emergency", "vsp_cert_uri" , "https://cs98.example.com/certificate.crt"
modparam("emergency", "source_organization_name","Terry re-direct proxy") modparam("emergency", "source_nena_id", "nena1") modparam("emergency", "source_cert_uri" , "https://rp34.example.com/certificate.crt")
modparam("emergency", "vpc_organization_name","Anand VPC") modparam("emergency", "vpc_hostname","vpc.example.com") modparam("emergency", "vpc_nena_id","nena1") modparam("emergency", "vpc_contact" ,"tel:+398348975439823") modparam("emergency", "vpc_cert_uri","https://rp34.example.com/certificate.crt")
to:
###emergency module tables in this role: emergency_service_provider - need be created and inserted registers with organization information of VPC, Source and VSP nodes (attribution 0, 1 and 2 respectively). emergency_routing - not need be created . emergency_report - need be only created. ###mandatory parameters to configure in this roles:
modparam("emergency", "proxy_role", 4)
modparam("emergency", "url_vpc", "http://192.168.0.103/fcgi-bin/fcgid.fcgi") ###optional parameters to configure in this roles:
Added line 385:
#record_route(); use this only in role_proxy = 3 March 16, 2015, at 07:15 PM
by
- Added lines 1-432:
Documentation -> Tutorials -> Emergency Calls using OpenSIPSThis page has been visited 6750 times. (:toc-float Table of Content:) Authors
Tutorial OverviewThe emergency module provides emergency call treatment for OpenSIPS, following the architecture i2 specification of the american entity NENA(National Emergency Number Association). This tutorial presents the i2 architecture, as well as the steps you need to follow in order to integrate emergency calls in OpenSIPS script. ProblemUntil recently it was not possible to make a VoIP call to an unified emergency number of a particular country (911 in US or 112 in Europe). The difficulty is precisely in flexibility that the user has to originate a call anywhere in the world where you have access to Internet. As a result of this flexibility, the location information of the user is not known on a VoIP call. The location is central to an emergency call for two reasons: to be able to route the call to the PSAP(call center responsible for answering emergency calls) nearest to where the call occurs, and so the attendants can send help to the scene. In conventional telephony, routing is easily done by knowing the switch of the subscriber, and using the callback number, that is transmitted along with the signalling, the operator has the address relation for service. In cellular routing is performed considering the location of the radio base station serving the mobile device, and through methods of obtaining the location of the mobile device (such as Triangulation) location information can be obtained by using an architecture specifies attendant to this purpose. The need for an emergency call beyond the obvious aspect of the rescue VoIP user, you can also find other aspects, for example, regulatory agencies of a country that establishes the realization of an emergency call as one of the minimum requirements to be met by this technology to be able to regulate it. Meet this regulatory aspect is important to that these agencies recognize VoIP as an alternative to conventional telephony and thereby grant VSP operators a numbering plan specific to VoIP, fundamental condition to the growth this technology in market. Besides these aspects, we must also consider the gain of resources to conduct an emergency call on a VoIP environment entirely, as the ease of integration of the call to the monitoring system call. Another example would be to use the video feature, the PSAP attendant to assess the status of the event and be able to guide someone on site already provide first aid to the victim, optimizing the provision of relief. SolutionThe IETF formed a working group to study the emergency call to the IP network, numerous RFCs came to this topic. They created the concept of LIS (Location Information Server), responsible for storing location information of a given target using the precepts of Geopriv[15]. The LIS should be housed in the ISP (Internet Service Provider) that provides Internet access to the device and can provide caller location information in two ways:
To transport and store the new parameters that are required to perform an emergency call, several protocols have to be adapted, including SIP who added new headers and new types of content, as well as new protocols were created, like HELD. Were considered for transport protocols both binary format (DHCP), such as using text-based XML (HTTP, SIP). They also created Lost Server[6], a server used to determine the routing of the call depending on the location of the caller. Lost would be part of the architecture of the VSP (VoIP Service Provider). The IETF has produced an architecture involving all these created or altered[13] elements. We will not detail this architecture, since our focus is in architecture specified by NENA that has a stronger purpose for OpenSIPS as discussed below. NENA i2 architectureThe NENA (National Emergency Number Association) is a group comprised of the Emergency Service American community. This group discussed and proposed technical and operational solution for emergency call over the IP network to American coverage. The architecture proposed by this group is heavily based on concepts and protocols defined by IETF for emergency call. However there are differences in the two proposed architectures. The role of the endpoint in NENA architecture decreases with respect to the routing of the call, which happens to be a function of the VSP Call Server. The endpoint is limited to identifying the emergency call that in the American case is limited to 911, and get your location. Another point is that the architecture of the IETF, considered the PSAP also attend a SIP call. The NENA preferred split into two phases: the first NENA i2, considering the legacy PSAP (in PSTN network), and a later stage NENA i3, which provides the PSAP in an exclusive emergency IP network. ComponentsThe components of this architecture shown in figure below: http://www.opensips.org/images/Tutorial-Emergency/emergency-figure1.png
ScenariosFrom the business viewpoint, several scenarios can be discerned in this architecture: Scenario ICall Server of caller VSP takes over the treatment of the emergency call. The VSP is also the provider (source) that interfaces with the VPC. The scenario uses the following operating sketch: http://www.opensips.org/images/Tutorial-Emergency/emergency-figure2.png Below are the steps to be followed to make an emergency call:
The signal flow exchanged in the first scenario is shown in the figure below: http://www.opensips.org/images/Tutorial-Emergency/emergency-figure3.png Scenario IICall Server of caller VSP routes the emergency call for a Routing Proxy from a third party SIP provider, which makes treatment and henceforth takes over the call. In this scenario the interfaces: v0, v3, v7, v8, as well as the PSTN interfaces, are identical to those of scenario I, therefore will not be described here. The following figure shows the operating sketch for this scenario: http://www.opensips.org/images/Tutorial-Emergency/emergency-figure4.png The differential steps for this scenario are listed below:
The signal flow exchanged in the second scenario is shown in the figure below: http://www.opensips.org/images/Tutorial-Emergency/emergency-figure5.png Scenario IIICall Server of caller VSP requests from a Redirect Server the other provider routing information to emergency call, but in this case the Call Server that forwards and takes over the call. This third provider may be a provider specialized in the treatment of emergency call. In this scenario the interfaces: v0, v3, v7, v8, as well as the PSTN interfaces, are identical to those of scenario I therefore will not be described here. The following figure shows the scenario: http://www.opensips.org/images/Tutorial-Emergency/emergency-figure6.png The differential steps for this scenario are listed below:
The signal flow exchanged in the third scenario is shown in the following picture: http://www.opensips.org/images/Tutorial-Emergency/emergency-figure7.png OpenSIPSIn this architecture OpenSIPS can act as the Call Server, as Redirect Server or as Routing Proxy depending on the role you want to assign it in each scenario. The emergency module was developed to make OpenSIPS fulfill the functional requirements demanded by NENA. This module includes some parameters to be set in the configuration script, and we created two new functions: The next section addresses the tasks that these functions perform and explain the parameters. Initially we are going start by the parameters that are common regardless of the OpenSIPS' role to be configured for the module emergency: loadmodule "emergency.so" # loads the module ### mandatory parameters # defines URL database where store relevant tables to the emergency module modparam("emergency", "db_url", "mysql://opensips:opensipsrw@localhost/opensips") # defines emergency codes that OpenSIPS should consider for treating emergency call modparam("emergency", "emergency_codes", "911-Código de emergência dos EUA") modparam("emergency", "emergency_codes", "112-Código de Emergência Europeu") ### optional parameters # time interval in which OpenSIPS carries to memory the data in the routing table in order to optimize server performance modparam("emergency", "timer_interval",30) Call Server in the scenario I or as the Routing Server in scenario II### mandatory parameters to configure in this roles: # proxy role = 0 defines the OpenSIPS as Call Server(scenario I) or 2 as Routing Server(scenario II) modparam("emergency", "proxy_role", 0) # VPC's IP address that OpenSIPS interfaces to get routing data modparam("emergency", "url_vpc", "http://192.268.0.103/fcgi-bin/fcgid.fcgi") ### to work as Routing Proxy in scenario II the following parameters are required: # mandatory parameters of the third-party provider (source) to be passed to the SVC modparam("emergency", "source_hostname", "rp34.example.com") modparam("emergency", "source_contact" , "tel:+398348975439823") # mandatory parameters of VSP to be passed to the SVC modparam("emergency", "vsp_hostname" ,"cs98.example.com") modparam("emergency", "vsp_contact" , "tel:+15554476632") ### to work as Call Server in scenario II the following parameters are required, since the source is the VSP own: # mandatory parameters of VSP (source) to be passed to the SVC modparam("emergency", "source_hostname", "rp34.example.com") modparam("emergency", "source_contact" , "tel:+398348975439823") ### optional parameters to configure in this roles: # optional VSP parameters passed to the VPC, only if OpenSIPS act as Routing Server, in accordance with the specification of NENA v2 interface(Call Server-VPC) modparam("emergency", "vsp_organization_name" ,"Nadine Call-Server") modparam("emergency", "vsp_nena_id" , "nena2") modparam("emergency", "vsp_cert_uri" , "https://cs98.example.com/certificate.crt" # optional source parameters passed to the VPC, in accordance with the specification of NENA v2 interface(Call Server-VPC) modparam("emergency", "source_organization_name","Terry re-direct proxy") modparam("emergency", "source_nena_id", "nena1") modparam("emergency", "source_cert_uri" , "https://rp34.example.com/certificate.crt") # VPC parameters passed to the own VPC, in accordance with the specification of NENA v2 interface(Call Server-VPC) modparam("emergency", "vpc_organization_name","Anand VPC") modparam("emergency", "vpc_hostname","vpc.example.com") modparam("emergency", "vpc_nena_id","nena1") modparam("emergency", "vpc_contact" ,"tel:+398348975439823") modparam("emergency", "vpc_cert_uri","https://rp34.example.com/certificate.crt") # contingency proxy URI to route the emergency call, if the routing mechanism made between OpenSIPS and VPC fails modparam("emergency", "contingency_hostname","192.268.0.105") # name of the table that makes the replacement of emergency area identity received of VPC(ERT) in URI to routing the request. modparam("emergency", "db_table_routing","emergency_routing") # name of the table that store metadata associated with a call modparam("emergency", "db_table_report","emergency_report") Tasks performed by
Tasks performed by If no succeed in transmitting the INVITE by routing defined in above steps, configuration file must contain the Call Server in the scenario II### mandatory parameters to configure in this roles # Proxy role = 2 defines OpenSIPS as Call Server in scenario II modparam("emergency", "proxy_role", 2) # defines the IP address of the Routing proxy from a third party SIP provider that will handle the emergency call modparam("emergency", "emergency_call_server","192.268.0.105") Tasks performed by ##emergency_call## function in this role:
The command Call Server in the scenario III### mandatory parameters to configure in this roles # proxy role = 3 defines Opensips as Call Server in scenario III modparam("emergency", "proxy_role", 3) # defines the IP address of Redirect Server that will handle the emergency call modparam("emergency", "emergency_call_server","192.268.0.105") ### optional parameters to configure in this roles: # contingency proxy URI to route the emergency call, if the routing mechanism made between OpenSIPS and VPC fails modparam("emergency", "contingency_hostname","192.268.0.105") # name of the table that makes the replacement of emergency area identity received of VPC(ERT) in URI to routing the request modparam("emergency", "db_table_routing","emergency_routing") # name of the table that store metadata associated with a call modparam("emergency", "db_table_report","emergency_report") Tasks performed by
Tasks performed by
Redirect Server in the scenario III### mandatory parameters to configure in this roles: # proxy role = 4 defines Opensips as Redirect Server in scenario III modparam("emergency", "proxy_role", 4) # VPC's IP address that OpenSIPS interfaces to get routing data modparam("emergency", "url_vpc", "http://192.268.0.103/fcgi-bin/fcgid.fcgi") # mandatory parameters of the third-party provider (source) to be passed to the SVC modparam("emergency", "source_hostname", "rp34.example.com") modparam("emergency", "source_contact" , "tel:+398348975439823") # mandatory parameters of VSP to be passed to the SVC modparam("emergency", "vsp_hostname" ,"cs98.example.com") modparam("emergency", "vsp_contact" , "tel:+15554476632") ### optional parameters to configure in this roles: # optional VSP parameters passed to the VPC, only if OpenSIPS act as Routing Server, in accordance with the specification of NENA v2 interface(Call Server-VPC) modparam("emergency", "vsp_organization_name" ,"Nadine Call-Server") modparam("emergency", "vsp_nena_id" , "nena2") modparam("emergency", "vsp_cert_uri" , "https://cs98.example.com/certificate.crt" # optional source parameters passed to the VPC, in accordance with the specification of NENA v2 interface(Call Server-VPC) modparam("emergency", "source_organization_name","Terry re-direct proxy") modparam("emergency", "source_nena_id", "nena1") modparam("emergency", "source_cert_uri" , "https://rp34.example.com/certificate.crt") # VPC parameters passed to the own VPC, in accordance with the specification of NENA v2 interface(Call Server-VPC) modparam("emergency", "vpc_organization_name","Anand VPC") modparam("emergency", "vpc_hostname","vpc.example.com") modparam("emergency", "vpc_nena_id","nena1") modparam("emergency", "vpc_contact" ,"tel:+398348975439823") modparam("emergency", "vpc_cert_uri","https://rp34.example.com/certificate.crt") # name of the table that store metadata associated with a call modparam("emergency", "db_table_report","emergency_report") Tasks performed by
or via parameter ERT (Emergency Route Touple), which contains three fields identifying the emergency area: Selective Routing Identifier, ESN (Emergency Services Number) and the NPA (Numbering Plan Area). The Call Server/ Routing Proxy translates these fields to an URI that the request should be routed. this is done by populating the table defined by db_emergency_routing containing the columns of the ERT field and a column that translates the target URI. This information must be included in Contact header in a response 300/302 to be transmitted to the Call Server, for it can routing the INVITE
The command Configuration Example### use of emergency_call command with OpenSIPS working as Call Server # in the scenarios I, II, III and Routing Server in scenario II ####### Routing Logic ######## route{ if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; } # emergency call - start xlog("CONF -----verify EMERGENCY -----------\n"); if (emergency_call()) { t_on_failure("emergency_call"); t_relay(); exit; } else { xlog("CONF-------NOT EMERGENCY – CONTINUE WITH OTHES CALLS TREATMENTS -----------\n"); } # emergency call – end ... } ### use of failure command with OpenSIPS working as Call Server in scenarios I # and Routing Server for scenario II, this command does not make sense to # OpenSIPS working as Call Server in scenarios II and III: failure_route[emergency_call] { xlog(" FAILURE ... \n"); if(failure()){ xlog(" RETRANSMITE ... \n"); if (!t_relay()) { send_reply("500","Internal Error"); exit; }; t_on_failure("emergency_call"); exit; } } ### use of emergency_call command with OpenSIPS working as Proxy Redirect in # scenario III (in this case we do not need t_relay () command because the # INVITE received will not be forwarded). The failure command also does not # make sense in this paper: ####### Routing Logic ######## route{ if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; } # emergency call - start xlog("CONF -----verify EMERGENCY -----------\n"); if (emergency_call()){ t_on_failure("emergency_call"); exit; }else{ xlog("CONF-------NOT EMERGENCY – CONTINUE WITH OTHES CALLS TREATMENTS -----------\n"); } #emergency call – end ... } References
|