Link to home
Start Free TrialLog in
Avatar of MRS
MRSFlag for United States of America

asked on

asterisk callid vs uniqueid

We have written a softphone in VB.NET that connects to a Asterisk PBX.  In looking at the asterisk database, I see that there is a UNIQUEID for each call.  But SIP seems to use a CALLID field as the key value for calls.

Does anyone know of a way to convert a UNIQUEUID to a CALLID or visa versa?  Or is there a what to have the UNIQUEID passed in the SIP message?  Or CALLID stored in the Asterisk Database?

Thanks in advance
Avatar of Ron Malmstead
Ron Malmstead
Flag of United States of America image

Take a look at SipAddHeader, if you want to place additional info in the sip message.

http://www.voip-info.org/wiki/view/Asterisk+cmd+SipAddHeader
Avatar of MRS

ASKER

I tried something similar to that, but it doesn't seem to work when you are using SIP connections, only when you are dealing with Asterisk directly..
A SIP channel has a variable.. ${SIPCALLID}
This is the "Call-ID:"  in the Sip Header message.
You can access it in the dialplan to store it in the DB.

Additionally you have the ${UNIQUEID}, which is the current call id.

You could possibly combine these two into the Asterisk DB..
For example..   Set(__ConversationID=${SIPCALLID}-${UNIQUEID}), or place them in seperate columns for query purposes.

Otherwise, SipAddHeader() is the only way I'm aware of to introduce extra information into the Sip Header message.
I believe this only comes accross on the initial INVITE message though.
Avatar of MRS

ASKER

I am not sure I follow.  I am still pretty new to Asterisk.  Is that something I could force into the SIP header so that the UniqueID would be returned?

I am using a 3rd party control (ozeki) to handle the communicate with the PBX via SIP/UDP, so I don't know if the commands that are in the link you sent will work?
In your dialplan.. you would have something like this..

exten => _1XXX,1,SIPAddHeader(X-UNIQUE-ID: ${UNIQUEID})
exten => _1XXX,n,Dial(SIP/${EXTEN})
..then in your sip phone application, you would need to examine the first sip INVITE message.. to get the information.
Avatar of MRS

ASKER

Thanks for all the info.  How do I modify a dialplan on the Asterisk box.  Would I add those lines to the extensions.conf or something?
ASKER CERTIFIED SOLUTION
Avatar of Ron Malmstead
Ron Malmstead
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MRS

ASKER

Thanks for all the info...
Avatar of Gabriel Fernandez
Gabriel Fernandez

how can i get SIP Header info in Ozeki C# SIP SDK?