Adding DiameterFactory to P-CSCF

32 views
Skip to first unread message

Victor Neiman

unread,
Jun 26, 2012, 3:11:21 AM6/26/12
to little...@googlegroups.com
Hi,

I am in the process of implementing the Rx DIAMETER interface on the P-CSCF and I need to add a DiameterFactory (org.cipango.diameter.api.DiameterFactory) in the P-CSCF. I wanted to add it via the pcscf.xml config file by adding the line

<bean id="diameterFactory" class="org.springframework.web.context.support.ServletContextAttributeFactoryBean">
        <property name="attributeName" value="org.cipango.diameter.api.DiameterFactory" />
</bean>   

However, upon starting littleims I get this exception in the P-CSCF log:
ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'diameterFactory' defined in URL [file:/home/vic/workspace/littleims/littleims-distribution/target/distribution/P-CSCF/etc/p-cscf.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: No ServletContext attribute 'org.cipango.diameter.api.DiameterFactory' found

Log is attached. I added the cipango-diameter-2.1.jar to the pom.xml file of the P-CSCF so it should be in the path as far as I can understand. Any advice would be much appreciated.

Regards
Victor
littleims-pcscf.log

Nicolas

unread,
Jun 26, 2012, 3:35:24 AM6/26/12
to little...@googlegroups.com
Hi Victor,
Diameter must be configured in Cipango before. So like in cipango-scscf.xml, cipango-pcscf should contains:

 <Array id="diameterConfig" type="java.lang.String">
    <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
    <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
    <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
    <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
    <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
    <Item>org.eclipse.jetty.webapp.TagLibConfiguration</Item>
    <Item>org.cipango.sipapp.SipXmlConfiguration</Item>
    <Item>org.cipango.diameter.app.DiameterConfiguration</Item>   
  </Array>

<Call name="addAppProvider">
          <Arg>
            <New class="org.cipango.deploy.providers.SipAppProvider" id="SipAppProvider">
              ...
              <Set name="configurationClasses"><Ref id="diameterConfig"/></Set>
            </New>
          </Arg>
        </Call>

  <Call name="addLifeCycle">
    <Arg>
      <New id="node" class="org.cipango.diameter.node.Node">
        <Set name="server"><Ref id="Server"/></Set>
        <Call name="addConnector">
          <Arg>
            <New class="org.cipango.diameter.bio.DiameterSocketConnector">
              <Set name="host"><SystemProperty default="s-cscf.cipango.voip" name="scscf.host"/></Set>
              <Set name="port"><SystemProperty default="3878" name="scscf.diameter.port"/></Set>
              <Set name="messageListener">
                <New class="org.cipango.diameter.log.MessageListenerCollection">
                  <Set name="server"><Ref id="Server"/></Set>
                  <Set name="messageListeners">
                    <Array type="org.cipango.diameter.log.DiameterMessageListener">
                      <Item>
                        <New class="org.cipango.callflow.diameter.JmxMessageLogger"/>
                      </Item>
                      <Item>
                        <New class="org.cipango.diameter.log.FileMessageLogger">
                          <Set name="filename"><SystemProperty default="." name="jetty.home"/>/logs/yyyy_mm_dd.diameter.log</Set>
                          <Set name="append">true</Set>
                          <Set name="retainDays">31</Set>
                        </New>
                      </Item>
                    </Array>
                  </Set>
                </New>
              </Set>
            </New>
          </Arg>
        </Call>
        <Set name="identity"><SystemProperty default="s-cscf.cipango.voip" name="scscf.host"/></Set>
        <Set name="server"><Ref id="Server"/></Set>
        <Set name="statsOn">true</Set>
        <Call name="addSupportedApplication">
          <Arg>
            <Get name="CX_APPLICATION_ID" class="org.cipango.diameter.ims.Cx"/>
          </Arg>
        </Call>
        <Call name="addPeer">
          <Arg>
            <New class="org.cipango.diameter.node.Peer">
              <Arg><SystemProperty default="hss.cipango.voip" name="hss.host"/></Arg>
            </New>
          </Arg>
        </Call>
      </New>
    </Arg>
  </Call>

  <Call name="setAttribute">
    <Arg>org.cipango.diameter.node.Node</Arg>
  <Arg><Ref id="node"/></Arg>
  </Call>
 
  <!-- For JMX -->
  <Get id="Container" name="container">
    <Call name="addBean">
      <Arg><Ref id="node"/></Arg>
    </Call>
  </Get>

 
Regards,
Nicolas
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes littleims-dev.
Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msg/littleims-dev/-/a5cHoaYBd_8J.
Pour envoyer un message à ce groupe, adressez un e-mail à little...@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse littleims-de...@googlegroups.com.
Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/littleims-dev?hl=fr


Victor Neiman

unread,
Jun 26, 2012, 4:06:37 AM6/26/12
to little...@googlegroups.com
Thank you, that fixed it. I was wondering if you could confirm the meaning of this:

<Call name="addSupportedApplication">
   <Arg>
            <Get name="CX_APPLICATION_ID" class="org.cipango.diameter.ims.Cx"/>
    </Arg>
</Call>

does this cause it to advertise the fact that it supports the Cx interface?

and this:

<Call name="addPeer">
   <Arg>
      <New class="org.cipango.diameter.node.Peer">
          <Arg><SystemProperty default="hss.cipango.voip" name="hss.host"/></Arg>
      </New>
   </Arg>
</Call>

this adds the HSS as a Diameter peer, is that correct?

Nicolas

unread,
Jun 26, 2012, 4:27:35 AM6/26/12
to little...@googlegroups.com
Victor,
The addSupportedApplication is used in CER request to give node capabilities.

You are right, the code:

<Call name="addPeer">
   <Arg>
      <New class="org.cipango.diameter.node.Peer">
          <Arg><SystemProperty default="hss.cipango.voip" name="hss.host"/></Arg>
      </New>
   </Arg>
</Call>
adds the HSS as a Diameter peer.

Nicolas

Victor Neiman

unread,
Jun 27, 2012, 9:42:04 AM6/27/12
to little...@googlegroups.com
I would like to be able to configure the P-CSCF to send Diameter messages to different hosts as well as add support for the Rx interface. I tried to edit the cipango-pcscf.xml but I am getting ConfigError messages on startup.

I edited the addSupportedApplication part as well as the addPeer part.

But I want to change it so that the P-CSCF advertises the Rx interface. I looked at the Zh and Cx classes in the org.cipango.diameter.ims package and did not see that they implement any special interfaces/abstract classes so I don't understand why my change is causing errors.


<Call name="addLifeCycle">
    <Arg>
      <New id="node" class="org.cipango.diameter.node.Node">
        <Set name="server"><Ref id="Server"/></Set>
        <Call name="addConnector">
          <Arg>
            <New class="org.cipango.diameter.bio.DiameterSocketConnector">
              <Set name="host"><SystemProperty default="p-cscf.cipango.voip" name="pcscf.host"/></Set>
              <Set name="port"><SystemProperty default="3898" name="pcscf.diameter.port"/></Set>

              <Set name="messageListener">
                <New class="org.cipango.diameter.log.MessageListenerCollection">
                  <Set name="server"><Ref id="Server"/></Set>
                  <Set name="messageListeners">
                    <Array type="org.cipango.diameter.log.DiameterMessageListener">
                      <Item>
                        <New class="org.cipango.callflow.diameter.JmxMessageLogger"/>
                      </Item>
                      <Item>
                        <New class="org.cipango.diameter.log.FileMessageLogger">
                          <Set name="filename"><SystemProperty default="." name="jetty.home"/>/logs/yyyy_mm_dd.diameter.log</Set>
                          <Set name="append">true</Set>
                          <Set name="retainDays">31</Set>
                        </New>
                      </Item>
                    </Array>
                  </Set>
                </New>
              </Set>
            </New>
          </Arg>
        </Call>
        <Set name="identity"><SystemProperty default="p-cscf.cipango.voip" name="pcscf.host"/></Set>

        <Set name="server"><Ref id="Server"/></Set>
        <Set name="statsOn">true</Set>
        <Call name="addSupportedApplication">
          <Arg>
            <Get name="RX_APPLICATION_ID" class="org.cipango.littleims.pcscf.Rx"/>

          </Arg>
        </Call>
        <Call name="addPeer">
          <Arg>
            <New class="org.cipango.diameter.node.Peer">
              <Arg><SystemProperty default="pcrf.open-ims.test" name="pcrf.host"/></Arg>

            </New>
          </Arg>
        </Call>
      </New>
    </Arg>
  </Call>

If I leave the addSupportedApplication part as it was in the cipango-hss.xml then everything works:

<Call name="addSupportedApplication">
          <Arg>
            <Get name="CX_APPLICATION_ID" class="org.cipango.diameter.ims.Cx"/>
          </Arg>
</Call>

Is there anything special that I should do with my org.cipango.littleims.pcscf.Rx class?

Thanks
Victor
Pour envoyer un message à ce groupe, adressez un e-mail à littleims-dev@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse littleims-dev+unsubscribe@googlegroups.com.

Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/littleims-dev?hl=fr
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes littleims-dev.
Pour envoyer un message à ce groupe, adressez un e-mail à littleims-dev@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse littleims-dev+unsubscribe@googlegroups.com.

Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/littleims-dev?hl=fr

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes littleims-dev.
Pour envoyer un message à ce groupe, adressez un e-mail à littleims-dev@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse littleims-dev+unsubscribe@googlegroups.com.

Victor Neiman

unread,
Jun 27, 2012, 10:08:54 AM6/27/12
to little...@googlegroups.com
Is it perhaps because I wrote the Rx class in org.cipango.littleims.pcscf.Rx instead of inside org.cipango.diameter.ims  like Cx and Zh?

Nicolas

unread,
Jun 27, 2012, 10:15:33 AM6/27/12
to little...@googlegroups.com
Hi Victor,
Is it possible to have logs and config files ?

Where is located the class org.cipango.littleims.pcscf.Rx, it must be included in $jetty.home/lib/ext and not in the war. This class is loaded by Cipango at startup before servlet application (P-CSCF) ? The packaging should be done like for the module littleims-debug-id.

Regards,
Nicolas
Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msg/littleims-dev/-/E9AFokqqJ0cJ.
Pour envoyer un message à ce groupe, adressez un e-mail à little...@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse littleims-de...@googlegroups.com.

Victor Neiman

unread,
Jun 27, 2012, 10:30:18 AM6/27/12
to little...@googlegroups.com
Config file and log attached.

org.cipango.littleims.pcscf.Rx is in the directory /littleims/littleims-pcscf/src/main/java/org/cipango/littleims/pcscf/ so then I should create the directory /littleims/littleims-pcscf/lib/ext and copy it there?
littleims-pcscf.log
cipango-pcscf.xml

Nicolas

unread,
Jun 28, 2012, 3:19:01 AM6/28/12
to little...@googlegroups.com
Victor,
You should
  1. create a new submodule called littleims-rx and packaged it as a jar (like for module littleims-debug-id),
  2. move the Rx classes into this module
  3. Add in littleims-pcscf/pom.xml a dependency as provided to this module
  4. Copy the jar littleims-rx-VERSION.jar in littleims-distribution/target/distribution/P-CSCF/lib/ext
Regards,
Nicolas

Victor Neiman

unread,
Jun 28, 2012, 7:45:26 AM6/28/12
to little...@googlegroups.com
Thank you for all the help, I am able to send an AAR request via the Rx interface in littleims now.
Pour envoyer un message à ce groupe, adressez un e-mail à littleims-dev@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse littleims-dev+unsubscribe@googlegroups.com.

Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/littleims-dev?hl=fr
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes littleims-dev.
Pour envoyer un message à ce groupe, adressez un e-mail à littleims-dev@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse littleims-dev+unsubscribe@googlegroups.com.

Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/littleims-dev?hl=fr

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes littleims-dev.
Pour envoyer un message à ce groupe, adressez un e-mail à littleims-dev@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse littleims-dev+unsubscribe@googlegroups.com.

Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/littleims-dev?hl=fr
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes littleims-dev.
Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msg/littleims-dev/-/E9AFokqqJ0cJ.
Pour envoyer un message à ce groupe, adressez un e-mail à littleims-dev@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse littleims-dev+unsubscribe@googlegroups.com.

Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/littleims-dev?hl=fr
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes littleims-dev.
Pour envoyer un message à ce groupe, adressez un e-mail à littleims-dev@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse littleims-dev+unsubscribe@googlegroups.com.

Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/littleims-dev?hl=fr

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes littleims-dev.
Pour envoyer un message à ce groupe, adressez un e-mail à littleims-dev@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse littleims-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages