I searched SO before asking this question , there is no answers satisfying my needs.
So this is my requirement ,
I have this piece of code for detecting the incoming SMS , but it does not say how to dump these messages. I have successfully blocked the incoming calls but for messages i am not sure how to do this. any help here would be very much appreciated.
I am ok in using any private APIs.
if ([notifyname isEqualToString:@"kCTSMSMessageReceivedNotification"])
{
    if ([[(NSDictionary *)userInfo allKeys]
         containsObject:@"kCTSMSMessage"]) // SMS Message
    {
        CTSMSMessage *message = (CTSMSMessage *)
        [(NSDictionary *)userInfo objectForKey:@"kCTSMSMessage"];
        NSString *address = CTSMSMessageCopyAddress(NULL, message);
        NSString *text = CTSMSMessageCopyText(NULL, message);
        //NSArray *lines = [text componentsSeparatedByString:@"\n"];
        printf(" %s %s\n", [address UTF8String],[text UTF8String]);
        //printf(" %s\n", [text cString]);
        fflush(stdout);
    }
}
else if ([notifyname isEqualToString:@"kCTMessageReceivedNotification"])//received SMS
{
    /*
     kCTMessageIdKey = "-2147483636″;
     kCTMessageTypeKey = 1;
     */
    NSDictionary *info = (NSDictionary *)userInfo;
    CFNumberRef msgID = (CFNumberRef)[info objectForKey:@"kCTMessageIdKey"];
    int result;
    CFNumberGetValue((CFNumberRef)msgID, kCFNumberSInt32Type, &result); 
    /*
     Class CTMessageCenter = NSClassFromString(@"CTMessageCenter");
     id mc = [CTMessageCenter sharedMessageCenter];
     id incMsg = [mc incomingMessageWithId: result];
     int msgType = (int)[incMsg messageType];
     if (msgType == 1) //experimentally detected number
     {
     id phonenumber = [incMsg sender];
     NSString *senderNumber = (NSString *)[phonenumber canonicalFormat];
     id incMsgPart = [[incMsg items] objectAtIndex:0];
     NSData *smsData = [incMsgPart data];
     NSString *smsText = [[NSString alloc] initWithData:smsData encoding:NSUTF8StringEncoding];
     }
     */
}
Thanks Naveen