Quantcast
Channel: Dialogic PowerMedia HMP GlobalCall and R4 API - Recent Threads
Viewing all articles
Browse latest Browse all 1151

RE: SIP Instant Messaging via Dialogic HMP

$
0
0

Yes, it seems to be working now. Here is my code:

	GC_PARM_BLKP parameterBlock = nullptr;
	GC_PARM_BLKP mimeBlock = nullptr;
	GC_PARM_BLKP returnBlock = nullptr;

	char *contentType = "Content-Type: text/plain";
	char const *messageBody = message.c_str();

	if (gc_util_insert_parm_ref_ex(&mimeBlock, IPSET_MIME, IPPARM_MIME_PART_TYPE, (unsigned long)strlen(contentType) + 1, contentType) < 0 ||
		gc_util_insert_parm_val(&mimeBlock, IPSET_MIME, IPPARM_MIME_PART_BODY_SIZE, sizeof(unsigned long), strlen(messageBody)) < 0 ||
		gc_util_insert_parm_val(&mimeBlock, IPSET_MIME, IPPARM_MIME_PART_BODY, sizeof(unsigned long), (unsigned long)messageBody) < 0 ||
	        gc_util_insert_parm_val(&parameterBlock, IPSET_MSG_SIP, IPPARM_MSGTYPE, sizeof(int), IP_MSGTYPE_SIP_MESSAGE) < 0 ||
		gc_util_insert_parm_val(&parameterBlock, IPSET_MIME, IPPARM_MIME_PART, sizeof(unsigned long), (unsigned long)mimeBlock) < 0)
	{
		//  log error
	}
	else if (gc_Extension(GCTGT_GCLIB_CRN, crn, IPEXTID_SENDMSG, parameterBlock, &returnBlock, EV_ASYNC) != GC_SUCCESS)
	{
		// log error
	}
	else
	{
		// success send!
	}

	if (parameterBlock != nullptr) gc_util_delete_parm_blk(parameterBlock);
	if (returnBlock != nullptr) gc_util_delete_parm_blk(returnBlock);
	if (mimeBlock != nullptr) gc_util_delete_parm_blk(mimeBlock);

I can now see the SIP MESSAGE in WireShark with the Message Body, Content-Type and Content-Length all set correctly.
Thanks for your help Leonid!

Viewing all articles
Browse latest Browse all 1151

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>