Module: sip-router Branch: carstenbock/ims Commit: 6d73534b01d14bf6317fc74b628e8f1a8aff5825 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6d73534b...
Author: Carsten Bock carsten@bock.info Committer: Carsten Bock carsten@bock.info Date: Wed Jan 19 22:06:07 2011 +0100
PCSCF: Rx interface: specifying another application identifier when an emergency call is established (taken from commit r1017 of OpenIMSCore)
---
modules/pcscf/pcc.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/modules/pcscf/pcc.c b/modules/pcscf/pcc.c index 2e13aa9..fb98296 100644 --- a/modules/pcscf/pcc.c +++ b/modules/pcscf/pcc.c @@ -589,10 +589,11 @@ error:
//AF Service is IMS Services although it should be the IMS Communication Services static str IMS_Serv_AVP_val = {"IMS Services", 12}; +static str IMS_Em_Serv_AVP_val = {"Emergency IMS Call", 18}; static str IMS_Reg_AVP_val = {"IMS Registration", 16};
/* Session-Id, Origin-Host, Origin-Realm AVP are added by the stack. */ -int pcc_rx_req_add_mandat_avps(AAAMessage* msg, unsigned int dia_req_code, struct sip_msg * res, int registr){ +int pcc_rx_req_add_mandat_avps(AAAMessage* msg, unsigned int dia_req_code, struct sip_msg * res, int registr, int sos){
char x[4]; AAA_AVP * avp; @@ -618,9 +619,10 @@ int pcc_rx_req_add_mandat_avps(AAAMessage* msg, unsigned int dia_req_code, struc } /* Add AF-Application-Identifier AVP */ - if(!registr) - af_id = IMS_Serv_AVP_val; - else af_id = IMS_Reg_AVP_val; + if(!registr) { + if(sos) af_id = IMS_Em_Serv_AVP_val; + else af_id = IMS_Serv_AVP_val; + } else af_id = IMS_Reg_AVP_val;
if(!PCC_add_avp(msg, af_id.s,af_id.len, AVP_IMS_AF_Application_Identifier, @@ -735,7 +737,7 @@ AAAMessage *PCC_AAR(struct sip_msg *req, struct sip_msg *res, char *str1, contac } /*---------- 1. Add mandatory AVPs ----------*/ - if(!pcc_rx_req_add_mandat_avps(aar, IMS_AAR, res, is_register)) + if(!pcc_rx_req_add_mandat_avps(aar, IMS_AAR, res, is_register, service_urn.len>0)) goto error;
LOG(L_INFO,"INF:"M_NAME":PCC_AAR: auth_lifetime %u\n", auth_lifetime); @@ -993,7 +995,7 @@ AAAMessage * PCC_create_STR_auth_session_safe(AAASession * auth, int is_register if (!dia_str) goto error; - if(!pcc_rx_req_add_mandat_avps(dia_str, IMS_STR, NULL, is_register)) goto error; + if(!pcc_rx_req_add_mandat_avps(dia_str, IMS_STR, NULL, is_register, 0)) goto error;
//Termination-Cause set_4bytes(x,1);