cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4841
Views
15
Helpful
14
Replies

VXML app to parse all sip headers.

azizshaik
Level 1
Level 1

Hi,

We have a need to parse all the sip headers in a Vxml application, is there a way to do achieve this? i have found articles to parse custom sip headers but couldn't find any reference where there is an vxml app to parse all the sip headers.

here is the call flow.

1.CVP sends the call to ICM.

2.ICM will call a vxml application. this application will parse the sip headers and implement a business flow based on the headers..

please let us know this can even be achieved?

Any help would be greatly appreciated.

Thanks

Aziz.

1 Accepted Solution

Accepted Solutions

Aziz,

That error suggests the VoiceXML is invalid; did you modify the code?  Anyway, attached is a JAR with the custom element if you want to try that instead.  If you think the SIP headers are not visible then make sure you have header-passing enabled under voice service voip --> sip config on the gateway.

Not sure if you're concerned right now about what will happen with the VVB but be aware that getting SIP headers this way will simply not work.  In that case you have to get them via the CVP Call Server and ICM script or use a different custom approach to query the ingress gateway.

Paul

View solution in original post

14 Replies 14

Gerry O'Rourke
Spotlight
Spotlight

Aziz,

Would you be able to describe a few of the business flow cases where this use case is needed?

It would be unusual that you woudl need ALL the SIP headers to make a business decision?

Its is easy to get the Cisco GUID without any SIP header passing from one of the standard ECC variables and I find getting both the To and From headers useful. So Mutiple headers are possible to get from CVP Call Server and then passed onto the VXML server, but there is a max space limit of 255 characters for the variable call.SIPHeader .

So using this method it would not be possible to get ALL the header values.

My recommendation is to define what the business flows are and limit the number of headers you need to the minimum and pass these values from CVP into your Call Studio application and you if you need help with this clarify your query here.

Example:Let say you just need the "To" and "From" headers, then you define the "To" and "From" header in CVP Call Server to be passed (via CVP ops console) and these values for both headers will be assigned to variable call.SIPHeader (max length 255) and the two values are sperated by a pipe e.g. "|"

Below is an example of a SIP INVITE packet - do you really have a business flow reason for needing the header "Max-Forwards" and "expires" etc.?

Useful Reference:

https://supportforums.cisco.com/t5/contact-center/cvp-custom-sip-header/td-p/1885101

Gerry.

----Example of SIP INVITE---

INVITE sip:77777777774196@vxml-browsers-tst.aib.pri;transport=tcp SIP/2.0

Via: SIP/2.0/TCP 192.168.122:5060;branch=z9hG4bKVlX4cC6pEbBtYClQ+6RePQ~~856513

Max-Forwards: 66

To: <sip:77777777774196@vxml-browsers-tst.aib.pri;transport=tcp>

From: "--CVP_11_5_1_0_1_0_349" <sip:+353155512345@192.168.122:5060>;tag=dsb6202370

Call-ID: 529F14124BC811E888B92C5A0FE69470-15251048393521472@192.168.122

CSeq: 1 INVITE

Content-Length: 338

Contact: <sip:+35312048985@192.168.122:5060;transport=tcp>

Expires: 15

User-Agent: CVP 11.5 (1) ES-12 Build-73

Call-Info: <sip:10.24.40.146:5060>;purpose=x-cisco-origIP

Remote-Party-ID: "--CVP_11_5_1_0_1_0_349" <sip:+35312048985@10.24.40.146>;party=calling;screen=yes;privacy=off

Date: Mon, 30 Apr 2018 16:13:59 GMT

Min-SE: 1800

Cisco-Guid: 1386157074-1271402984-2293836890-0266769520

Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER

Allow-Events: kpml, telephone-event

Content-Disposition: session;handling=required

Cisco-Gucid: 529F14124BC811E888B92C5A0FE69470

Supported: timer

Supported: resource-priority

Supported: replaces

Supported: sdp-anat

Content-Type: application/sdp

App-Info: <192.168.122:7000:7443:OMGUCCECVP1BTST>


v=0

o=Cisco-CVP-B2BUA 289844526 289844527 IN IP4 192.168.122

s=SIP Call

c=IN IP4 10.24.40.146

t=0 0

m=audio 17350 RTP/AVP 8 0 18 101 19

c=IN IP4 10.24.40.146

a=rtpmap:8 PCMA/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:18 G729/8000

a=fmtp:18 annexb=no

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-15

a=rtpmap:19 CN/8000

a=ptime:20

Thanks for the reply,

The business case is for fraud analysis and you are right that we don't need the entire packet but we will surely need most of the packet info and it wont fit in the 255 character limit of call.SipHeader and to make matters worse we are already using a portion of call.SipHeader to store the guid..

and since the headers differ from carrier to carrier we were just wanted to see if there is a way to get the sip pay load info..

Aziz.

Aziz,

You can free up the SIPHeader space if you use it to get the Cisco-GUID by obtaining this value using the ECC variable user.media.id

This ECC will contain the value of the Cisco-Guid which is in the SIP header converted into Hex and is what is also used as the Call ID in the CVP logs as well.

Note there is also a Call-ID - which if you need would use the SIP header for obtain that.

Maybe getting the To, From, Call-ID might be suffiient and would fit in the 255 length and also get the Cisco-GUID via user.media.id

i.e. the 4 values together would be prettty good for this type of application?

Gerry

ptindall
Cisco Employee
Cisco Employee

Provided you're not using the VVB, the VoiceXML variable session.com.cisco.proto_headers can be used to access an '&' separated list of all SIP Headers.   However, the problem is getting that block of data back into Studio variables as it breaks the normal parsing of submitted data.  It would take a custom element to manipulate the returned data into something accessible from the Studio app.    As an alternative, if you know the specific SIP headers you're interested in then there is a custom GetSIPHeaders Studio element posted here Box

Hi Paul,

that is exactly what we did to parse the sip headers and i followed this reference TCLTransfer1.0.3. not compiled TCLTransfer.java... | Cisco Communities.

i built the custom element to get the sip headers but for some reason i get an error when the custom element is called. my thought process was that cvp may not be sending the sip headers to the vxml app.. but looks like from what you have said that might not be the case.. my error is mentioned below and any help in this regard is appreciated...

i am newbie with respect to CVP and vxml apps and please excuse me if i am not making any sense...

Thanks

Aziz.

10.18.3.101.1524867474446.1.NextCaller_Test,04/27/2018 16:17:54.493, The error was: The element encountered an exception of type com.audium.core.vfc.VException. The root cause was: com.audium.core.vfc.VException: A form variable must have a name.

com.audium.server.AudiumException: The element encountered an exception of type com.audium.core.vfc.VException.

at com.audium.server.voiceElement.VoiceElementBase.getVoiceElementResult(VoiceElementBase.java:773)

at com.audium.server.voiceElement.VoiceElementBase.service(VoiceElementBase.java:519)

at com.audium.server.controller.Controller.goToVoiceElement(Controller.java:4173)

at com.audium.server.controller.Controller.goToElement(Controller.java:3996)

at com.audium.server.controller.Controller.continueCall(Controller.java:3702)

at com.audium.server.controller.Controller.doPost(Controller.java:1116)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.audium.core.vfc.VException: A form variable must have a name.

at com.audium.core.vfc.form.VForm.add(VForm.java:351)

at com.audium.core.vfc.form.VForm.add(VForm.java:327)

at com.cisco.pt.cvp.vxml.ctrl.GetSipHeaders.addXmlBody(GetSipHeaders.java:125)

at com.audium.server.voiceElement.VoiceElementBase.getVoiceElementResult(VoiceElementBase.java:746)

Aziz,

That error suggests the VoiceXML is invalid; did you modify the code?  Anyway, attached is a JAR with the custom element if you want to try that instead.  If you think the SIP headers are not visible then make sure you have header-passing enabled under voice service voip --> sip config on the gateway.

Not sure if you're concerned right now about what will happen with the VVB but be aware that getting SIP headers this way will simply not work.  In that case you have to get them via the CVP Call Server and ICM script or use a different custom approach to query the ingress gateway.

Paul

Hi Paul,

Thanks for the jar file, it worked and we are getting the sip headers now, initially we were getting the same error but we fixed it  it was because we were setting the sip header incorrectly, we fixed that and it worked.

Thanks

Aziz.

Hi how did you fix the issue?

 

Im capture the FROM but seeing From: "--CVP_11_5_1_0_1_0_349" - Is this default if the caller does not sent a name ?

 

Im testing via PSTN and so see the above,?

 

Unfortunately, rather than using a custom header, survivability.tcl sets the remote party name / display info as an indicator that it's in the signalling path so you will always get this appearing in Remote-Party-ID and From headers when the call has transited survivability.tcl. It is possible to override / eliminate it in the ICM script before the call is routed.



@ptindall  - Just wonder if migration to VVB will break this solution. I have similar requirement and this solution will fit me. However I do not want to use it if in the future when we migrate to VVB and this will stop working ?

 

Is the any VVB compatible solution ? 

ptindall
Cisco Employee
Cisco Employee

Yes, there is a VVB compatible solution but there are implications.  It relies on querying an IOS device in the signalling path to access named SIP headers.

 

Published quite a while ago but not sure how much use it's had.

 

https://twitter.com/tindallpaul/status/882237861143212032

Thanks @ptindall , Great work as always.

Hi Paul,

 

We have standalone cvp 11.6 integrated with vvb 11.6 for self service IVR.

 

We have deployed an application for IVR. We are trying to parse the sip headers in the invite message using session.com.cisco.proto_headers['From'] but we are not able to parse the header and getting below error.

 

GetSIPHeader_01,element,error,error.semantic: Error in eval(): var From=(session.com.cisco.proto_headers['From'].replace(new RegExp('=' 'g' )'::'));; nested exception is: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "From" from undefined

 

I tried accessing your twitter URL but the documents are not there for VVB. Kindly need your help on this.

What you're doing with the proto_headers session variable only works with the IOS VB.

 

You can find the materials for a solution that will work with VVB here:  https://t.co/E3fKeFPLTq

It's not ideal but does the job.

 

Paul