Changeset 451:98d5d2016443 in verona for phapi/phapi.c


Ignore:
Timestamp:
Apr 3, 2012 12:44:46 PM (14 months ago)
Author:
Vadim Lebedev <vadim@…>
Branch:
default
Children:
452:ef158d6b3770, 453:be77f63cf114
rebase_source:
8ca853b359dde096bf1d951a96ce23fed3477f31
Message:

implement sendMessage3 api

File:
1 edited

Legend:

Unmodified
Added
Removed
  • phapi/phapi.c

    r449 r451  
    18851885 
    18861886PHAPI_EXPORT int 
     1887phLineSendMessage3(int vlid, const char *target, const char *uri, 
     1888                const char *buff, const char *mime, int hcount, const struct ph_hdr_val *hdrs) 
     1889{ 
     1890        int i,j; 
     1891        struct vline *vl; 
     1892        char from[512]; 
     1893        osip_message_t *msg; 
     1894 
     1895 
     1896 
     1897        if (!phIsInitialized) 
     1898                return -PH_NOTINIT; 
     1899 
     1900        vl = ph_valid_vlid(vlid); 
     1901        if (!vl) { 
     1902                return -PH_BADVLID; 
     1903        } 
     1904 
     1905        if ( !nonempty(uri)) { 
     1906                return -PH_BADARG; 
     1907        } 
     1908 
     1909        ph_build_from(from, sizeof(from), vl); 
     1910 
     1911        eXosip_lock(); 
     1912        i = eXosip_message_build_request(&msg, "MESSAGE", (char *)uri, 
     1913                        from, vl->proxy); 
     1914 
     1915 
     1916        ph_req_set_body(msg, buff, mime); 
     1917        osip_message_set_contact(msg, vl->contact); 
     1918 
     1919        for (j = 0; j < hcount; j++) 
     1920                set_custom_header(msg, hdrs[j].hdr, hdrs[j].val); 
     1921 
     1922        ph_apply_customizations(msg, NULL, NULL); 
     1923        i = eXosip_message_send_request(msg); 
     1924 
     1925        eXosip_unlock(); 
     1926        return i > 0 ? i : -PH_BADARG; 
     1927} 
     1928 
     1929 
     1930PHAPI_EXPORT int 
    18871931phCallSendMessage(int cid, const char *buff, const char *mime) 
    18881932{ 
Note: See TracChangeset for help on using the changeset viewer.