1 #ifndef _ISDNGATEWAYDIALOG_H_ 2 #define _ISDNGATEWAYDIALOG_H_ 3 4 #include "AmApi.h" 5 #include "AmSession.h" 6 #include "ampi/UACAuthAPI.h" 7 8 class GWSession : public AmSession, public CredentialHolder 9 { 10 public: 11 GWSession(const string& auth_realm, const string& auth_user, const string& auth_pwd); 12 ~GWSession(); 13 14 inline UACAuthCred* getCredentials(); //auth interface 15 AmSipRequest invite_req; 16 17 static GWSession* CallFromOutside(std::string &fromnumber, std::string &tonumber, int backend, AmAudio* device); 18 void setOtherLeg(AmAudio *otherleg); 19 void onProgress(const AmSipReply& reply); 20 21 //Parent methods 22 //virtual void process(AmEvent* ev); 23 //virtual AmPayloadProviderInterface* getPayloadProvider(); 24 //virtual void negotiate(const string& sdp_body, 25 //virtual void onDtmf(int event, int duration); 26 //virtual void onStart(){} 27 void onInvite(const AmSipRequest& req); 28 void onCancel(const AmSipRequest& req); 29 void onSessionStart(const AmSipRequest& req); 30 void onSessionStart(const AmSipReply& reply); 31 //virtual void onEarlySessionStart(const AmSipReply& reply){} 32 void onRinging(const AmSipReply& reply); 33 void onBye(const AmSipRequest& req); 34 //virtual void onSipEvent(AmSipEvent* sip_ev); 35 void onSipRequest(const AmSipRequest& req); 36 void onSipReply(const AmSipReply& reply, AmSipDialog::Status old_dlg_status); 37 //virtual void onRtpTimeout(); 38 //virtual void onSendRequest(const string& method, const string& content_type, const string& body, string& hdrs, int flags, unsigned int cseq); 39 //virtual void onSendReply(const AmSipRequest& req, unsigned int code,const string& reason,const string& content_type, const string& body,string& hdrs,int flags) 40 void on_stop(); 41 42 private: 43 UACAuthCred credentials; 44 AmAudio *m_OtherLeg; 45 46 }; 47 #endif 48