struct Header *BuildResponseContactHeader(MESSAGE *request) { CONTACT_HEADER *c = CreateContactHeader(); URI *uri = CreateUri(URI_SCHEME_SIP, "88001", GetLocalIpAddr(), LOCAL_PORT); ContactHeaderSetUri(c, uri); return (struct Header *)c; }
struct Header *BuildRequestContactHeader(MESSAGE *message, struct Dialog *dialog) { struct UserAgent *ua = DialogGetUserAgent(dialog); URI *uri = CreateUri(URI_SCHEME_SIP, UaGetUserName(ua), GetLocalIpAddr(), 0); UriAddParameter(uri, "line", "6c451db26592505"); CONTACT_HEADER *contact = CreateContactHeader(); ContactHeaderSetUri(contact, uri); return (struct Header *)contact; }
struct Header *BuildRequestViaHeader(MESSAGE *message, struct Dialog *dialog) { URI *uri = CreateUri("", "", GetLocalIpAddr(), LOCAL_PORT); VIA_HEADER *via = CreateViaHeader(uri); struct Parameters *ps = ViaHeaderGetParameters(via); char branch[32]; AddParameter(ps, "rport", ""); GenerateBranch(branch); AddParameter(ps, VIA_BRANCH_PARAMETER_NAME, branch); return (struct Header *)via; }
CDemoAadjure::CDemoAadjure() { GetLocalIpAddr(m_localIp); m_localSocketId = CreateSocketForRtpc(m_localIp, LOCALPORT); }