Injecting DTMF event in the midst of RTP media streaming?

Hi all, I am attempting to implement a mechanism that allows me to inject DTMF RTP events in an RTP media stream. This is useful in telephony applications where the users are prompted to enter digits while being served by automated voice services such as answerinng services or tele-bankings etc. So basically my approach is to extend Sun's RTP packetizer and intercept outgoing packets when necessary and replace them with the appropriate DTMF RTP (RFC 2833) packets. Sounds simple enough. So I derived my custom packetizer from com.sun.media.codec.audio.ulaw.Packetizer, and over-ridden method process(). Normally my packetizer's method process() simply delegates the functionality to its parent class's process() method. When a DTMF digit is required I'd take the outputbuffer generated by the parent's process() and modify its header and payload to turn it into a DTMF RTP packet. The problem is that the class RTPHeader is so limited, there is no way to set the payload type, sequence number, ... And the documentation is precious few and far in between. If someone has solved this issue, or if you have a reference to some documentation that describes the inner working of JMF's codec chaining, I would appreciate some pointers. What I need to know is:
- What JMF does with the Buffer objects between stages (from one codec to the next)?
- The data portion of Buffer is an Object of arbitray class, what on earth does JMF do with that?
- How does JMF take a Buffer object and turn it into a UDP packet?
- How do I go about creating an RTP header and fill it with the information (payload type, timestamp, sequence number, ...) that I want?
Thanks in advance,

I don't know what the heck RTPHeader represents but it sure doesn't seem to conform to RFC1889. And also, it seems the UDP RTP packets are formed somewhere after the packetizer and before the RTP connector, someone oughta jot all this down in a book. So anyway, using my own RTPConnector implementation I have some control over the outgoing/incoming RTP packets, to access and manipulate the real RTP header (not RTPHeader), I devised a new class that takes the RTP packet buffer and provides an API to examine and manipulate some RTP info directly on the buffer without doing any unecessary data copy (you guys can extend it to do more as per your requirement):
package com.mycompany.media;
import javax.media.rtp.RTPConnector;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.io.IOException;
import javax.media.protocol.ContentDescriptor;
import javax.media.protocol.SourceTransferHandler;
import java.net.DatagramPacket;
import javax.media.protocol.PushSourceStream;
import javax.media.rtp.OutputDataStream;
import java.net.SocketException;
import mitel.utilities.MiQueue;
import java.nio.ByteBuffer;
import java.util.LinkedList;
class MiRtpHeader
     byte[] data;
     int myoffset;
     public MiRtpHeader(byte[] buf, int offset, int len) throws ArrayIndexOutOfBoundsException
          if(len < 12)
               throw new ArrayIndexOutOfBoundsException("Buffer not large enough to contain a basic RTP header");
          data = buf;
          myoffset = offset;
     public boolean getExtension()
          return (0 != (data[myoffset] & 0x10));
     public void setExtension(boolean state)
          if(state)
               data[myoffset] = (byte)(data[myoffset] | 0x10);
          else
               data[myoffset] = (byte)(data[myoffset] & 0xef);
     public boolean getMarker()
          return (0 != (data[myoffset + 1] & 0x80));
     public void setMarker(boolean state)
          if(state)
               data[myoffset + 1] = (byte)(data[myoffset + 1] | 0x80);
          else
               data[myoffset + 1] = (byte)(data[myoffset + 1] & 0x7f);
     public int getTs()
          ByteBuffer tsBuf = ByteBuffer.wrap(data, myoffset + 4, 4);
          return tsBuf.getInt();
     public void setTs(int ts)
          ByteBuffer tsBuf = ByteBuffer.wrap(data, myoffset + 4, 4);
          tsBuf.putInt(ts);
     public int getPayloadType()
          ByteBuffer ptBuf = ByteBuffer.wrap(data, myoffset + 1, 1);
          return ptBuf.get();
}

Similar Messages

  • RTP Media Stream with "Third Party SIP Device" always through CUCM

    Hello,
    i have i quite strage problem on one of my customers locations:
    we have a cucm 7.1.5(SU4) with the cucm in the datacenter. And we have a small location(branch office) which has a small wan connection to the datacenter (1MBit/s).
    In this location we have several Kirk (Polycom) Dect phones which register as "Third Party SIP Device - Basic" on the CUCM.
    (The problem is the same if i use the X-Lite SIP Client instead)
    When this SIP Phones or the X-Lite Client dials a internal Number of the same location the RTP Media Streams goes directly from the SIP Client to the phone. But if they dial an external number the RTP Stream goes from the SIP Client via the wan connection to the CUCM and back via the wan connection to the 2901 H.323 Gateway (on the same location).
    and of course if i now start a big download or upload i'm no longe able to complete the phone call because we have no QOS on the wan connection, because we don't want to make calls over this connection.
    When i look at the Sniffer files with Wireshark i see that the CUCM sends his own ip adresse in the SDP Header for the RTP Stream to the SIP Client. And this of course is wrong because the RTP Stream should always reside on the branch office.
    i tested this in my lab (CUCM 8.5) and it is the same. i used the "Standard SIP Profile" and a Basic Third Party SIP Device"
    The SCCP Phones on the same location which are configured with the same Region, Location, Device Pools, Media Resources and which use the same Gateway for external calls do not have this problem.
    In the Gateway configuration "MTP Required" is not activated and i tested it in my lab with some Cisco SIP Phones (9971) and they are also not affacted with this problem.
    any ideas?

    do you have a SIP trunk to the external devices with MTP required checked ?

  • Injecting DTMF events from external system

    Hello,
    I want to send dtmf events to cisco cvp, these events will be pushed to the platform from another channel (tcp or http or webservice...)
    The target is: to send dtmf events on behalf of the caller
    Scenairo:
    CallerA: calls the IVR and does not press anything
    Another software system: sends message to the IVR with content similar to: "calledID=xxxx&pressedKey=1"
    IVR: acts as if callerA pressed 1 and changes the prompt being played
    I tried to find this feature in the following pdfs, but didnt find it yet
    # Element Specifications for Cisco Unified CVP VXML Server and Cisco Unified CallStudio.pdf
    # Programming Guide for Cisco Unified CVP VXML Server and Cisco Unified CallStudio.pdf
    please advise, thank you
    Khaled

    I think you'll have a better chance of getting your question answered in the developer forums.
    http://cdn.cisco.com/web/cvp/forums/-/message_boards/category/1056972

  • In ICal is there a way to see all of the text in all day events on the month view of the calendar.  Seems to wrap text only if there is a time on the event

    In ICal is there a way to see all of the text in all day events on the month view of the calendar?  Seems to wrap text only if there is a time on the event

    The paths won't agree on the two OSs so a simple XML import isn't likely to work.
    See Sync iPod/iPad/iPhone with two computers and, if needed, Make a split library portable. The techniques in the first link will work when moving the library between Windows and OS X as long as the library is "portable", but iTunes takes quite some time checking the database when the library is opened under a different OS.
    tt2

  • Bug? My events on the iPad iCal app aren't shown in the year view if they are more than two years in the future.

    My events on the iPad iCal app aren't shown in the year view if they are more than two years in the future even though I can see them on the month, week and day view. Any suggestions on how to fix it? I've tried it all. I called the apple support and they checked on their iPads. They all did the same and they couldn't help me. They suggested trying this way. I'd like to be able to plan a few years ahead and the year view would make thing so easy!
    Is this a bug?

    Go to the Home screen and double click the Home button. That will reveal the row of recently used apps at the bottom of the screen. Tap and hold on the app in question until it wiggles and displays a minus sign. Tap the minus sign to actually quit the app. Then tap anywhere on the screen above that bottom row to return the screen to normal. Then restart the app and see if it works normally.
    Then reboot your iPad. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider until the Apple logo appears. Let go of the buttons and let the iPad restart. See if that fixes your problem.

  • Is there a way to delete all events with the same title (not added as reoccurring) without deleting one at a time?

    i currently have a calendar synced that has events scheduled in perpetuity, scheduled as individual events.  I would like to delete all events with the same title.  I do not want to delete the entire calendar nor do I want to go into every event and delete individually.  These were not scheduled by me so I do not know how they were added one by one and go on forever but they are NOT scheduled as reoccurring and thus must be modified individually.
    I can do a search and find all events, is there a way to just delete all events with the same title all at once?
    this is a Microsoft outlook synced calendar and I am seemingly unable to delete the events all at one time from Microsoft as well. 
    Please help!

    If you still have access to the Outlook calendar in Outlook, I would delete them from there. There are a number of ways to do that, but if you open the individual event in Outlook, does it show a repeating pattern? If not, then you may have to delete them individually, but that is not that difficult either. Go into the calendar and then change the view to a list view. From there you can sort the view according to subject. This should bring all of these same appointments together in the list and you can select the group in Outlook and delete them. Once you do that, you can change your view back and then sync the phone. That will remove the events from the phone.

  • How to refresh the Expired Login Form on the onChange event of the password

    Hi,
    In the Expired Login Form I have places a custom label. My requirement is that on the onchange event of the password field the label color should change to orange if the entered password meets the password policy else red.
    I am trying the following code :
    Custom label:
    <Field name='Custom Label'>
    <Display class='Label'>
    <Property name='value' value='Custom label 1'/>
    <Property name='noNewRow'>
    <Boolean>true</Boolean>
    </Property>
    <Property name='color'>
    <block>
    <cond>
    <isTrue>
    <invoke name='checkStringQualityPolicy' class='com.waveset.ui.FormUtil'>
    <rule name='EndUserRuleLibrary:getCallerSession'/>
    <s>Default Password Policy</s>
    <invoke name='decryptToString'>
    <ref>resourceAccounts.password</ref>
    </invoke>
    <map/>
    <list/>
    <s>Configurator</s>
    </invoke>
    </isTrue>
    <s>orange</s>
    <s>red</s>
    </cond>
    </block>
    </Property>
    </Display>
    </Field>
    And on the password field i gave following in the onChange event:
    submitCommand(this.form, "Recalculate")
    But the above command is not refreshing the page. Instead on the onChange event its going back to the login.jsp.
    Any idea how to resolve the above issue.
    Thanks.

    I got it working as below but i dont know is this best practices?
    <%
        if(session.getAttribute("afterSet") != null){
             %>
        <div style="visibility:hidden">
          <iframe NAME="iframe1" src="/WebApplication2/TestController?fileDownload=test.pdf" WIDTH="40" HEIGHT="40"></iframe>
        </div>
        <%}       basically first time user visit the jsp page session attribute "afterSet" will be null so it wont create the hidden iframe tag . after it dispatched to the servlet controller and successfully processing the record it will set "afterSet" properties to some value and dispatch to itself
    after that it will popup/dialog box for user to save the pdf.
    this way the page already refreshes itself and wont have problem double clicking thing and so on

  • How to get mouse events inside the components of a JTable

    Hi!
    I have question, I think this is related to very basics of swing, however I couldn't find a solution/answer on the web.
    I have a JMyTable(a descendant of JTable), and one value on a row/column is a special class, ie. MyClass. for this class I registered a cell renderer, MyRenderer. and this renderer returns a JMyComponent, which is actually a descendant of JComponent.
    Now, if I call enableEvents(AWTEvent.MOUSE_EVENT_MASK) in the constructor of JMyTable I get events posted on processMouseEvent method. However, the same doesn't work for JMyComponent. I mean, I call enableEvents, however processMouseEvent method is not triggered.
    Could someone explain/help me with this issue?
    Thanks,
    Ozgur

    Your cell renderer components are just that: renderers. They're not added to the table and do not appear in the component hierarchy. This is because tables may be very large and adding components in would be very resource hungry.
    See here for details
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    If you want to detect events you will need to listen to events on the JTable itself, and use the rowAtPoint()/columnAtPoint() methods to determine the cell. So for instance where you might want mouseEntered() on your cell component you would have to use mouseMoved() on the table and detect when the cursor moves to a new cell.

  • In contacts there is the possibility to add a new event, as the birthdays, but they do not appear in iCal. Is there any way to make that possible? It is normal to have a person with his birthday, anniversary and others key dates you want to link to him.

    In contacts there is the possibility to add a new event, as the birthdays, but they do not appear in iCal. Is there any way to make that possible? It is normal to have a person with his birthday, anniversary and others key dates you want to link to such person, but the only one shows up is the birthday. How to be able to show all those dates linked to people in the agenda in the iCal?
    Thanks

    Hi,
    I sugggest you try my application, Dates to iCal. It is shareware with a 2 week trial period.
    Dates to iCal 2 is a replacement for Apple's birthday calendar for iCal. It has a range of features to allow the user to choose what, and what not, to sync to iCal from Address Book.
    As well as automatically syncing birthday dates from Address Book, Dates to iCal 2 can sync anniversary and custom dates. It can set up to five alarms for each date in iCal and can also set different alarms for birthdays and anniversaries. It allows the option of only syncing from one Address Book group. This application also allows for the titles of the events sent to iCal to be modified to the user's preference.
    Best wishes
    John M
    As I sell software on my site and ask for donations, the Apple Support Communities Use Agreement requires that I state that I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • I can't be the only person who has this problem - when a month ends on a Saturday I can't drag events into the next month and instead have to cut and paste - a real pain in the butt. I thought there was something called "scroll" but I can't find that

    I can't be the only person who has this problem with iCal- when a month ends on a Saturday I can't drag events into the next month and instead have to cut and paste - a real pain in the butt. I thought there was something called "scroll" but I can't find that.

    Yeah that works, but, it involves a click on the event, a click on edit, a click on the date, keystrokes, plus, since you can't see the next month you have to have a calendar in front of you so as to put it to the right date. It's easier just to cut it and advance the month and paste it, once you are in the right month you can move it around helter skelter willy nilly no problems. Although now that you mention it I will try it, maybe it is easier than cut and paste as I don't really care about the date, as long as it gets moved into the right month I can drag it around all I want.

  • Is there a way to flag events on the Calendar differently?  I want to put bills in my Calendar on the days they are usually due (repeating monthly).  I want to flag them somehow when they have been paid.

    Is there a way to flag events on the Calendar.  I want to put bills to be paid (and have them repeat monthly) on my Calendar.  I would like to be able to flag them after they are paid.  I tried to put them in using the "Home calendar" blue, and them change them to purple (Work Calendar) after I had paid them.  The problem is that once I changed a bill from blue to purple it changed all upcoming bills for future months to purple also.

    You might want to try Reminders.
    Creat a Bill Pay list, add all your bills set a reminder to repeat every month and when you pay one just check them off as complete

  • How can I move an event in my calendar to my "completed" calendar without changing all the events in the series?

    How can I move an event in my calendar to my "completed" calendar without changing all the events in the series?
    As Apple has yet to upgrade iCalendar so I can check off my events as I complete them (no, I do not want to use a task list/reminder list), I want to be able to move my events to my "completed" events calendar as I complete them. The issue is that most of my events are repeating events, and it changes the entire series. How do I change only the event I clicked on using my iPhone?
    Thanks

    If you change anything in a repeating calendar entry it will give you the option of disconnecting it from the series. So may any random change, choose to not change the series.

  • How can I view my photos in "Events" like in iPhoto? How can I create events?  I have 55,000 photos and 1700 events so the only way I can possibly manage my photos is using events that are one slide in size.

    I have 55,000 images organized into about 1700 events. The only reasonable way to view my library is using events in iPhoto where each event has one image That still leaves 1700 images to sort through but that is a lot easier than 55,000 images.  In the side bar is a folder with "iPhoto Events" but those views still show all of the slides.  How can I create events and view my photos as events as in iPhoto?  Events are critical for large libraries and has been my primary way to sort images.
    Thanks!

    I had a problem a couple of months ago when iPhotos suddenly rearranged the order of my Events (Why won't iPhoto let me arrange my photos?) .  I was told "Use albums not events - events are not a good way to organize - albums and folder are designed for organisation and are very flexible".
    Haha!  I should have paid attention and read between the lines!  My iPhotos were highly organised groupings - not according to date but the way I wanted them - and it was so easy to do!  I see now that if I had them all in albums, as per the Apple Apologist suggestion, I wouldn't have this unholy mess I have been left with just to make iPhone & iCloud users happy.  I am now going through Photos and making Albums (of what used to be in my Events)  ... maybe I'll get this finished before they do another non user friendly update!

  • How to use the drop event of the tree control in LabVIEW 8.20?

    Hi,
                I am using the two tree controls in my application to provide a option for the user to drag and drop item from one tree to the other.  I have to validate the user selection. I tried to capture the user drop event  using the event structure. The problem I am facing is, I am not able to drop the item even though i have wired a constant true to the filter(Accepted?) in the event case. I have enable the property(Allow droping) in the right menu of the tree control also.
              While configuring an event case for (drop, drag entered and some thing like this) only I am getting the problem otherwise it is working fine.  
    What do i need to do to caprture the drop event ?
    Is there any way to avoid the item duplication while droping a new item in the tree control ?
    or how can i do this?
    Thanks,
    Pandiarajan R

    Hi Pandiarajan,
    I hope you are doing well today! There is a lengthy discussion on the Tree Control Drag & Drop feature at this forums post including contributions from the developer of the Drag & Drop feature:
    Tree Control Drag & Drop in LabVIEW 8
    By avoiding item duplication, do you mean that you don't want the same item to be in the old tree control or do you not want more than one item in the new tree control?
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • How does iCal, or Calendar, order the display of multiple events for the same time?

    I can't for the life of me figure out how iCal orders the display of multiple items at the same time.  Does anyone have a clue?  It's not alphabetical.  It's not according the the order of the calendars in the left pane.  Is it just random?  Any help would be greatly appreciated.

    In the focus lost eventhandling start a thread which does
    the actual handling.
    the new thread waits for a little time (0.1 seconds)
    the click event of the button checks for a thread like the one above and tells it not to execute
    This way you execute the for the lost focus event only if
    the ok button isn't clicked in the same process ... not
    realy good, because it kind of relies on the ordering of threads ... but maybe it still works for you?

Maybe you are looking for

  • Calling a web service from Oracle 10g forms

    Hi Everybody I want to send SMS from my 10g forms.... I searched for the topic and I got the following link "http://www.oracle.com/technology/products/forms/htdocs/10gr2/howto/webservicefromforms/ws_10_1_3_from_forms.html" Now I have downloaded "wscl

  • Getting movies onto your ipod

    I can't get my premiere elements movies onto my ipod classic (80Gb) - I can drag the movie into i tunes and watch it using itunes, but when I sync my ipod, it says it cannot synchronise the movie - anyone solved this problem?

  • Materail determination palnt updation

    Hello sap gurus, I want to keep parents line for a  customer plant 5050 and child line for my depot 5005 for material determination in sales order. is  it possible to have different plants for the same material in a sales order. I have determined the

  • HT5312 I forgot a security question. and it will not let me use my $15.00 gift card I bought today.

    I am trying to use my $15.00 gift card I bought today and it wont let me, because I do not remember 1 of my security questions.

  • IPhoto album name

    Dear all, I manage my photos in iPhoto in albums. Is there any option how to get the album name where the photo is placed when I'm on the photo in Evens, or Last Import, or just Photos? I managed some of the photos and placed them in different albums